/**
 * Work Safety CRM - Stylesheet
 * Color: Indigo (#6366f1)
 * Direction: RTL
 * Font: Heebo
 */

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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-bg: #eef2ff;
    --secondary: #8b5cf6;
    --accent: #a78bfa;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #06b6d4;
    --info-bg: #ecfeff;
    --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;
    --white: #ffffff;
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
    --transition: 0.2s ease;
}

html { font-size: 14px; }
body {
    font-family: 'Heebo', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    direction: rtl;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* === Auth Pages === */
.auth-body {
    background: linear-gradient(135deg, #312e81 0%, #4338ca 50%, #6366f1 100%);
    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: 16px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header .auth-logo {
    width: 60px; height: 60px;
    background: var(--primary);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: white;
}
.auth-header .auth-logo svg { width: 30px; height: 30px; }
.auth-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.auth-header p { color: var(--gray-500); font-size: 0.9rem; }

.auth-form .form-group { margin-bottom: 20px; }
.auth-form label { display: block; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; font-size: 0.9rem; }

.input-with-icon {
    position: relative;
}
.input-with-icon svg {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--gray-400);
    pointer-events: none;
}
.input-with-icon input {
    width: 100%;
    height: 40px;
    padding: 0 42px 0 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--white);
}
.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.85rem; color: var(--gray-600); }
.checkbox-label input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }
.forgot-link { font-size: 0.85rem; color: var(--primary); }

.auth-desc { color: var(--gray-600); margin-bottom: 20px; text-align: center; font-size: 0.9rem; }
.auth-link { text-align: center; margin-top: 16px; font-size: 0.9rem; }

.auth-footer { text-align: center; margin-top: 24px; color: rgba(255,255,255,.6); font-size: 0.8rem; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.4;
    white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }

/* === Alerts === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    position: relative;
}
.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: var(--danger-bg); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--info-bg); color: #155e75; border: 1px solid #a5f3fc; }
.alert-dismissible { padding-left: 40px; }
.alert-close {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
}

/* === App Layout === */
.app-body { background: var(--gray-50); min-height: 100vh; }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--white);
    border-left: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}
.sidebar-logo svg { width: 28px; height: 28px; }

.sidebar-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    padding: 4px;
}

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-list { list-style: none; }

.nav-item { margin: 2px 10px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 400;
    transition: all var(--transition);
}
.nav-link:hover { background: var(--gray-100); color: var(--gray-800); }
.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }

.nav-item.active .nav-link {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 500;
}

.nav-link.disabled {
    color: var(--gray-400);
    cursor: default;
    pointer-events: none;
}

.badge-soon {
    font-size: 0.65rem;
    background: var(--gray-200);
    color: var(--gray-500);
    padding: 2px 6px;
    border-radius: 10px;
    margin-right: auto;
    font-weight: 400;
}

.sidebar-bottom { padding: 12px 10px 16px; }
.sidebar-divider { border-top: 1px solid var(--gray-200); margin-bottom: 12px; }

.sidebar-bottom .nav-link {
    margin-bottom: 4px;
    font-size: 0.85rem;
}
.sidebar-bottom .nav-link.active {
    background: var(--primary-bg);
    color: var(--primary);
}

.switch-system {
    background: linear-gradient(135deg, #1e40af, #1d4ed8) !important;
    color: white !important;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}
.switch-system:hover { opacity: 0.9; }
.switch-system .link-icon { width: 14px; height: 14px; margin-right: auto; opacity: 0.7; }

/* Main Wrapper */
.main-wrapper {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
}

/* Top Header */
.top-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 900;
}

.header-right { display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--gray-600); padding: 6px; }
.page-title { font-size: 1.1rem; font-weight: 600; color: var(--gray-800); }

.header-left { display: flex; align-items: center; gap: 16px; }

.user-info { text-align: left; margin-left: 10px; }
.user-name { display: block; font-size: 0.85rem; font-weight: 500; color: var(--gray-800); }
.user-role { display: block; font-size: 0.75rem; color: var(--gray-500); }

.header-user { display: flex; align-items: center; position: relative; }

.user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown { position: relative; }

