:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-rgb: 37, 99, 235;
    --secondary: #7c3aed;
    --success: #10b981;
    --success-rgb: 16, 185, 129;
    --warning: #f59e0b;
    --warning-rgb: 245, 158, 11;
    --danger: #ef4444;
    --danger-rgb: 239, 68, 68;
    --info: #06b6d4;
    --info-rgb: 6, 182, 212;
    --orange: #f97316;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --bg-primary: #f0f4ff;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-sidebar-hover: #f1f5f9;
    --bg-sidebar-active: rgba(59, 130, 246, 0.1);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-sidebar: #64748b;
    --text-sidebar-active: #0f172a;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
    --glass-bg: rgba(255,255,255,0.7);
    --glass-border: rgba(255,255,255,0.2);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.1);
    --sidebar-width: 270px;
    --sidebar-collapsed: 70px;
    --header-height: 65px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;
    --bg-sidebar-hover: #334155;
    --bg-sidebar-active: rgba(59, 130, 246, 0.25);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #f1f5f9;
    --border-color: #334155;
    --glass-bg: rgba(30,41,59,0.8);
    --glass-border: rgba(255,255,255,0.05);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.3);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.2);
    --shadow: 0 1px 3px rgba(0,0,0,.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,.3);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.3);
    --shadow-xl: 0 20px 25px rgba(0,0,0,.4);
}

[data-accent="teal"] {
    --primary: #0d9488;
    --primary-light: #14b8a6;
    --primary-dark: #0f766e;
    --primary-rgb: 13, 148, 136;
    --secondary: #14b8a6;
    --bg-primary: #f0fdfa;
    --bg-card: #ffffff;
    --bg-sidebar-active: rgba(13, 148, 136, 0.15);
}

[data-accent="teal"][data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-card: #134e4a;
    --bg-sidebar-hover: #134e4a;
    --bg-sidebar-active: rgba(45, 212, 191, 0.25);
}

[data-accent="blue"] {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-rgb: 37, 99, 235;
    --secondary: #7c3aed;
    --bg-primary: #eff6ff;
    --bg-card: #ffffff;
    --bg-sidebar-active: rgba(59, 130, 246, 0.15);
}

[data-accent="blue"][data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar-active: rgba(96, 165, 250, 0.25);
}

[data-accent="purple"] {
    --primary: #7c3aed;
    --primary-light: #8b5cf6;
    --primary-dark: #6d28d9;
    --primary-rgb: 124, 58, 237;
    --secondary: #8b5cf6;
    --bg-primary: #f5f3ff;
    --bg-card: #ffffff;
    --bg-sidebar-active: rgba(139, 92, 246, 0.18);
}

[data-accent="purple"][data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-card: #2e1065;
    --bg-sidebar-hover: #2e1065;
    --bg-sidebar-active: rgba(167, 139, 250, 0.28);
}

