/* 
   ==========================================================================
   ProSpec - Premium UI Stylesheet (Inspired by SYGESCO)
   ========================================================================== 
*/

:root {
    /* Colors */
    --bg-main: #f8fafc;
    --bg-sidebar: #0f172a;
    --bg-sidebar-active: #4f46e5;

    --primary: #4f46e5;
    --primary-light: rgba(79, 70, 229, 0.1);
    --primary-hover: #4338ca;

    --text-dark: #0f172a;
    --text-medium: #334155;
    --text-light: #64748b;
    --text-muted: #94a3b8;

    --border-color: #e2e8f0;

    /* Semantic Colors */
    --success: #10b981;
    --success-light: #ecfdf5;
    --success-border: #a7f3d0;

    --info: #3b82f6;
    --info-light: #eff6ff;
    --info-border: #bfdbfe;

    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-border: #fde68a;

    --danger: #ef4444;
    --danger-light: #fef2f2;
    --danger-border: #fca5a5;

    /* Sizes */
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-medium);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* App Wrapper for Sidebar Layout */
.app-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
}

.sidebar-logo i {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.sidebar-logo-text span {
    color: var(--primary-hover);
}

.sidebar-logo-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    margin-top: -2px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    padding: 24px 24px 10px 24px;
    letter-spacing: 1px;
}

.sidebar-menu {
    list-style: none;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-menu-item a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-menu-item a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-menu-item.active a {
    color: #fff;
    background-color: var(--bg-sidebar-active);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

/* Sidebar Footer Profile & Logout */
.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px 16px;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 0 8px;
}

.sidebar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background-color: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-sidebar-logout:hover {
    background-color: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

/* Main Content Area */
.main-layout {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    transition: var(--transition);
}

/* Main Header */
.main-header {
    height: var(--header-height);
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-welcome {
    display: flex;
    flex-direction: column;
}

.header-welcome h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
}

.header-welcome span {
    font-size: 0.8rem;
    color: var(--text-light);
}

.header-search {
    position: relative;
    width: 320px;
}

.header-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.header-search input {
    width: 100%;
    background-color: #f1f5f9;
    border: 1px solid transparent;
    padding: 10px 16px 10px 42px;
    border-radius: 20px;
    color: var(--text-medium);
    font-family: inherit;
    font-size: 0.85rem;
    transition: var(--transition);
}

.header-search input:focus {
    outline: none;
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Page Wrapper */
.page-container {
    padding: 40px;
    flex: 1;
}

/* Dashboard Header Actions */
.page-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header-actions h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
}

.page-header-actions p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 35px;
}

.kpi-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    border-left: 4px solid var(--primary);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.kpi-card.kpi-blue {
    border-left-color: var(--primary);
}

.kpi-card.kpi-green {
    border-left-color: var(--success);
}

.kpi-card.kpi-orange {
    border-left-color: var(--warning);
}

.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
}

.kpi-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.kpi-blue .kpi-icon-badge {
    background-color: var(--primary-light);
    color: var(--primary);
}

.kpi-green .kpi-icon-badge {
    background-color: var(--success-light);
    color: var(--success);
}

.kpi-orange .kpi-icon-badge {
    background-color: var(--warning-light);
    color: var(--warning);
}

/* Card Container for Data Grid */
.data-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    overflow: hidden;
}

.data-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.data-card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.data-card-header h3 i {
    color: var(--primary);
}

/* Tabs inside Card */
.tabs-nav {
    display: flex;
    gap: 8px;
}

.tab-link {
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.tab-link.active,
.tab-link:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: tabFadeIn 0.3s ease;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Alert styling */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--success-light);
    border-color: var(--success-border);
    color: var(--success);
}

.alert-error {
    background-color: var(--danger-light);
    border-color: var(--danger-border);
    color: var(--danger);
}

.alert-dismissible {
    position: relative;
}

/* Tables styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
    border: 1px solid var(--border-color);
}

.custom-table th {
    background-color: #f8fafc;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 18px;
    border-bottom: 2px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.custom-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    color: var(--text-medium);
    vertical-align: middle;
}

.custom-table th:last-child, 
.custom-table td:last-child {
    border-right: none;
}

.custom-table tbody tr {
    transition: var(--transition);
}

.custom-table tbody tr:nth-child(even) {
    background-color: rgba(248, 250, 252, 0.6);
}

.custom-table tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.04);
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

.empty-row-text {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
    font-style: italic;
}

/* Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-secondary {
    background-color: #fff;
    color: var(--text-medium);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    color: var(--text-dark);
}

.btn-danger {
    background-color: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger-border);
}

.btn-danger:hover {
    background-color: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-icon {
    padding: 8px;
    border-radius: 8px;
    font-size: 0.95rem;
}

/* Badges styling */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

/* Split-screen login styles */
.login-split-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
    background-color: #fff;
}

.login-form-side {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 14% 60px 4%;
    position: relative;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 50px;
}

.login-brand i {
    color: var(--primary);
    font-size: 1.6rem;
}

.login-brand span {
    color: var(--primary);
}

