/* DocuSafe Design System - Consistent with index.html */
:root {
    /* Professional Color Palette */
    --primary-900: #0f172a;
    --primary-800: #1e293b;
    --primary-700: #334155;
    --primary-600: #475569;
    --primary-500: #64748b;
    --primary-400: #94a3b8;
    --primary-300: #cbd5e1;
    --primary-200: #e2e8f0;
    --primary-100: #f1f5f9;
    --primary-50: #f8fafc;

    --accent-600: #2563eb;
    --accent-500: #3b82f6;
    --accent-400: #60a5fa;
    --accent-100: #dbeafe;

    --success-600: #059669;
    --success-500: #10b981;
    --success-400: #34d399;

    --warning-600: #d97706;
    --warning-500: #f59e0b;
    --warning-400: #fbbf24;

    --error-600: #dc2626;
    --error-500: #ef4444;
    --error-400: #f87171;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

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

    /* Borders */
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --border-radius-2xl: 1.5rem;

    /* Soft Backgrounds */
    --bg-success-soft: #ecfdf5;
    --bg-warning-soft: #fffbeb;
    --bg-orange-soft: #fff7ed;
    --bg-error-soft: #fef2f2;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-medium: 300ms ease-in-out;
}

[data-theme='dark'] {
    /* Primary Colors - Inverted for Dark Mode */
    --primary-900: #f8fafc;
    /* Was near white */
    --primary-800: #f1f5f9;
    --primary-700: #e2e8f0;
    --primary-600: #cbd5e1;
    --primary-500: #94a3b8;
    --primary-400: #64748b;
    --primary-300: #475569;
    /* Dark backgrounds */
    --primary-200: #334155;
    --primary-100: #1e293b;
    /* Card bg */
    --primary-50: #0f172a;
    /* Body bg */

    /* Accent - Adjusted for dark mode contrast */
    --accent-600: #3b82f6;
    /* Lighter blue */
    --accent-500: #60a5fa;
    --accent-400: #93c5fd;
    --accent-100: #1e3a8a;
    /* Darker blue background */

    /* Shadows - gentler on dark */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);

    /* Dark Soft Backgrounds */
    --bg-success-soft: rgba(16, 185, 129, 0.2);
    --bg-warning-soft: rgba(245, 158, 11, 0.2);
    --bg-orange-soft: rgba(234, 88, 12, 0.2);
    --bg-error-soft: rgba(239, 68, 68, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--primary-50);
    color: var(--primary-800);
    line-height: 1.6;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--primary-100);
    /* was white */
    border-right: 1px solid var(--primary-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 20;
}

.sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--primary-100);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-600), var(--accent-500));
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-900);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius-xl);
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 0.25rem;
}

.nav-item:hover {
    background: var(--primary-200);
    color: var(--primary-800);
}

.nav-item.active {
    background: var(--accent-100);
    color: var(--accent-600);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--primary-100);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius-xl);
    color: var(--error-600);
    background: none;
    border: none;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--primary-100);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--primary-200);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-900);
}

.header-left p {
    color: var(--primary-500);
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--primary-500);
    margin-bottom: 0.5rem;
}

.breadcrumb a {
    color: var(--accent-600);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-wrapper {
    position: relative;
}

.search-input {
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    border-radius: var(--border-radius-xl);
    font-size: 0.875rem;
    width: 280px;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px var(--accent-100);
}

.search-wrapper i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-400);
}

.icon-btn {
    width: 40px;
    height: 40px;
    background: var(--primary-100);
    border: 1px solid var(--primary-200);
    border-radius: var(--border-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-600);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.icon-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--error-500);
    border-radius: 50%;
}

/* Notification Dropdown Dark Mode */
[data-theme='dark'] #notificationDropdown {
    background: var(--primary-800) !important;
    border-color: var(--primary-700) !important;
}

[data-theme='dark'] #notificationDropdown>div:first-child {
    background: var(--primary-900) !important;
    border-color: var(--primary-700) !important;
}

[data-theme='dark'] #notificationDropdown h3 {
    color: var(--primary-100) !important;
}

[data-theme='dark'] #notificationList>div {
    background: var(--primary-800) !important;
    border-color: var(--primary-700) !important;
}

[data-theme='dark'] #notificationList .notification-item,
[data-theme='dark'] #notificationList>div>div {
    background: var(--primary-800) !important;
    border-bottom: 1px solid var(--primary-700) !important;
    color: var(--primary-100) !important;
}

[data-theme='dark'] #notificationList .notification-title,
[data-theme='dark'] #notificationList strong {
    color: #ffffff !important;
}

[data-theme='dark'] #notificationList .notification-body,
[data-theme='dark'] #notificationList p {
    color: var(--primary-300) !important;
}