[data-theme="dark"] .view-cv-name { color: var(--text-primary); }
[data-theme="dark"] .view-cv-sub { color: var(--text-secondary); }
[data-theme="dark"] .view-cv-chip { color: var(--text-secondary); background: var(--bg-primary); }
[data-theme="dark"] .view-cv-table td { border-bottom-color: var(--border-color); }
[data-theme="dark"] .view-cv-label { background: var(--bg-primary); color: var(--text-secondary); }
[data-theme="dark"] .view-cv-value { color: var(--text-primary); }
[data-theme="dark"] .view-cv-photo-empty { background: var(--bg-primary); color: var(--text-secondary); }
[data-theme="dark"] .view-cv-top { background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-card) 100%); }
[data-theme="dark"] .view-cv-photo { border-color: var(--border-color); background: var(--bg-primary); }
[data-theme="dark"] .view-cv-photo-empty { border-color: var(--border-color); }
[data-theme="dark"] .view-cv-badge-regular { background: #3b82f6; }
[data-theme="dark"] .view-cv-badge-outside { background: #f59e0b; }

[data-theme="dark"] .sidebar-footer .user-details h4 { color: var(--text-primary); }
[data-theme="dark"] .sidebar-footer .user-details span { color: var(--text-secondary); }
[data-theme="dark"] .sidebar { scrollbar-color: var(--border-color) transparent; }
[data-theme="dark"] .sidebar::-webkit-scrollbar-thumb { background: var(--border-color); }

[data-theme="dark"] .chip-input { background: var(--bg-primary); color: var(--text-primary); }
[data-theme="dark"] .badge-dead { color: var(--text-secondary); }
[data-theme="dark"] .table tbody tr:hover { background: rgba(59,130,246,0.08); }
[data-theme="dark"] .stat-icon.blue { background: rgba(59,130,246,0.2); }
[data-theme="dark"] .stat-icon.green { background: rgba(16,185,129,0.2); }
[data-theme="dark"] .stat-icon.yellow { background: rgba(245,158,11,0.2); }
[data-theme="dark"] .stat-icon.red { background: rgba(239,68,68,0.2); }
[data-theme="dark"] .stat-icon.purple { background: rgba(139,92,246,0.2); }
[data-theme="dark"] .stat-icon.pink { background: rgba(236,72,153,0.2); }
[data-theme="dark"] .stat-icon.cyan { background: rgba(6,182,212,0.2); }
[data-theme="dark"] .stat-icon.orange { background: rgba(249,115,22,0.2); }
[data-theme="dark"] .tag-color-dot { border-color: rgba(255,255,255,0.15); }
[data-theme="dark"] .tag-white { background: #e2e8f0; border-color: #94a3b8; }
[data-theme="dark"] .tag-black { background: #1e293b; border: 1px solid var(--border-color); }
[data-theme="dark"] select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); }

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

html { scrollbar-gutter: stable; }

body {
    font-family: 'Inter', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
}

a { text-decoration: none; color: inherit; }

/* ========== LOGIN PAGE ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37,99,235,0.15), transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.login-container::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(124,58,237,0.1), transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    box-shadow: var(--glass-shadow);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    height: 70px;
    margin-bottom: 12px;
}

.login-logo h1 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
}

.login-logo .subtitle {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-top: 4px;
}

.login-logo .emoji-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.login-card .form-group {
    margin-bottom: 20px;
}

.login-card label {
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 500;
    display: block;
    margin-bottom: 6px;
}

.login-card .input-group {
    position: relative;
}

.login-card .input-group .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1rem;
}

.login-card input[type="text"],
.login-card input[type="email"],
.login-card input[type="password"] {
    width: 100%;
    padding: 12px 14px 12px 44px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: #f1f5f9;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.login-card input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.2);
    background: rgba(255,255,255,0.08);
}

.login-card .btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.login-card .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37,99,235,0.4);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--primary-light);
    font-size: 0.85rem;
}

.login-footer .back-site-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    transition: var(--transition);
}

.login-footer .back-site-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.login-footer .lang-switch {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.login-footer .lang-switch button {
    padding: 6px 16px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    background: transparent;
    color: #94a3b8;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.login-footer .lang-switch button.active,
.login-footer .lang-switch button:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ========== LAYOUT ========== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    border-right: 1px solid var(--border-color);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
}

.sidebar-header .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.sidebar-header .logo-text h2 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-header .logo-text span {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.sidebar-nav {
    padding: 12px 0;
}

.sidebar-nav .nav-section {
    padding: 8px 16px 4px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ===== Collapsible nav groups ===== */
.sidebar-nav .nav-group {
    margin: 2px 16px;
}

.sidebar-nav .nav-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 1rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-family: inherit;
}

.sidebar-nav .nav-group-toggle:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar);
}

.sidebar-nav .nav-group-toggle .nav-icon {
    font-size: 0.92rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    margin-left: 4px;
}