.login-form-header {
    margin-bottom: 35px;
}

.login-form-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.login-form-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Minimalist Underline Inputs */
.login-form .form-group {
    margin-bottom: 25px;
}

.login-form label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: none;
    letter-spacing: 0;
}

.login-form input {
    width: 100% !important;
    border: none !important;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 12px 0 !important;
    background: transparent !important;
    color: var(--text-dark) !important;
    font-size: 1rem !important;
    font-family: inherit !important;
    transition: var(--transition) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.login-form input::placeholder {
    color: var(--text-muted);
}

.login-form input:focus {
    outline: none !important;
    border-bottom-color: var(--primary) !important;
    box-shadow: none !important;
    background: transparent !important;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background-color: #111524;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 15px;
}

.btn-login:hover {
    background-color: #1e2538;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-footer-text {
    position: absolute;
    bottom: 30px;
    left: 6%;
    right: 14%;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: left;
}

/* Right Graphical Panel */
.login-graphic-side {
    flex: 2.5;
    margin: 20px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 50px;
    background: #0b0f19;
    box-shadow: var(--shadow-xl);
}

/* Technical grid sheet pattern */
.login-graphic-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 1;
    pointer-events: none;
}

/* Atmospheric Mesh Glows */
.login-glow-1 {
    position: absolute;
    top: 10%;
    right: 5%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.35) 0%, rgba(6, 182, 212, 0) 70%);
    filter: blur(110px);
    z-index: 1;
}

.login-glow-2 {
    position: absolute;
    bottom: 5%;
    left: 5%;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, rgba(168, 85, 247, 0) 70%);
    filter: blur(120px);
    z-index: 1;
}

.login-glow-3 {
    position: absolute;
    top: 35%;
    left: 20%;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, rgba(99, 102, 241, 0) 70%);
    filter: blur(100px);
    z-index: 1;
}

/* Decorative SVG Network */
.login-network-svg {
    position: absolute;
    top: 20%;
    left: 0;
    width: 110%;
    height: 60%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.85;
}

/* Floating overlay glassmorphic card on graphic side */
.graphic-overlay-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 280px;
    align-self: flex-end;
    z-index: 2;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.graphic-overlay-icon {
    width: 42px;
    height: 42px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
}

.graphic-overlay-info {
    display: flex;
    flex-direction: column;
}

.graphic-overlay-title {
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
}

.graphic-overlay-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.graphic-quote-container {
    z-index: 2;
    max-width: 480px;
}

.graphic-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.graphic-status-tag span {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #10b981;
}

.graphic-quote {
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.6;
    color: #f1f5f9;
    margin-bottom: 20px;
}

.graphic-author {
    display: flex;
    flex-direction: column;
}

.graphic-author-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
}

