/**
 * E-File Document Management System
 * Main Stylesheet - Green Solid Theme
 */

/* ===== CSS Variables ===== */
:root {
    /* Primary Green Colors */
    --primary: #16a34a;
    --primary-dark: #15803d;
    --primary-light: #22c55e;
    --primary-bg: #f0fdf4;

    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Status Colors */
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --info: #0ea5e9;

    /* Spacing */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 60px;

    /* Transitions */
    --transition: all 0.3s ease;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --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);

    /* Border Radius */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ===== Dark Mode Theme ===== */
[data-theme="dark"] {
    /* Primary Green Colors - keep accent */
    --primary: #22c55e;
    --primary-dark: #16a34a;
    --primary-light: #4ade80;
    --primary-bg: #14532d;

    /* Dark Neutral Colors */
    --white: #1f2937;
    --gray-50: #111827;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;

    /* Status Colors */
    --success: #22c55e;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #38bdf8;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

/* Dark mode specific overrides */
[data-theme="dark"] body {
    background-color: #0f172a;
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #15803d 0%, #14532d 100%);
}

[data-theme="dark"] .auth-page {
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
}

[data-theme="dark"] .document-icon.pdf {
    background: #7f1d1d;
    color: #fca5a5;
}

[data-theme="dark"] .document-icon.image {
    background: #1e3a5f;
    color: #93c5fd;
}

[data-theme="dark"] .profile-badge {
    background: #14532d;
    color: #4ade80;
}

[data-theme="dark"] .btn-secondary {
    background: #374151;
    color: #e5e7eb;
    border-color: #4b5563;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #4b5563;
}

[data-theme="dark"] .form-control {
    background: #1f2937;
    border-color: #374151;
    color: #f3f4f6;
}

[data-theme="dark"] .form-control:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

[data-theme="dark"] .upload-area {
    border-color: #4b5563;
    background: #1f2937;
}

[data-theme="dark"] .upload-area:hover {
    border-color: #22c55e;
    background: #14532d;
}

[data-theme="dark"] .modal {
    background: #1f2937;
}

[data-theme="dark"] .table th {
    background: #374151;
}

[data-theme="dark"] .table td {
    border-color: #374151;
}

/* Dark mode toggle button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-600);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--gray-200);
}

.theme-toggle:hover {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary);
}

.theme-toggle i {
    font-size: 18px;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ===== Authentication Pages ===== */
.auth-page {
    background: var(--primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 70px;
    height: 70px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.auth-logo i {
    font-size: 32px;
    color: var(--white);
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.auth-header p {
    color: var(--gray-500);
    font-size: 14px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.auth-form label i {
    color: var(--primary);
    font-size: 12px;
}

.auth-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 15px;
    transition: var(--transition);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.auth-form input::placeholder {
    color: var(--gray-400);
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    padding: 4px;
}

.toggle-password:hover {
    color: var(--gray-600);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.auth-footer p {
    color: var(--gray-500);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

.auth-footer a:hover {
    color: var(--primary-dark);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius);
}

/* ===== Alerts ===== */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert i {
    font-size: 16px;
    flex-shrink: 0;
}

.alert span {
    flex: 1;
}

.alert-close {
    color: inherit;
    opacity: 0.7;
    padding: 4px;
}

.alert-close:hover {
    opacity: 1;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-info {
    background: #e0f2fe;
    color: #075985;
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--primary);
    color: var(--white);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
}

.logo i {
    font-size: 24px;
}

.sidebar-toggle {
    color: var(--white);
    opacity: 0.7;
    font-size: 18px;
    display: none;
}

.sidebar-toggle:hover {
    opacity: 1;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    opacity: 0.85;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.sidebar-nav li.active a {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar i {
    font-size: 16px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 12px;
    opacity: 0.7;
}

.logout-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: var(--white);
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== Main Content ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.top-header {
    background: var(--white);
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-menu-btn {
    display: none;
    font-size: 20px;
    color: var(--gray-600);
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    flex: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.current-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-500);
}

.current-date i {
    color: var(--primary);
}

.content-wrapper {
    padding: 24px;
}

/* ===== Dashboard Stats ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.documents {
    background: #dcfce7;
    color: var(--primary);
}

.stat-icon.profiles {
    background: #e0f2fe;
    color: var(--info);
}

.stat-icon.users {
    background: #fef3c7;
    color: var(--warning);
}

.stat-icon.storage {
    background: #fee2e2;
    color: var(--danger);
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 13px;
    color: var(--gray-500);
}

/* ===== Cards ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* ===== Tables ===== */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.5px;
}

.table td {
    font-size: 14px;
    color: var(--gray-700);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-help {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 6px;
}

/* ===== Checkbox ===== */
.checkbox-wrapper {
    display: flex;
    align-items: center;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* ===== File Upload ===== */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.upload-icon {
    width: 64px;
    height: 64px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.upload-icon i {
    font-size: 28px;
    color: var(--gray-400);
}

.upload-area:hover .upload-icon {
    background: var(--primary-bg);
}

.upload-area:hover .upload-icon i {
    color: var(--primary);
}

.upload-area h3 {
    font-size: 16px;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.upload-area p {
    font-size: 13px;
    color: var(--gray-500);
}

.upload-area input[type="file"] {
    display: none;
}

/* ===== Document Grid ===== */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.document-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.document-card:hover {
    box-shadow: var(--shadow-md);
}

.document-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.document-checkbox {
    margin-top: 4px;
}

.document-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.document-icon.pdf {
    background: #fee2e2;
    color: #dc2626;
}

.document-icon.image {
    background: #dbeafe;
    color: #2563eb;
}

.document-icon.archive {
    background: #fef3c7;
    color: #d97706;
}

.document-icon.document {
    background: #dbeafe;
    color: #2563eb;
}

.document-info {
    flex: 1;
    min-width: 0;
}

.document-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-meta {
    font-size: 12px;
    color: var(--gray-500);
}

.document-profiles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.document-actions {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.document-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
}

/* ===== Filters & Search ===== */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.filter-select {
    min-width: 180px;
}

/* ===== Bulk Actions ===== */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--primary);
    border-radius: var(--radius);
    margin-bottom: 20px;
    color: var(--white);
}

.bulk-actions.show {
    display: flex;
}

.bulk-actions .select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding-right: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.bulk-actions .select-all-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: white;
}

.bulk-actions .selected-count {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.bulk-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: none;
}

.bulk-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: translateY(-20px);
    transition: var(--transition);
}

.modal-overlay.show .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--gray-500);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* ===== Preview Modal ===== */
.modal.modal-lg {
    max-width: 900px;
}

.preview-container {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 20px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-container img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: var(--radius);
}

.preview-container iframe {
    width: 100%;
    height: 60vh;
    border: none;
    border-radius: var(--radius);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}

.pagination a {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.pagination a:hover {
    background: var(--gray-100);
}

.pagination a.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination span.disabled {
    color: var(--gray-400);
    cursor: not-allowed;
}

/* ===== Print Styles ===== */
.print-page {
    background: var(--white);
    padding: 40px;
}

.print-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-200);
}

.print-document {
    margin-bottom: 40px;
    page-break-inside: avoid;
}

.print-document h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.print-document .meta {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 16px;
}

@media print {

    .sidebar,
    .top-header,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .content-wrapper {
        padding: 0 !important;
    }
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .sidebar-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: 100%;
    }

    .filter-select {
        min-width: 100%;
    }

    .card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-card {
        padding: 24px;
    }

    .table th,
    .table td {
        padding: 10px 12px;
    }

    .bulk-actions {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 16px;
    }

    .documents-grid {
        grid-template-columns: 1fr;
    }

    .document-actions {
        flex-direction: column;
    }
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ===== Notifications ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transform: translateX(120%);
    transition: var(--transition);
    z-index: 4000;
}

.notification.show {
    transform: translateX(0);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification.success .notification-icon {
    background: #dcfce7;
    color: var(--success);
}

.notification.error .notification-icon {
    background: #fee2e2;
    color: var(--danger);
}

.notification-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.notification-content p {
    font-size: 13px;
    color: var(--gray-500);
}

.notification-close {
    color: var(--gray-400);
    padding: 4px;
}

.notification-close:hover {
    color: var(--gray-600);
}

/* ===== Profile Cards ===== */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.profile-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.profile-card:hover {
    box-shadow: var(--shadow-md);
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.profile-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.profile-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.profile-count {
    font-size: 13px;
    color: var(--gray-500);
}

.profile-description {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 16px;
    line-height: 1.5;
}

.profile-actions {
    display: flex;
    gap: 8px;
}