
:root {
    /* Sophisticated Color Palette */
    --primary-navy: #1a2332;
    --primary-slate: #2d3748;
    --accent-amber: #d97706;
    --accent-amber-light: #f59e0b;
    --accent-teal: #0d9488;
    --surface-white: #ffffff;
    --surface-light: #f8fafc;
    --surface-lighter: #f1f5f9;
    --border-subtle: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --success: #059669;
    --warning: #ea580c;
    --danger: #dc2626;
    
    /* Typography */
    --font-display: 'Fraunces', serif;
    --font-body: 'DM Sans', sans-serif;
    
    /* Spacing & Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--surface-light);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Typography Refinements */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Top Navbar */
.navbar-top {
    background: var(--primary-navy);
    border-bottom: 3px solid var(--accent-amber);
    box-shadow: var(--shadow-md);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: 70px;
}

.navbar-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--surface-white) !important;
    letter-spacing: -0.02em;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-brand .brand-accent {
    color: var(--accent-amber);
}

.navbar-brand:hover {
    opacity: 0.9;
}

.user-profile-dropdown {
    padding-right: 1.5rem;
}

.user-profile-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--surface-white);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.user-profile-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--surface-white);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-amber), var(--accent-amber-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--surface-white);
    border-right: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1020;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-nav {
    padding: 1.5rem 0;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem 0.5rem;
    margin-top: 1rem;
}

.nav-section-title:first-child {
    margin-top: 0;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav-link:hover {
    background: var(--surface-lighter);
    color: var(--text-primary);
    border-left-color: var(--accent-amber-light);
}

.sidebar-nav-link.active {
    background: linear-gradient(90deg, rgba(217, 119, 6, 0.1), transparent);
    color: var(--accent-amber);
    border-left-color: var(--accent-amber);
    font-weight: 600;
}

.sidebar-nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    margin-top: 70px;
    padding: 2rem;
    min-height: calc(100vh - 70px);
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 80px;
    left: 10px;
    z-index: 1025;
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--surface-lighter);
    box-shadow: var(--shadow-lg);
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    animation: fadeInDown 0.5s ease;
}

.page-title {
    font-size: 2rem;
    color: var(--primary-navy);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Dashboard Cards */
.metric-card {
    background: var(--surface-white);
    border-radius: 12px;
    padding: 1.75rem;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-amber), var(--accent-amber-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.metric-icon.primary {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.15), rgba(245, 158, 11, 0.1));
    color: var(--accent-amber);
}

.metric-icon.success {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.15), rgba(16, 185, 129, 0.1));
    color: var(--success);
}

.metric-icon.teal {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.15), rgba(20, 184, 166, 0.1));
    color: var(--accent-teal);
}

.metric-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.metric-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.metric-change {
    font-size: 0.875rem;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metric-change.positive {
    color: var(--success);
}

.metric-change.negative {
    color: var(--danger);
}

/* Tables */
.table-container {
    background: var(--surface-white);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    animation: fadeInUp 0.7s ease;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.table-responsive {
    border-radius: 0;
}

.custom-table {
    margin-bottom: 0;
}

.custom-table thead th {
    background: var(--surface-lighter);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border-subtle);
    white-space: nowrap;
}

.custom-table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-subtle);
}

.custom-table tbody tr {
    transition: background 0.2s ease;
}

.custom-table tbody tr:hover {
    background: var(--surface-lighter);
}

/* Badges */
.badge-custom {
    padding: 0.375rem 0.875rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-new {
    background: rgba(217, 119, 6, 0.15);
    color: var(--accent-amber);
}

.badge-contacted {
    background: rgba(13, 148, 136, 0.15);
    color: var(--accent-teal);
}

.badge-qualified {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.badge-converted {
    background: rgba(5, 150, 105, 0.15);
    color: var(--success);
}

.badge-pending {
    background: rgba(234, 88, 12, 0.15);
    color: var(--warning);
}

.badge-completed {
    background: rgba(5, 150, 105, 0.15);
    color: var(--success);
}

.badge-paid {
    background: rgba(5, 150, 105, 0.15);
    color: var(--success);
}

.badge-unpaid {
    background: rgba(220, 38, 38, 0.15);
    color: var(--danger);
}

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--accent-amber), var(--accent-amber-light));
    border: none;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(217, 119, 6, 0.2);
}

.btn-primary-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(217, 119, 6, 0.3);
    color: white;
}

.btn-outline-custom {
    border: 1.5px solid var(--accent-amber);
    color: var(--accent-amber);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: transparent;
}

.btn-outline-custom:hover {
    background: var(--accent-amber);
    color: white;
}

.btn-action {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-action i {
    font-size: 1rem;
}

/* Forms */
.form-card {
    background: var(--surface-white);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    animation: fadeInUp 0.6s ease;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-control, .form-select {
    border: 1.5px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-amber);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

/* Pagination */
.pagination {
    margin-top: 1.5rem;
    justify-content: center;
}

.page-link {
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.5rem 0.875rem;
    margin: 0 0.25rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: var(--surface-lighter);
    border-color: var(--accent-amber);
    color: var(--accent-amber);
}

.page-item.active .page-link {
    background: var(--accent-amber);
    border-color: var(--accent-amber);
    color: white;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        left: auto;
        right: 10px;
    }
}

@media (max-width: 767.98px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .table-header {
        padding: 1rem;
    }
    
    .custom-table thead th,
    .custom-table tbody td {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Document List Styles */
.document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--surface-lighter);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.document-item:hover {
    background: #e2e8f0;
    box-shadow: var(--shadow-sm);
}

.document-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.document-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--surface-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--accent-amber);
}

.document-details h6 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.document-details small {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}