.graphic-author-title {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Modals Refined */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalScaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-content.modal-lg {
    max-width: 680px;
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Modal Form Fields */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 6px;
    display: block;
}

.form-group label span {
    color: var(--danger);
}

.form-group input,
.form-group textarea {
    width: 100%;
    background-color: #fff;
    border: 1px solid var(--border-color);
    padding: 11px 16px;
    border-radius: 8px;
    color: var(--text-medium);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Toast Container & Notification styles */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: #fff;
    border-radius: 10px;
    padding: 14px 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    border: 1px solid var(--border-color);
    animation: toastSlideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.toast-success {
    border-left: 4px solid var(--success);
}

.toast.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-message {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Simple Footer */
.app-footer {
    text-align: center;
    padding: 24px 40px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    background-color: #fff;
}

/* Responsive */
@media (max-width: 1024px) {
    .login-graphic-side {
        display: none;
    }

    .login-form-side {
        flex: 1;
        padding: 40px 15%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-layout {
        margin-left: 0;
    }

    .main-header {
        padding: 0 20px;
    }

    .page-container {
        padding: 20px;
        padding-bottom: 90px; /* Espace pour le bouton collé en bas */
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    /* Table cards conversion on mobile */
    .table-responsive {
        border: none !important;
        overflow-x: visible !important;
    }

    .custom-table {
        border: none !important;
        display: block !important;
        width: 100% !important;
    }

    .custom-table thead {
        display: none !important;
    }

    .custom-table tbody {
        display: block !important;
        width: 100% !important;
    }

    .custom-table tr {
        display: block !important;
        background-color: #fff !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 12px !important;
        padding: 16px !important;
        margin-bottom: 16px !important;
        box-shadow: var(--shadow-sm) !important;
        transition: var(--transition) !important;
    }

    .custom-table tr:hover {
        background-color: #fff !important;
        transform: translateY(-2px);
        box-shadow: var(--shadow-md) !important;
    }

    .custom-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 0 !important;
        border: none !important;
        border-bottom: 1px dashed #f1f5f9 !important;
        text-align: right !important;
        width: 100% !important;
        font-size: 0.85rem !important;
    }

    .custom-table td:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }

    .custom-table td:first-child {
        padding-top: 0 !important;
    }

    .custom-table td::before {
        content: attr(data-label) !important;
        font-weight: 700 !important;
        color: var(--text-dark) !important;
        font-size: 0.75rem !important;
        text-transform: uppercase !important;
        text-align: left !important;
        margin-right: 15px !important;
        flex-shrink: 0 !important;
    }

    .custom-table td strong {
        text-align: right !important;
    }

    /* Accordion / Collapsible Cards on Mobile */
    .custom-table tr {
        cursor: pointer !important;
    }

    .custom-table tr td[data-label="Interlocuteur"],
    .custom-table tr td[data-label="Contacts"],
    .custom-table tr td[data-label="Observation"],
    .custom-table tr td[data-label="Observation / Compte-rendu"] {
        display: none !important;
    }

    .custom-table tr.expanded-card td[data-label="Interlocuteur"],
    .custom-table tr.expanded-card td[data-label="Contacts"],
    .custom-table tr.expanded-card td[data-label="Observation"],
    .custom-table tr.expanded-card td[data-label="Observation / Compte-rendu"] {
        display: flex !important;
        animation: cardSlideDown 0.2s ease-out !important;
    }

    @keyframes cardSlideDown {
        from {
            opacity: 0;
            transform: translateY(-5px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Chevron style indicator next to denomination */
    .custom-table tr td[data-label="Dénomination"] strong::after {
        content: " \f078" !important;
        font-family: "Font Awesome 6 Free" !important;
        font-weight: 900 !important;
        font-size: 0.75rem !important;
        color: var(--text-light) !important;
        display: inline-block !important;
        margin-left: 8px !important;
        transition: var(--transition) !important;
    }

    .custom-table tr.expanded-card td[data-label="Dénomination"] strong::after {
        content: " \f077" !important;
        color: var(--primary) !important;
    }

    /* Sticky bottom button on mobile for commercials */
    .page-header-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }
    
    .pulse-button {
        position: fixed !important;
        bottom: 20px !important;
        left: 20px !important;
        right: 20px !important;
        z-index: 999 !important;
        box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4) !important;
        justify-content: center !important;
        padding: 14px !important;
        border-radius: 12px !important;
        font-size: 1rem !important;
        animation: pulseFAB 2s infinite !important;
    }

    @keyframes pulseFAB {
        0% {
            box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
        }
        70% {
            box-shadow: 0 0 0 12px rgba(79, 70, 229, 0);
        }
        100% {
            box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
        }
    }
}

/* Filter Toolbar styling */
.filter-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 15px;
}

.filter-period-buttons {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-medium);
    background-color: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.filter-custom-form {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-date-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-date-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0;
}

.filter-date-group input {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-medium);
}

.btn-filter-submit {
    padding: 7px 14px;
    font-size: 0.8rem;
}

/* Dashboard Grid Layout (2 Colonnes) */
.dashboard-grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .dashboard-grid-layout {
        grid-template-columns: 1fr;
    }
}

/* Top ranking widget */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ranking-badge-col {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
}

.rank-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
}

.rank-1 {
    background-color: #fef3c7;
    color: #d97706;
    font-size: 0.95rem;
}

.rank-2 {
    background-color: #f1f5f9;
    color: #475569;
}

.rank-3 {
    background-color: #ffedd5;
    color: #ea580c;
}

.rank-default {
    background-color: #f1f5f9;
    color: var(--text-light);
    font-size: 0.8rem;
}

.ranking-info-col {
    flex: 1;
}

.ranking-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.ranking-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

.ranking-progress-bar {
    width: 100%;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 4px;
}

.ranking-progress-fill {
    height: 100%;
    border-radius: 10px;
}

.rank-fill-1 { background-color: #d97706; }
.rank-fill-2 { background-color: #64748b; }
.rank-fill-3 { background-color: #ea580c; }
.rank-fill-4 { background-color: var(--primary); }


/* ==========================================================================
   PWA Install Modal
   ========================================================================== */

.pwa-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 0 24px 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.pwa-modal-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.pwa-modal-overlay.hidden {
    display: none;
}

.pwa-modal-box {
    background: #ffffff;
    border-radius: 24px 24px 16px 16px;
    padding: 32px 28px 24px;
    max-width: 420px;
    width: calc(100% - 32px);
    box-shadow: 0 -8px 60px rgba(79, 70, 229, 0.18), 0 24px 60px rgba(0,0,0,0.3);
    animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

@keyframes pwaSlideUp {
    from { transform: translateY(60px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.pwa-modal-icon {
    margin-bottom: 16px;
}

.pwa-modal-icon img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}

.pwa-modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.pwa-modal-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 20px;
}

.pwa-modal-features {
    list-style: none;
    margin: 0 0 24px 0;
    padding: 0;
    text-align: left;
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pwa-modal-features li {
    font-size: 0.875rem;
    color: var(--text-medium);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.pwa-modal-features li i {
    width: 20px;
    color: var(--primary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.pwa-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pwa-btn-install {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

.pwa-btn-install:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.5);
}

.pwa-btn-dismiss {
    width: 100%;
    padding: 10px;
    background: transparent;
    color: var(--text-light);
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.pwa-btn-dismiss:hover {
    color: var(--text-dark);
}