[data-theme='dark'] #notificationList .notification-time,
[data-theme='dark'] #notificationList small {
    color: var(--primary-400) !important;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-600), #8b5cf6);
    border-radius: var(--border-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Cards */
.card {
    background: var(--primary-100);
    border-radius: var(--border-radius-2xl);
    padding: 1.5rem;
    border: 1px solid var(--primary-200);
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-900);
}

.card-action {
    color: var(--accent-600);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.card-action:hover {
    color: var(--accent-500);
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-xl);
    font-weight: 600;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-600), var(--accent-500));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--primary-100);
    color: var(--primary-700);
    border: 1px solid var(--primary-300);
}

.btn-secondary:hover {
    background: var(--primary-50);
    border-color: var(--primary-400);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-600), var(--success-500));
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-600), var(--error-500));
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius-xl);
    border: 1px solid var(--primary-200);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--primary-100);
}

.table th {
    background: var(--primary-50);
    font-weight: 600;
    color: var(--primary-700);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tr:hover {
    background: var(--primary-50);
}

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

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-700);
    font-size: 0.875rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--primary-100);
    border: 1px solid var(--primary-300);
    border-radius: var(--border-radius-lg);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px var(--accent-100);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-md);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #ecfdf5;
    color: var(--success-600);
}

.badge-warning {
    background: #fffbeb;
    color: var(--warning-600);
}

.badge-error {
    background: #fef2f2;
    color: var(--error-600);
}

.badge-info {
    background: var(--accent-100);
    color: var(--accent-600);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--primary-500);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-300);
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-700);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* FAB */
.ds-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-600), var(--accent-500));
    color: white;
    border: none;
    border-radius: var(--border-radius-xl);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg), 0 0 30px rgba(37, 99, 235, 0.3);
    transition: all var(--transition-medium);
    z-index: 100;
}

.ds-fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: var(--shadow-xl), 0 0 40px rgba(37, 99, 235, 0.4);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--primary-50);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--accent-100);
    border-top-color: var(--accent-600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
    /* Center horizontally */
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-800);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--primary-50);
    border-radius: var(--border-radius-2xl);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

[data-theme='dark'] .modal-container {
    background: var(--primary-100);
    border: 1px solid var(--primary-200);
}

.modal {
    background: var(--primary-100);
    border-radius: var(--border-radius-2xl);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-fast);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--primary-100);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-600);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--primary-200);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background: #ecfdf5;
    color: var(--success-600);
    border: 1px solid var(--success-400);
}

.alert-warning {
    background: #fffbeb;
    color: var(--warning-600);
    border: 1px solid var(--warning-400);
}

.alert-error {
    background: #fef2f2;
    color: var(--error-600);
    border: 1px solid var(--error-400);
}

.alert-info {
    background: var(--accent-100);
    color: var(--accent-600);
    border: 1px solid var(--accent-400);
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

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

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .search-input {
        display: none;
    }

    .header {
        padding: 1rem;
    }

    .content-area {
        padding: 1rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-primary {
    color: var(--primary-800);
}

.text-muted {
    color: var(--primary-500);
}

.text-accent {
    color: var(--accent-600);
}

.text-success {
    color: var(--success-600);
}

.text-warning {
    color: var(--warning-600);
}

.text-error {
    color: var(--error-600);
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.hidden {
    display: none;
}

/* Contextual Help Button */
.help-context-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--primary-400);
    color: var(--primary-400);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.help-context-btn:hover {
    background: var(--accent-100);
    border-color: var(--accent-500);
    color: var(--accent-600);
    transform: scale(1.1);
}

/* AI Chatbot Styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    max-width: 900px;
    margin: 0 auto;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 0;
}

.message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--accent-600), var(--accent-500));
    color: white;
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, var(--success-500), var(--success-600));
    color: white;
}

.message-content {
    flex: 1;
    max-width: 80%;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.message-name {
    font-weight: 600;
    color: var(--primary-900);
    font-size: 0.875rem;
}

.message-time {
    font-size: 0.75rem;
    color: var(--primary-400);
}

.message-text {
    background: var(--primary-50);
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-xl);
    border: 1px solid var(--primary-200);
    color: var(--primary-700);
    line-height: 1.6;
}

.message.user .message-text {
    background: var(--accent-100);
    border-color: var(--accent-100);
    /* was accent-200 but 100 is defined */
    color: var(--accent-600);
}

[data-theme='dark'] .message.user .message-text {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--accent-400);
}

.message.ai .message-text {
    background: var(--bg-success-soft);
    border-color: transparent;
    color: var(--primary-700);
}

[data-theme='dark'] .message.ai .message-text {
    background: rgba(16, 185, 129, 0.15);
    color: #ffffff;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.chat-input-container {
    padding: 1.5rem 0;
    border-top: 1px solid var(--primary-200);
}