.sidebar-nav .nav-group-label {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.sidebar-nav .nav-group-chevron {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.sidebar-nav .nav-group.open .nav-group-chevron {
    transform: rotate(180deg);
}

.sidebar-nav .nav-group-body {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.28s ease;
}

.sidebar-nav .nav-group.open .nav-group-body {
    max-height: 2000px;
}

.sidebar-nav .nav-item {
    margin: 2px 16px;
}

/* ===== Distinct Dashboard button ===== */
.sidebar-nav .nav-item.nav-dashboard .nav-link {
    color: var(--text-sidebar);
    font-weight: 600;
    font-size: 1rem;
}

.sidebar-nav .nav-item.nav-dashboard .nav-link:hover,
.sidebar-nav .nav-item .nav-link.nav-group-toggle:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar);
}

.sidebar-nav .nav-item.nav-dashboard .nav-link.active,
.sidebar-nav .nav-item .nav-link.nav-group-toggle.active {
    background: var(--bg-sidebar-active);
    color: var(--text-primary);
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.sidebar-nav .nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar);
    transform: translateX(2px);
}

.sidebar-nav .nav-link.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.sidebar-nav .nav-link.nav-link-main {
    font-size: 1rem;
    font-weight: 600;
}

.sidebar-nav .nav-link .nav-icon {
    font-size: 0.92rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    margin-left: 4px;
}

.sidebar-nav .nav-link .badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    background: var(--bg-sidebar);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-footer .user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-footer .user-details h4 {
    color: #1e293b;
    font-size: 0.8rem;
    font-weight: 600;
}

.sidebar-footer .user-details span {
    color: #64748b;
    font-size: 0.7rem;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    padding-left: 5px;
    padding-right: 5px;
    row-gap: 5px;
    overflow-x: hidden;
    background: var(--bg-primary);
}

.main-content > .top-header {
    margin-left: -5px;
    margin-right: -5px;
    padding-left: 24px;
    padding-right: 24px;
}

.main-content > footer {
    margin-left: -5px;
    margin-right: -5px;
    padding-left: 24px;
    padding-right: 24px;
}

/* Fullscreen shed view stays below the topbar and right of the sidebar */
#shedViewOverlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    z-index: 900;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    overflow: auto;
}

/* ========== HEADER ========== */
.top-header {
    height: var(--header-height);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 18px rgba(2, 6, 23, 0.18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

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

.header-left .menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.header-left .menu-toggle:hover {
    background: var(--border-color);
}

.header-left .page-title {
    min-width: 0;
}

.header-left .page-title h2 {
    font-size: 1.2rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-left .page-title h2 i {
    font-size: 1em;
    width: 1.15em;
    text-align: center;
    display: inline-block;
    vertical-align: -0.06em;
}

.header-left .page-title p {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
}

.header-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.header-btn .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.header-btn .msg-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    background: var(--danger);
    color: #fff;
    border-radius: 9px;
    border: 2px solid var(--bg-card);
    font-size: 0.6rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 400;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
}

.nav-group-toggle .nav-badge,
.nav-link .nav-badge { margin-left: 8px; }

.lang-toggle-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

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

.user-dropdown {
    position: relative;
}

.user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    transition: var(--transition);
}

.user-dropdown .dropdown-toggle:hover {
    border-color: var(--primary);
}

.user-dropdown .user-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
}

.user-dropdown .user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    display: none;
    overflow: hidden;
    z-index: 1000;
}

.user-dropdown .dropdown-menu.show { display: block; }

.user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.user-dropdown .dropdown-item:hover {
    background: var(--bg-primary);
    color: var(--primary);
}

.user-dropdown .dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.user-dropdown .dropdown-item.danger {
    color: var(--danger);
}

/* ========== TOOLBAR DROPDOWN ========== */
.toolbar-dropdown .export-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 170px;
    display: none;
    overflow: hidden;
    z-index: 1050;
}

.toolbar-dropdown .export-menu.open {
    display: block;
}

.toolbar-dropdown .export-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

.toolbar-dropdown .export-item:hover {
    background: var(--bg-primary);
    color: var(--primary);
}

.toolbar-dropdown .export-item i {
    width: 18px;
    text-align: center;
}