.dropdown-menu {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 8px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1100;
    padding: 6px 0;
}
.dropdown-menu.show { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--gray-700);
    font-size: 0.85rem;
    transition: background var(--transition);
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
}
.dropdown-item:hover { background: var(--gray-100); color: var(--gray-800); }
.dropdown-item svg { width: 16px; height: 16px; }
.dropdown-divider { border-top: 1px solid var(--gray-200); margin: 4px 0; }
.text-danger { color: var(--danger) !important; }

/* Main Content */
.main-content { padding: 24px; }

/* === Cards === */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header h3 svg { width: 18px; height: 18px; color: var(--primary); }

.card-body { padding: 20px; }

/* === Dashboard === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }

.stat-content { display: flex; flex-direction: column; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.stat-label { font-size: 0.8rem; color: var(--gray-500); margin-top: 2px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
}
.quick-action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.quick-action-btn svg { width: 20px; height: 20px; }
.quick-action-btn.disabled { opacity: 0.5; pointer-events: none; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 32px 20px;
    color: var(--gray-400);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 0.95rem; color: var(--gray-600); margin-bottom: 4px; }
.empty-state span { font-size: 0.8rem; }

/* Activity List */
.activity-list { display: flex; flex-direction: column; gap: 12px; }
.activity-item { display: flex; align-items: flex-start; gap: 12px; }
.activity-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 8px;
    flex-shrink: 0;
}
.activity-content p { font-size: 0.85rem; color: var(--gray-700); }
.activity-content span { font-size: 0.75rem; color: var(--gray-400); }

/* System Status */
.system-status { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.status-item { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--gray-600); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--danger); }
.status-link { display: flex; align-items: center; gap: 6px; color: var(--primary); font-size: 0.85rem; }
.status-link svg { width: 16px; height: 16px; }

/* === Coming Soon === */
.coming-soon-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height) - 100px);
}

.coming-soon-card {
    text-align: center;
    max-width: 420px;
    padding: 48px 32px;
}

.coming-soon-icon {
    width: 80px; height: 80px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}
.coming-soon-icon svg { width: 40px; height: 40px; }
.coming-soon-card h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; }
.coming-soon-card p { color: var(--gray-500); margin-bottom: 24px; line-height: 1.7; }
.coming-soon-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--warning-bg);
    color: #92400e;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 24px;
}
.coming-soon-badge svg { width: 16px; height: 16px; }