.chat-input-wrapper {
    display: flex;
    gap: 1rem;
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    border-radius: var(--border-radius-2xl);
    padding: 0.5rem;
}

.chat-input {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    resize: none;
    outline: none;
    background: transparent;
    color: var(--primary-900);
}

.chat-input::placeholder {
    color: var(--primary-400);
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-xl);
    background: linear-gradient(135deg, var(--accent-600), var(--accent-500));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.chat-send-btn:hover {
    transform: scale(1.05);
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.suggestion-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    border-radius: var(--border-radius-lg);
    font-size: 0.75rem;
    color: var(--primary-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.suggestion-btn:hover {
    background: var(--accent-100);
    border-color: var(--accent-400);
    /* adjusted from 300 */
    color: var(--accent-600);
}

[data-theme='dark'] .suggestion-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-400);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-400);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-4px);
    }
}

[data-theme='dark'] .help-context-btn {
    border-color: var(--primary-300);
    color: var(--primary-300);
    background: rgba(255, 255, 255, 0.05);
}

[data-theme='dark'] .help-context-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: var(--accent-400);
    color: var(--accent-400);
}

/* Settings Page Styles - Restored */
.settings-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: sticky;
    top: 100px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: none;
    background: transparent;
    color: var(--primary-600);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
    width: 100%;
}

.settings-nav-item:hover {
    background: var(--primary-200);
    color: var(--primary-800);
}

.settings-nav-item.active {
    background: var(--accent-100);
    color: var(--accent-600);
    font-weight: 600;
}

.settings-nav-item i {
    width: 20px;
    text-align: center;
}

.settings-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.settings-section.active {
    display: block;
}

.settings-card {
    background: var(--primary-100);
    border-radius: var(--border-radius-2xl);
    padding: 2rem;
    border: 1px solid var(--primary-200);
    margin-bottom: 2rem;
}

.settings-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-900);
    margin-bottom: 0.5rem;
}

.settings-card-description {
    color: var(--primary-500);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--primary-200);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
    padding-right: 1rem;
}

.setting-label {
    font-weight: 500;
    color: var(--primary-800);
    margin-bottom: 0.25rem;
}

.setting-description {
    font-size: 0.875rem;
    color: var(--primary-500);
}

/* Toggles */
.toggle {
    width: 44px;
    height: 24px;
    background: var(--primary-300);
    border-radius: 99px;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toggle.active {
    background: var(--accent-600);
}

.toggle.active::after {
    transform: translateX(20px);
}

/* Theme Options */
.theme-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.theme-option {
    border: 2px solid var(--primary-200);
    border-radius: var(--border-radius-xl);
    padding: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-option:hover {
    border-color: var(--accent-400);
}

.theme-option.active {
    border-color: var(--accent-600);
    background: var(--accent-100);
}

.theme-preview {
    height: 80px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 0.5rem;
    border: 1px solid var(--primary-200);
}

.theme-preview.light {
    background: #ffffff;
}

.theme-preview.dark {
    background: #0f172a;
}

.theme-preview.auto {
    background: linear-gradient(135deg, #ffffff 50%, #0f172a 50%);
}

.theme-name {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-700);
}

/* Avatar Upload */
.avatar-upload {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-600), var(--accent-500));
    color: white;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Security Items */
.security-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--primary-50);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--primary-200);
    margin-bottom: 1rem;
}

.security-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.security-icon.green {
    background: var(--bg-success-soft);
    color: var(--success-600);
}

.security-icon.yellow {
    background: var(--bg-warning-soft);
    color: var(--warning-600);
}

/* Invoice Row */
.invoice-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--primary-200);
}

/* Plan Card */
.plan-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius-xl);
    margin-bottom: 1.5rem;
}

.plan-name {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-400);
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.plan-price span {
    font-size: 1rem;
    color: var(--primary-400);
    font-weight: 400;
}

.plan-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.plan-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--primary-300);
}

.plan-feature i {
    color: var(--success-400);
}

/* Dark Mode Overrides for Settings */
[data-theme='dark'] .settings-nav-item.active {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-400);
}

[data-theme='dark'] .settings-card {
    background: var(--primary-100);
    border-color: var(--primary-200);
}

[data-theme='dark'] .theme-option {
    border-color: var(--primary-200);
}

[data-theme='dark'] .theme-option.active {
    background: rgba(59, 130, 246, 0.15);
}

[data-theme='dark'] .invoice-row,
[data-theme='dark'] .setting-item {
    border-color: var(--primary-200);
}

[data-theme='dark'] .security-item {
    background: var(--primary-100);
    border-color: var(--primary-200);
}

/* Responsive Setting */
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid var(--primary-200);
    }

    .settings-nav-item {
        width: auto;
        white-space: nowrap;
    }
}