/* ========== CHIP INPUT ========== */
.chip-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 7px 10px;
    background: #fff;
    min-height: 44px;
    cursor: text;
    box-sizing: border-box;
}
.chip-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.chip-input .chip-text-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 60px;
    font-size: .9rem;
    background: transparent;
    padding: 2px;
}
.chip-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    padding: 2px 6px 2px 10px;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.5;
}
.chip-tag button {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    opacity: .7;
}
.chip-tag button:hover { opacity: 1; }

/* ========== CONTENT AREA ========== */
.content-area {
    padding: 24px;
    margin-left: -5px;
    margin-right: -5px;
}

/* ========== CARDS ========== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.main-content > :first-child {
    margin-top: 3px;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.card-body { padding: 5px 20px 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border-color); }

.card-body canvas { max-width: 100%; }

/* ========== STAT CARDS ========== */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

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

.stat-card:hover::after { opacity: 1; }

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-card .stat-info h4 {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 2px;
}

.stat-card .stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.stat-card .stat-info .stat-change {
    font-size: 0.72rem;
    font-weight: 500;
    margin-top: 2px;
}

.stat-card .stat-info .stat-change.up { color: var(--success); }
.stat-card .stat-info .stat-change.down { color: var(--danger); }

.stat-icon.blue { background: rgba(37,99,235,0.1); color: var(--primary); }
.stat-icon.green { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-icon.yellow { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-icon.red { background: rgba(239,68,68,0.1); color: var(--danger); }
.stat-icon.purple { background: rgba(139,92,246,0.1); color: var(--purple); }
.stat-icon.pink { background: rgba(236,72,153,0.1); color: var(--pink); }
.stat-icon.cyan { background: rgba(6,182,212,0.1); color: var(--info); }
.stat-icon.orange { background: rgba(249,115,22,0.1); color: var(--orange); }

/* ========== TABLES ========== */
.table-responsive { overflow-x: auto; }

.table-responsive.table-scroll {
    overflow: auto;
    max-height: calc(100vh - var(--header-height) - 155px);
}
.table-responsive.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 1px 0 var(--border-color);
}

/* Viewport-sticky table (attendance): header pins below the top-header as the
   page scrolls. Requires no scroll-container ancestors (card + wrapper). */
.card-table-vp { overflow: visible; }
.table-responsive.table-vp {
    overflow: visible;
    max-height: none;
}
.table-responsive.table-vp thead th {
    position: sticky;
    top: var(--header-height);
    z-index: 6;
    box-shadow: 0 1px 0 var(--border-color);
}

/* Sticky filter toolbar + legend for attendance tab */
.page-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.page-tabs-sticky {
    position: sticky;
    top: var(--header-height);
    z-index: 8;
    background: var(--bg-primary);
    margin-bottom: 0;
    padding-bottom: 20px;
}
.att-sticky {
    position: sticky;
    top: var(--header-height);
    z-index: 8;
    background: var(--bg-primary);
}
.emp-bar, .desig-bar {
    position: sticky;
    top: var(--header-height);
    z-index: 8;
    background: var(--bg-primary);
    padding-bottom: 16px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}

.table thead th {
    background: var(--bg-primary);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(37,99,235,0.03);
}

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

/* ========== EMPLOYEE TABLE AUTO-FIT ========== */
#empTable {
    width: 100%;
    table-layout: auto;
}

#empTable thead th {
    white-space: normal;
    overflow-wrap: break-word;
    vertical-align: bottom;
}

#empTable tbody td {
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

#empTable th[data-col="photo"],
#empTable td[data-col="photo"] { width: 60px; }

#empTable th[data-col="salary"],
#empTable td[data-col="salary"] { white-space: nowrap; }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.btn-success { background: var(--success); color: #fff; }
[data-theme="dark"] .btn-success { background: var(--success) !important; color: #fff !important; border: none !important; transition: none !important; }
[data-theme="dark"] .btn-success:hover { background: var(--success) !important; }
.btn-success:hover { box-shadow: 0 4px 12px rgba(16,185,129,0.3); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { box-shadow: 0 4px 12px rgba(239,68,68,0.3); }

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

.btn-pay {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(5,150,105,0.4);
    position: relative;
    overflow: hidden;
}
.btn-pay:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5,150,105,0.5);
}
.btn-pay:active { transform: translateY(0); }
.btn-pay::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: btnPayShine 2.5s ease-in-out infinite;
}
@keyframes btnPayShine {
    0% { left: -100%; }
    60% { left: 100%; }
    100% { left: 100%; }
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 16px; }

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