/* === Settings === */
.settings-page { max-width: 800px; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.color-input { display: flex; align-items: center; gap: 10px; }
.color-input input[type="color"] {
    width: 42px; height: 38px;
    padding: 2px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.color-input .color-text { flex: 1; text-align: center; direction: ltr; }

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-100);
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-success { background: var(--success-bg); color: #065f46; }
.badge-danger { background: var(--danger-bg); color: #991b1b; }
.badge-warning { background: var(--warning-bg); color: #92400e; }
.badge-info { background: var(--info-bg); color: #155e75; }
.badge-primary { background: var(--primary-bg); color: var(--primary-dark); }
.badge-secondary { background: var(--gray-100); color: var(--gray-600); }

/* === Error Page === */
.error-body {
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.error-page { text-align: center; }
.error-code { font-size: 6rem; font-weight: 800; color: var(--primary); line-height: 1; }
.error-page h1 { font-size: 1.5rem; margin: 16px 0 8px; }
.error-page p { color: var(--gray-500); margin-bottom: 24px; }

/* === Breadcrumb === */
.breadcrumb-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--gray-500);
}
.breadcrumb-bar a { color: var(--primary); }
.breadcrumb-bar a:hover { text-decoration: underline; }
.breadcrumb-bar svg { width: 14px; height: 14px; }
.breadcrumb-bar span { color: var(--gray-700); font-weight: 500; }

/* === Stats Grid 5 cols === */
.stats-grid-5 { grid-template-columns: repeat(5, 1fr); }

/* === Filters === */
.filters-form { margin-bottom: 20px; }
.filters-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.filter-search { flex: 1; min-width: 200px; }
.filter-search .input-with-icon input { width: 100%; height: 40px; }
.filter-select { flex-shrink: 0; }
.filter-select select {
    height: 40px;
    padding: 0 32px 0 12px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat left 10px center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    color: var(--gray-700);
    min-width: 130px;
}
.filter-select select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.btn-text {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    flex-shrink: 0;
}
.btn-text:hover { color: var(--danger); }
.btn-text svg { width: 16px; height: 16px; }

/* Results Info */
.results-info {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

/* === Data Table === */
.table-responsive { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.data-table thead th {
    text-align: right;
    padding: 10px 12px;
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.8rem;
    white-space: nowrap;
}
.data-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

.client-name-link { color: var(--gray-800); }
.client-name-link:hover { color: var(--primary); }
.client-name-link strong { font-weight: 600; }

.cell-sub { font-size: 0.75rem; color: var(--gray-400); margin-top: 2px; }

.text-left { text-align: left; }
.text-muted { color: var(--gray-400); }

.actions-col { width: 100px; text-align: center; }
.row-actions { display: flex; align-items: center; gap: 4px; justify-content: center; }
.row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--gray-500);
    background: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}
.row-action:hover { background: var(--gray-100); color: var(--primary); }
.row-action.text-danger:hover { color: var(--danger); background: var(--danger-bg); }
.row-action svg { width: 16px; height: 16px; }

/* === Pagination === */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    padding-top: 20px;
    margin-top: 12px;
    border-top: 1px solid var(--gray-100);
}
.pagination { display: flex; align-items: center; gap: 4px; }
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--white);
    transition: all var(--transition);
}
.page-link:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.page-link.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.page-link svg { width: 16px; height: 16px; }
.page-dots { color: var(--gray-400); padding: 0 4px; }

/* === Form Page === */
.form-page { max-width: 860px; }
.form-section { margin-bottom: 28px; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}
.required { color: var(--danger); }

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-100);
}

/* === Show Page === */
.show-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.show-header-info { display: flex; align-items: center; gap: 16px; }
.show-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    flex-shrink: 0;
}
.show-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.show-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--gray-500);
}
.meta-tag svg { width: 14px; height: 14px; }
.show-header-actions { display: flex; gap: 8px; }

.show-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-list { display: flex; flex-direction: column; }
.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-50);
}
.detail-item:last-child { border-bottom: none; }
.detail-label { font-size: 0.85rem; color: var(--gray-500); }
.detail-value { font-size: 0.85rem; color: var(--gray-800); font-weight: 500; text-align: left; }
.detail-value a { color: var(--primary); }
.notes-text { font-size: 0.9rem; color: var(--gray-700); line-height: 1.8; }

/* === Header Actions === */
.header-actions { display: flex; gap: 8px; }

/* === Import Page === */
.import-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}
.select-all-label { font-size: 0.85rem; font-weight: 500; }
.import-legend { display: flex; gap: 16px; }
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--gray-500);
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.legend-dot.imported { background: var(--success); }
.legend-dot.available { background: var(--warning); }

.check-col { width: 44px; text-align: center; }
.check-col input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}
.check-done {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
}
.check-done svg { width: 14px; height: 14px; }

.row-imported { background: var(--gray-50); }
.row-imported td { color: var(--gray-400); }

.header-badges { display: flex; gap: 8px; }

/* === Responsive === */
@media (max-width: 1200px) {
    .stats-grid-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-5 { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .show-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: -10px 0 30px rgba(0,0,0,.15);
    }
    .sidebar-close { display: block; }
    .menu-toggle { display: block; }
    .main-wrapper { margin-right: 0; }
    .top-header { padding: 0 16px; }
    .main-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stats-grid-5 { grid-template-columns: 1fr 1fr; gap: 12px; }
    .form-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr; }
    .filters-row { flex-wrap: wrap; }
    .filter-search { min-width: 100%; }
    .filter-select { flex: 1; min-width: 0; }
    .filter-select select { width: 100%; min-width: 0; }
    .show-header { flex-direction: column; align-items: flex-start; }
    .data-table { font-size: 0.8rem; }
    .data-table thead th,
    .data-table tbody td { padding: 8px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stats-grid-5 { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 20px; }
}