label .req, .form-group label .req, .required-star {
    color: #dc2626;
    font-weight: 700;
}

label.space-req .req, .form-group label.space-req .req {
    margin-left: 3px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-control::placeholder {
    color: var(--text-secondary);
    line-height: 1.6;
    opacity: 1;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="time"],
select,
textarea {
    line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
    line-height: 1.6;
    opacity: 1;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 80px; }
.cow-form-grid .form-control { height: 44px; }
.cow-form-grid textarea.form-control { min-height: 0; height: 44px; resize: none; overflow: hidden; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.cow-form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.cow-form-grid .form-group { margin-bottom: 0; }
.cow-form-grid .form-group label { margin-bottom: 4px; }

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

#exportColMenu input[type="checkbox"],
#nameColMenu input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}

/* ========== BADGES ========== */
.badge-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-active { background: rgba(16,185,129,0.1); color: var(--success); }
.badge-inactive { background: rgba(100,116,139,0.1); color: var(--text-secondary); }
.badge-sick { background: rgba(239,68,68,0.1); color: var(--danger); }
.badge-pregnant { background: rgba(236,72,153,0.1); color: var(--pink); }
.badge-sold { background: rgba(245,158,11,0.1); color: var(--warning); }
.badge-dead { background: rgba(100,116,139,0.15); color: #475569; }
.badge-missing { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge-milking { background: rgba(6,182,212,0.1); color: var(--info); }
.badge-dry { background: rgba(249,115,22,0.1); color: var(--orange); }

.tag-color-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex-shrink: 0; border: 1px solid rgba(0,0,0,.15); }
.tag-red { background: #e74c3c; }
.tag-green { background: #27ae60; }
.tag-blue { background: #2980b9; }
.tag-yellow { background: #f1c40f; }
.tag-orange { background: #e67e22; }
.tag-white { background: #ecf0f1; border-color: #bdc3c7; }
.tag-black { background: #2c3e50; }
.tag-purple { background: #8e44ad; }

/* ========== ALERTS ========== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.87rem;
    animation: slideDown 0.3s ease;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
}

.alert-success::before { background: var(--success); }
.alert-error::before, .alert-danger::before { background: var(--danger); }
.alert-warning::before { background: var(--warning); }
.alert-info::before { background: var(--info); }

.alert i:first-child {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.alert-success i:first-child { background: rgba(16,185,129,0.15); color: var(--success); }
.alert-error i:first-child, .alert-danger i:first-child { background: rgba(239,68,68,0.15); color: var(--danger); }
.alert-warning i:first-child { background: rgba(245,158,11,0.15); color: var(--warning); }
.alert-info i:first-child { background: rgba(6,182,212,0.15); color: var(--info); }

.alert span { flex: 1; line-height: 1.4; }

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

.alert-success { background: rgba(16,185,129,0.08); color: var(--success); border: 1px solid rgba(16,185,129,0.15); }
.alert-error { background: rgba(239,68,68,0.08); color: var(--danger); border: 1px solid rgba(239,68,68,0.15); }
.alert-danger { background: rgba(239,68,68,0.08); color: var(--danger); border: 1px solid rgba(239,68,68,0.15); }
.alert-warning { background: rgba(245,158,11,0.08); color: var(--warning); border: 1px solid rgba(245,158,11,0.15); }
.alert-info { background: rgba(6,182,212,0.08); color: var(--info); border: 1px solid rgba(6,182,212,0.15); }

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 4px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-close:hover { opacity: 1; background: rgba(0,0,0,0.05); }

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show { display: flex; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 { font-size: 1.1rem; font-weight: 600; }

.modal-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover { background: var(--border-color); }

.modal-body { padding: 13px 24px 0; }
.modal-body > .form-group:last-child { margin-bottom: 0; }
.modal-footer {
    padding: 13px 24px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ========== EMPLOYEE CV VIEW MODAL ========== */
.view-cv-top {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 22px 24px;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border-bottom: 2px solid var(--primary);
}
.view-cv-photo {
    width: 100px;
    height: 116px;
    border-radius: 12px;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    object-fit: cover;
    flex-shrink: 0;
    cursor: zoom-in;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}
.view-cv-photo-empty {
    width: 100px;
    height: 116px;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    flex-shrink: 0;
}
.view-cv-head { flex: 1; min-width: 0; }
.view-cv-name { margin: 0 0 2px; font-size: 1.3rem; font-weight: 700; color: #1e293b; line-height: 1.25; }
.view-cv-sub { margin: 0 0 8px; font-size: 0.8rem; color: #64748b; }
.view-cv-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.view-cv-chip { font-size: 0.72rem; color: #334155; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 999px; padding: 2px 10px; }
.view-cv-badge { font-size: 0.7rem; font-weight: 600; color: #fff; border-radius: 999px; padding: 3px 11px; }
.view-cv-badge-regular { background: #1e40af; }
.view-cv-badge-outside { background: #d97706; }
.view-cv-sec {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    padding: 7px 24px;
    margin: 0;
}
.view-cv-table { width: 100%; border-collapse: collapse; }
.view-cv-table td { padding: 8px 24px 8px 10px; font-size: 0.82rem; vertical-align: top; border-bottom: 1px solid #f1f5f9; }
.view-cv-label { width: 38%; background: #f1f5f9; font-weight: 600; color: #334155; padding-left: 24px; }
.view-cv-value { color: #0f172a; word-break: break-word; }

/* ========== NOTIFICATION PANEL ========== */
.notification-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    z-index: 3000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.notification-panel.show { right: 0; }

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

.notification-panel .panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.notification-item {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: var(--transition);
    cursor: pointer;
}

.notification-item:hover { background: var(--bg-primary); }

.notification-item.unread {
    background: rgba(37,99,235,0.05);
    border-left: 3px solid var(--primary);
}

.notification-item .notif-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.notification-item .notif-message {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.notification-item .notif-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.message-panel .panel-body { padding: 10px; }

.message-item {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.message-item.unread {
    background: rgba(37,99,235,0.06);
    border-left: 3px solid var(--primary);
}

.message-item .msg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.message-item .msg-name { font-size: 0.85rem; font-weight: 700; }

.message-item .msg-type {
    font-size: 0.66rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    background: var(--primary-soft, rgba(37,99,235,0.1));
    color: var(--primary);
    white-space: nowrap;
}

.message-item .msg-subject {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.message-item .msg-preview {
    font-size: 0.76rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.message-item .msg-time { font-size: 0.68rem; color: var(--text-secondary); }

.message-item .msg-actions { margin-top: 8px; display: flex; gap: 6px; }

.notification-panel .panel-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.87rem;
    max-width: 400px;
    margin: 0 auto;
}

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    animation: toastIn 0.3s ease;
    font-size: 0.87rem;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

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

/* ========== LOADING ========== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

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

/* ========== SEARCH BAR ========== */
.search-bar {
    position: relative;
}

.search-bar input {
    padding-left: 40px;
}

.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* ========== FILTER BAR ========== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 16px 0;
}

.filter-bar .form-control {
    width: auto;
    min-width: 150px;
}

/* ========== CHART CONTAINER ========== */
.chart-container {
    position: relative;
    height: 300px;
    padding: 10px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    #shedViewOverlay {
        left: 0;
        top: 0;
    }
    
    .header-left .menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .content-area { padding: 16px; }
    
    .stat-card {
        padding: 14px;
    }
    
    .stat-card .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .stat-card .stat-info .stat-value {
        font-size: 1.2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }

    .cow-form-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-bar .form-control {
        width: 100%;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 8px 10px;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .notification-panel {
        width: 100%;
        right: -100%;
    }
    
    .header-right .user-name {
        display: none;
    }
    
    .top-header { padding: 0 16px; }
}

@media (max-width: 480px) {
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .login-card {
        padding: 24px 20px;
        margin: 16px;
        max-width: none;
    }
    
    .card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .btn-group-mobile {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .cow-form-grid {
        grid-template-columns: 1fr;
    }
    #cowModal .modal-content,
    #exitRecordModal .modal-content {
        max-width: 100% !important;
    }
}

/* ========== SIDEBAR OVERLAY ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.show { display: block; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ========== PRINT STYLES ========== */
@media print {
    .sidebar, .top-header, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-area { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd; }
    .table-responsive.table-scroll { max-height: none !important; height: auto !important; overflow: visible !important; }
    .table-responsive.table-scroll thead th { position: static !important; box-shadow: none !important; }
    .att-sticky { position: static !important; }
    .emp-bar, .desig-bar { position: static !important; padding-bottom: 16px !important; }
    .page-tabs-sticky { position: static !important; margin-bottom: 20px !important; padding-bottom: 0 !important; }
}

/* ========== COLOR PICKER SKINS ========== */
.cpick {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 50% !important;
    border: 1px solid transparent !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
    position: relative;
    padding: 0 !important;
    vertical-align: middle;
    flex-shrink: 0;
    overflow: hidden;
    line-height: 1;
    font-size: 0;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}
.cpick:hover { transform: scale(1.12); }
.cpick.active {
    border-color: var(--primary) !important;
    outline: 1px solid var(--primary);
    outline-offset: 3px;
    box-shadow: 0 0 6px rgba(var(--primary-rgb, 37,99,235), 0.35) !important;
}
.cpick.active::after {
    content: '\2713' !important;
    font-size: 16px !important;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,.6);
    line-height: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.cp-light.active::after {
    color: #0f172a !important;
    text-shadow: none !important;
}
.cpick-custom {
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red) !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
}
.cpick-custom::before {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px;
    border-radius: 50%;
    background: var(--bg-card, #fff);
    z-index: 0;
}
.cpick-custom::after {
    content: '\f303' !important;
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    font-size: 12px !important;
    color: var(--text-primary, #64748b) !important;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}
.cpick-custom:hover {
    transform: scale(1.12);
    outline: 1px solid var(--primary);
    outline-offset: 3px;
}
.cpick-custom input[type="color"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    top: 0;
    left: 0;
}
.font-style-btn {
    transition: all 0.2s ease;
    border-color: rgba(var(--primary-rgb), 0.3) !important;
}
.font-style-btn:hover {
    border-color: var(--primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.font-style-btn.active {
    border-color: var(--primary) !important;
    background: rgba(var(--primary-rgb), 0.06) !important;
    box-shadow: 0 0 0 1px var(--primary);
}

/* ========== FULL VIEW PHOTO OPTIONS (MOBILE) ========== */
@media (max-width: 640px) {
    #attViewBtns {
        width: 96% !important;
        gap: 8px !important;
    }
    #attViewBtns button {
        flex: 1 !important;
        justify-content: center;
        padding: 12px 10px !important;
        font-size: 0.86rem !important;
    }
}

/* ========== DARK THEME: GENERAL TEXT VISIBILITY ========== */
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .toolbar-dropdown,
[data-theme="dark"] .export-menu,
[data-theme="dark"] .search-dropdown,
[data-theme="dark"] .export-col-menu,
[data-theme="dark"] #exportColMenu,
[data-theme="dark"] #nameColMenu,
[data-theme="dark"] #exportMenu,
[data-theme="dark"] #nbExportMenu,
[data-theme="dark"] #exExportMenu,
[data-theme="dark"] #nbColMenu,
[data-theme="dark"] #nbExportColMenu,
[data-theme="dark"] #nbNameColMenu,
[data-theme="dark"] #exExportColMenu,
[data-theme="dark"] #exNameColMenu,
[data-theme="dark"] .export-menu *,
[data-theme="dark"] .search-dropdown *,
[data-theme="dark"] #exportColMenu *,
[data-theme="dark"] #nameColMenu *,
[data-theme="dark"] #exportMenu *,
[data-theme="dark"] #nbExportMenu *,
[data-theme="dark"] #exExportMenu *,
[data-theme="dark"] #nbColMenu *,
[data-theme="dark"] #nbExportColMenu *,
[data-theme="dark"] #nbNameColMenu *,
[data-theme="dark"] #exExportColMenu *,
[data-theme="dark"] #exNameColMenu * {
    color: var(--text-primary) !important;
}
[data-theme="dark"] #exportColMenu,
[data-theme="dark"] #nameColMenu,
[data-theme="dark"] #nbColMenu,
[data-theme="dark"] #nbExportColMenu,
[data-theme="dark"] #nbNameColMenu,
[data-theme="dark"] #exExportColMenu,
[data-theme="dark"] #exNameColMenu {
    color: #f1f5f9 !important;
}
[data-theme="dark"] #exportColMenu label,
[data-theme="dark"] #nameColMenu label,
[data-theme="dark"] #nbColMenu label,
[data-theme="dark"] #nbExportColMenu label,
[data-theme="dark"] #nbNameColMenu label,
[data-theme="dark"] #exExportColMenu label,
[data-theme="dark"] #exNameColMenu label {
    color: #f1f5f9 !important;
    -webkit-text-fill-color: #f1f5f9 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Theme-independent readable text for the checkbox column menus */
#exportColMenu,
#nameColMenu,
#nbColMenu,
#nbExportColMenu,
#nbNameColMenu,
#exExportColMenu,
#exNameColMenu {
    color: #0f172a;
}
#exportColMenu label,
#nameColMenu label,
#nbColMenu label,
#nbExportColMenu label,
#nbNameColMenu label,
#exExportColMenu label,
#exNameColMenu label {
    color: #0f172a;
}

[data-theme="dark"] #exportColMenu,
[data-theme="dark"] #nameColMenu,
[data-theme="dark"] #nbColMenu,
[data-theme="dark"] #nbExportColMenu,
[data-theme="dark"] #nbNameColMenu,
[data-theme="dark"] #exExportColMenu,
[data-theme="dark"] #exNameColMenu {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}
[data-theme="dark"] #exportColMenu label,
[data-theme="dark"] #nameColMenu label,
[data-theme="dark"] #nbColMenu label,
[data-theme="dark"] #nbExportColMenu label,
[data-theme="dark"] #nbNameColMenu label,
[data-theme="dark"] #exExportColMenu label,
[data-theme="dark"] #exNameColMenu label {
    color: #f1f5f9 !important;
    -webkit-text-fill-color: #f1f5f9 !important;
    opacity: 1 !important;
    visibility: visible !important;
}
[data-theme="dark"] .dropdown-menu label,
[data-theme="dark"] .toolbar-dropdown label,
[data-theme="dark"] .export-menu label,
[data-theme="dark"] .search-dropdown label,
[data-theme="dark"] #exportColMenu label,
[data-theme="dark"] #nameColMenu label,
[data-theme="dark"] #exportMenu label,
[data-theme="dark"] #nbExportMenu label,
[data-theme="dark"] #exExportMenu label,
[data-theme="dark"] #nbColMenu label,
[data-theme="dark"] #nbExportColMenu label,
[data-theme="dark"] #nbNameColMenu label,
[data-theme="dark"] #exExportColMenu label,
[data-theme="dark"] #exNameColMenu label {
    color: var(--text-primary) !important;
}
[data-theme="dark"] .btn-outline {
    color: var(--text-primary) !important;
}
#nameColMenu label,
#exportColMenu label {
    padding-left: 4px;
}
#nameColMenu label::before,
#exportColMenu label::before {
    content: "⣿";
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1;
    opacity: 0.55;
    cursor: grab;
    letter-spacing: 0;
}
