/* ===================================================================
   Admin Dashboard — Modern Layout
   =================================================================== */

/* ---------- Design Tokens ---------- */
:root {
    --ad-primary: #6366f1;
    --ad-primary-dark: #4f46e5;
    --ad-primary-light: #eef2ff;
    --ad-secondary: #64748b;
    --ad-success: #10b981;
    --ad-warning: #f59e0b;
    --ad-danger: #ef4444;
    --ad-info: #06b6d4;

    --ad-bg: #f1f5f9;
    --ad-surface: #ffffff;
    --ad-sidebar-bg: #1e293b;
    --ad-sidebar-hover: rgba(255, 255, 255, 0.08);
    --ad-sidebar-active: rgba(99, 102, 241, 0.25);
    --ad-sidebar-text: rgba(255, 255, 255, 0.7);
    --ad-sidebar-text-active: #ffffff;

    --ad-border: #e2e8f0;
    --ad-text: #1e293b;
    --ad-text-muted: #64748b;
    --ad-text-light: #94a3b8;

    --ad-sidebar-w: 240px;
    --ad-sidebar-collapsed-w: 72px;
    --ad-topbar-h: 60px;

    --ad-radius-sm: 6px;
    --ad-radius: 10px;
    --ad-radius-lg: 14px;
    --ad-radius-xl: 18px;

    --ad-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --ad-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --ad-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --ad-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

    --ad-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    height: 100%;
}

body.admin-dashboard {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--ad-bg);
    color: var(--ad-text);
    line-height: 1.6;
    font-size: 0.8125rem;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ===================================================================
   SIDEBAR
   =================================================================== */
.ad-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--ad-sidebar-w);
    background: var(--ad-sidebar-bg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width var(--ad-transition), transform var(--ad-transition);
    overflow: hidden;
}

/* --- Brand area --- */
.ad-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    height: var(--ad-topbar-h);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    text-decoration: none;
}

.ad-sidebar-brand-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--ad-radius);
    background: linear-gradient(135deg, var(--ad-primary) 0%, var(--ad-primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ad-sidebar-brand-text {
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

/* --- Navigation --- */
.ad-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 12px 20px;
}

.ad-sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.ad-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.ad-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* Section labels */
.ad-nav-section {
    padding: 20px 10px 6px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}

.ad-nav-section:first-child {
    padding-top: 4px;
}

/* Nav items */
.ad-nav-item {
    margin-bottom: 2px;
}

.ad-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--ad-radius-sm);
    color: var(--ad-sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8125rem;
    white-space: nowrap;
    transition: all 0.15s ease;
    position: relative;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.ad-nav-link:hover {
    color: var(--ad-sidebar-text-active);
    background: var(--ad-sidebar-hover);
    text-decoration: none;
}

.ad-nav-link.active {
    color: var(--ad-sidebar-text-active);
    background: var(--ad-sidebar-active);
}

.ad-nav-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--ad-primary);
}

.ad-nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    flex-shrink: 0;
    opacity: 0.75;
}

.ad-nav-link.active .ad-nav-icon,
.ad-nav-link:hover .ad-nav-icon {
    opacity: 1;
}

.ad-nav-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Submenu toggle chevron */
.ad-nav-chevron {
    font-size: 0.625rem;
    transition: transform 0.2s ease;
    opacity: 0.5;
}

.ad-nav-item.open > .ad-nav-link .ad-nav-chevron,
.ad-nav-item.open > .ad-nav-item-head > .ad-nav-link .ad-nav-chevron {
    transform: rotate(90deg);
    opacity: 0.8;
}

/* Row with optional “add” (+) action beside expand / main link */
.ad-nav-item-head {
    display: flex;
    align-items: stretch;
    gap: 2px;
}

.ad-nav-item-head > .ad-nav-link {
    flex: 1;
    min-width: 0;
    width: auto;
}

.ad-nav-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    min-width: 36px;
    margin: 2px 8px 2px 0;
    border-radius: var(--ad-radius-sm);
    color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.15s ease, background 0.15s ease;
}

.ad-nav-add-btn:hover {
    color: var(--ad-sidebar-text-active);
    background: var(--ad-sidebar-hover);
    text-decoration: none;
}

.ad-nav-add-btn:focus-visible {
    outline: 2px solid var(--ad-primary);
    outline-offset: 2px;
}

/* Submenu */
.ad-nav-submenu {
    display: none;
    padding: 4px 0 4px 20px;
}

.ad-nav-item.open > .ad-nav-submenu {
    display: block;
}

/* Submenu: show on hover (desktop / fine pointer); click toggle (.open) unchanged */
@media (hover: hover) and (pointer: fine) {
    .ad-nav-item:has(.ad-nav-submenu):hover > .ad-nav-submenu {
        display: block;
    }

    .ad-nav-item:has(.ad-nav-submenu):hover > .ad-nav-link .ad-nav-chevron,
    .ad-nav-item:has(.ad-nav-submenu):hover > .ad-nav-item-head > .ad-nav-link .ad-nav-chevron {
        transform: rotate(90deg);
        opacity: 0.8;
    }
}

.ad-nav-submenu .ad-nav-link {
    padding: 7px 12px 7px 24px;
    font-size: 0.8rem;
    font-weight: 400;
    position: relative;
}

.ad-nav-submenu .ad-nav-link::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%);
    transition: background 0.15s;
}

.ad-nav-submenu .ad-nav-link.active::after,
.ad-nav-submenu .ad-nav-link:hover::after {
    background: var(--ad-primary);
}

.ad-nav-submenu .ad-nav-link.active::before {
    display: none;
}

/* --- Sidebar footer --- */
.ad-sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

/* --- Sidebar collapse (desktop) --- */
body.sidebar-collapsed .ad-sidebar {
    width: var(--ad-sidebar-collapsed-w);
}

body.sidebar-collapsed .ad-sidebar-brand-text,
body.sidebar-collapsed .ad-nav-label,
body.sidebar-collapsed .ad-nav-chevron,
body.sidebar-collapsed .ad-nav-section,
body.sidebar-collapsed .ad-nav-submenu,
body.sidebar-collapsed .ad-nav-add-btn {
    display: none;
}

/* Collapsed sidebar: flyout submenu on hover (fine pointer) */
@media (hover: hover) and (pointer: fine) {
    body.sidebar-collapsed .ad-sidebar-nav .ad-nav-item:has(.ad-nav-submenu) {
        position: relative;
    }

    body.sidebar-collapsed .ad-sidebar-nav .ad-nav-item:has(.ad-nav-submenu):hover > .ad-nav-submenu {
        display: block;
        position: absolute;
        left: calc(100% + 6px);
        top: 0;
        padding: 6px 0;
        min-width: 200px;
        background: var(--ad-sidebar-bg);
        border-radius: var(--ad-radius-sm);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
        border: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 1100;
    }

    /* Invisible strip so the pointer can cross the gap without closing */
    body.sidebar-collapsed .ad-sidebar-nav .ad-nav-item:has(.ad-nav-submenu):hover > .ad-nav-submenu::before {
        content: '';
        position: absolute;
        left: -12px;
        top: 0;
        bottom: 0;
        width: 12px;
    }

    body.sidebar-collapsed .ad-sidebar-nav .ad-nav-item:has(.ad-nav-submenu):hover > .ad-nav-submenu .ad-nav-link {
        padding: 8px 14px;
    }
}

body.sidebar-collapsed .ad-sidebar-brand {
    justify-content: center;
    padding: 16px 0;
}

body.sidebar-collapsed .ad-nav-link {
    justify-content: center;
    padding: 10px;
}

body.sidebar-collapsed .ad-nav-item-head {
    justify-content: center;
}

body.sidebar-collapsed .ad-nav-item-head > .ad-nav-link {
    flex: 0 0 auto;
    width: 100%;
}

body.sidebar-collapsed .ad-nav-link.active::before {
    left: 0;
}

body.sidebar-collapsed .ad-topbar {
    left: var(--ad-sidebar-collapsed-w);
    width: calc(100% - var(--ad-sidebar-collapsed-w));
}

body.sidebar-collapsed .ad-main {
    margin-left: var(--ad-sidebar-collapsed-w);
}

/* Tooltip on collapsed sidebar */
body.sidebar-collapsed .ad-nav-link[data-title] {
    position: relative;
}

/* ===================================================================
   TOPBAR
   =================================================================== */
.ad-topbar {
    position: fixed;
    top: 0;
    left: var(--ad-sidebar-w);
    right: 0;
    height: var(--ad-topbar-h);
    background: var(--ad-surface);
    border-bottom: 1px solid var(--ad-border);
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    transition: left var(--ad-transition), width var(--ad-transition);
    width: calc(100% - var(--ad-sidebar-w));
}

.ad-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.ad-topbar-toggle {
    display: none;
    border: none;
    background: none;
    color: var(--ad-text);
    font-size: 1.125rem;
    padding: 6px;
    border-radius: var(--ad-radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}

.ad-topbar-toggle:hover {
    background: var(--ad-bg);
}

.ad-topbar-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--ad-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.ad-topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--ad-text-muted);
}

.ad-topbar-breadcrumb a {
    color: var(--ad-primary);
    text-decoration: none;
}

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

.ad-topbar-breadcrumb .separator {
    color: var(--ad-text-light);
}

.ad-topbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Desktop sidebar collapse toggle */
.ad-topbar-collapse-btn {
    display: inline-flex;
    border: none;
    background: none;
    color: var(--ad-text-muted);
    font-size: 1.0625rem;
    padding: 8px;
    border-radius: var(--ad-radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.ad-topbar-collapse-btn:hover {
    background: var(--ad-bg);
    color: var(--ad-text);
}

/* Topbar icon buttons (notification, etc.) */
.ad-topbar-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--ad-radius);
    border: none;
    background: none;
    color: var(--ad-text-muted);
    font-size: 1.0625rem;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.ad-topbar-icon-btn:hover {
    background: var(--ad-bg);
    color: var(--ad-text);
}

.ad-topbar-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--ad-danger);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* User dropdown */
.ad-user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    border-radius: var(--ad-radius-lg);
    border: 1px solid var(--ad-border);
    background: var(--ad-surface);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    color: var(--ad-text);
}

.ad-user-btn:hover {
    background: var(--ad-bg);
    border-color: #cbd5e1;
    color: var(--ad-text);
    text-decoration: none;
}

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

.ad-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.ad-user-name {
    font-weight: 600;
    font-size: 0.8125rem;
}

.ad-user-role {
    font-size: 0.6875rem;
    color: var(--ad-text-muted);
    text-transform: capitalize;
}

/* User dropdown menu */
.ad-user-dropdown .dropdown-menu {
    min-width: 200px;
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    box-shadow: var(--ad-shadow-lg);
    padding: 6px;
    margin-top: 8px !important;
}

.ad-user-dropdown .dropdown-item {
    border-radius: var(--ad-radius-sm);
    padding: 8px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ad-text);
    transition: all 0.12s;
}

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

.ad-user-dropdown .dropdown-item.text-danger:hover {
    background: #fef2f2;
    color: var(--ad-danger);
}

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

/* Notification dropdown */
.ad-notification-dropdown .dropdown-menu {
    min-width: 340px;
    max-width: 400px;
    max-height: 65vh;
    overflow-y: auto;
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    box-shadow: var(--ad-shadow-lg);
    padding: 0;
    margin-top: 8px !important;
}

.ad-notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--ad-text);
    border-bottom: 1px solid var(--ad-border);
}

.ad-notification-item {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--ad-text);
    text-decoration: none;
    transition: background 0.12s;
}

.ad-notification-item:hover {
    background: var(--ad-bg);
    text-decoration: none;
    color: var(--ad-text);
}

.ad-notification-item.unread {
    background: var(--ad-primary-light);
}

.ad-notification-item.unread:hover {
    background: #e0e7ff;
}

.ad-notification-item-title {
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.3;
    margin-bottom: 2px;
}

.ad-notification-item-msg {
    font-size: 0.75rem;
    color: var(--ad-text-muted);
    line-height: 1.3;
}

.ad-notification-footer {
    text-align: center;
    padding: 10px;
    border-top: 1px solid var(--ad-border);
}

.ad-notification-footer a {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ad-primary);
    text-decoration: none;
}

.ad-notification-footer a:hover {
    text-decoration: underline;
}

/* ===================================================================
   MAIN CONTENT AREA
   =================================================================== */
.ad-main {
    margin-left: var(--ad-sidebar-w);
    padding-top: var(--ad-topbar-h);
    min-height: 100vh;
    transition: margin-left var(--ad-transition);
}

.ad-content {
    padding: 24px;
}

.ad-content-card {
    background: var(--ad-surface);
    border-radius: var(--ad-radius-lg);
    box-shadow: var(--ad-shadow-xs);
    padding: 24px;
    min-height: calc(100vh - var(--ad-topbar-h) - 48px - 48px);
}

/* ===================================================================
   FOOTER
   =================================================================== */
.ad-footer {
    padding: 16px 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--ad-text-light);
}

/* ===================================================================
   BREADCRUMBS (Yii2 override)
   =================================================================== */
.ad-content .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
    font-size: 0.8125rem;
}

.ad-content .breadcrumb-item a {
    color: var(--ad-primary);
    text-decoration: none;
    font-weight: 500;
}

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

.ad-content .breadcrumb-item.active {
    color: var(--ad-text-muted);
}

/* ===================================================================
   TOAST MESSAGES
   =================================================================== */
.ad-toast-container {
    position: fixed;
    top: calc(var(--ad-topbar-h) + 12px);
    right: 16px;
    z-index: 9999;
    max-width: 380px;
    width: 100%;
}

.ad-toast-container .toast {
    border: none;
    border-radius: var(--ad-radius);
    box-shadow: var(--ad-shadow-lg);
    margin-bottom: 8px;
}

/* ===================================================================
   COMPONENT OVERRIDES — Card, Table, Button, Form
   =================================================================== */

/* Cards */
body.admin-dashboard .card {
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    box-shadow: var(--ad-shadow-xs);
    transition: box-shadow 0.2s;
}

body.admin-dashboard .card:hover {
    box-shadow: var(--ad-shadow-sm);
}

body.admin-dashboard .card-header {
    background: var(--ad-bg);
    border-bottom: 1px solid var(--ad-border);
    font-weight: 600;
    padding: 14px 20px;
    border-radius: var(--ad-radius) var(--ad-radius) 0 0;
}

/* Tables */
body.admin-dashboard .table {
    border-radius: var(--ad-radius);
    overflow: hidden;
    border: 1px solid var(--ad-border);
    box-shadow: none;
    margin-bottom: 0;
}

body.admin-dashboard .table thead th {
    background: var(--ad-bg);
    border-bottom: 2px solid var(--ad-border);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ad-text-muted);
    padding: 10px 14px;
}

body.admin-dashboard .table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

body.admin-dashboard .table tbody tr:hover {
    background: #fafbfd;
}

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

/* Buttons */
body.admin-dashboard .btn {
    border-radius: var(--ad-radius-sm);
    font-weight: 500;
    transition: all 0.15s ease;
}

body.admin-dashboard .btn-primary {
    background: var(--ad-primary);
    border-color: var(--ad-primary);
}

body.admin-dashboard .btn-primary:hover {
    background: var(--ad-primary-dark);
    border-color: var(--ad-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--ad-shadow-sm);
}

/* Forms */
body.admin-dashboard .form-control,
body.admin-dashboard .form-select {
    border-radius: var(--ad-radius-sm);
    border: 1px solid var(--ad-border);
    transition: all 0.15s;
    font-size: 0.8125rem;
}

body.admin-dashboard .form-control:focus,
body.admin-dashboard .form-select:focus {
    border-color: var(--ad-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

body.admin-dashboard .form-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--ad-text);
    margin-bottom: 4px;
}

/* ===================================================================
   MOBILE SIDEBAR OVERLAY
   =================================================================== */
.ad-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1039;
    backdrop-filter: blur(2px);
}

body.ad-sidebar-open .ad-sidebar-overlay {
    display: block;
}

/* ===================================================================
   ANIMATIONS
   =================================================================== */
.ad-fade-in {
    animation: adFadeIn 0.3s ease-out;
}

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

/* ===================================================================
   SCROLLBAR (global)
   =================================================================== */
body.admin-dashboard ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

body.admin-dashboard ::-webkit-scrollbar-track {
    background: transparent;
}

body.admin-dashboard ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

body.admin-dashboard ::-webkit-scrollbar-thumb:hover {
    background: var(--ad-secondary);
}

/* ===================================================================
   QUICK ADD (topbar)
   =================================================================== */
.ad-topbar-quick-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--ad-radius);
    border: 1px solid var(--ad-border);
    background: var(--ad-surface);
    color: var(--ad-text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.ad-topbar-quick-add-btn:hover {
    background: var(--ad-bg);
    color: var(--ad-text);
    border-color: var(--ad-border);
}

.ad-topbar-quick-add .dropdown-menu {
    min-width: 220px;
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    box-shadow: var(--ad-shadow-lg);
    padding: 6px;
    margin-top: 8px !important;
}

.ad-topbar-quick-add .dropdown-item {
    border-radius: var(--ad-radius-sm);
    padding: 8px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ad-text);
    transition: all 0.12s;
}

.ad-topbar-quick-add .dropdown-item:hover {
    background: var(--ad-bg);
    color: var(--ad-primary);
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */

/* Tablet */
@media (max-width: 991.98px) {
    .ad-sidebar {
        transform: translateX(-100%);
    }

    body.ad-sidebar-open .ad-sidebar {
        transform: translateX(0);
    }

    .ad-topbar {
        left: 0;
        width: 100%;
    }

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

    .ad-topbar-toggle {
        display: inline-flex;
    }

    .ad-topbar-collapse-btn {
        display: none;
    }

    .ad-content {
        padding: 16px;
    }

    .ad-content-card {
        padding: 16px;
        border-radius: var(--ad-radius);
    }

    .ad-user-info {
        display: none;
    }

    .ad-user-btn {
        padding: 4px;
        border: none;
    }
}

/* Mobile */
@media (max-width: 575.98px) {
    .ad-content {
        padding: 12px;
    }

    .ad-content-card {
        padding: 14px;
    }

    .ad-topbar {
        padding: 0 12px;
    }

    .ad-topbar-title {
        font-size: 0.9375rem;
    }

    .ad-notification-dropdown .dropdown-menu {
        position: fixed !important;
        left: 8px !important;
        right: 8px !important;
        top: calc(var(--ad-topbar-h) + 4px) !important;
        min-width: 0;
        max-width: none;
        width: auto;
        transform: none !important;
    }

    .ad-topbar-quick-add-label {
        display: none;
    }

    .ad-topbar-quick-add-btn {
        width: 38px;
        padding: 0;
        gap: 0;
    }

    .ad-topbar-quick-add .dropdown-menu {
        position: fixed !important;
        left: 8px !important;
        right: 8px !important;
        top: calc(var(--ad-topbar-h) + 4px) !important;
        min-width: 0;
        width: auto;
        transform: none !important;
    }
}

/* ===================================================================
   SUPERVISOR MOBILE — Dashboard, Attendance, Field usage
   =================================================================== */

/* --- Supervisor dashboard cards --- */
.sv-stat-card {
    border: none;
    border-radius: var(--ad-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--ad-surface);
    box-shadow: var(--ad-shadow-xs);
    transition: box-shadow 0.15s;
    min-height: 80px;
}

.sv-stat-card:hover {
    box-shadow: var(--ad-shadow-sm);
}

.sv-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--ad-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.sv-stat-body {
    flex: 1;
    min-width: 0;
}

.sv-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.sv-stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ad-text-muted);
}

.sv-stat-sub {
    font-size: 0.6875rem;
    color: var(--ad-text-light);
    margin-top: 2px;
}

/* CTA button */
.sv-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--ad-radius);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    color: #fff;
    background: linear-gradient(135deg, var(--ad-primary) 0%, var(--ad-primary-dark) 100%);
    box-shadow: var(--ad-shadow-sm);
    transition: all 0.15s;
    text-decoration: none;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
}

.sv-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--ad-shadow);
    color: #fff;
    text-decoration: none;
}

.sv-cta-btn:active {
    transform: scale(0.98);
}

/* Quick action grid */
.sv-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.sv-quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border-radius: var(--ad-radius);
    background: var(--ad-surface);
    border: 1px solid var(--ad-border);
    text-decoration: none;
    color: var(--ad-text);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.12s;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.15);
}

.sv-quick-item:hover {
    border-color: var(--ad-primary);
    color: var(--ad-primary);
    background: var(--ad-primary-light);
    text-decoration: none;
}

.sv-quick-item:active {
    transform: scale(0.96);
}

.sv-quick-item .sv-quick-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--ad-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* --- Attendance Muster: mobile fullscreen modal --- */
@media (max-width: 575.98px) {
    #muster-day-modal .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100vh;
    }

    #muster-day-modal .modal-content {
        border: none;
        border-radius: 0;
        min-height: 100vh;
    }

    #muster-day-modal .modal-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--ad-surface);
        border-bottom: 1px solid var(--ad-border);
    }

    #muster-day-modal .modal-footer {
        position: sticky;
        bottom: 0;
        z-index: 10;
        background: var(--ad-surface);
        border-top: 1px solid var(--ad-border);
        padding: 12px 16px;
        gap: 8px;
    }

    #muster-day-modal .modal-footer .btn {
        flex: 1;
        min-height: 48px;
        font-size: 0.9375rem;
        border-radius: var(--ad-radius-sm);
    }

    #muster-backdate-request-modal .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100vh;
    }

    #muster-backdate-request-modal .modal-content {
        border: none;
        border-radius: 0;
        min-height: 100vh;
    }
}

/* Attendance calendar — bigger touch targets on mobile */
@media (max-width: 575.98px) {
    .muster-calendar td.muster-day-cell {
        min-width: 46px;
        min-height: 54px;
        padding: 6px 4px !important;
        font-size: 0.8125rem;
        -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
        touch-action: manipulation;
    }

    .muster-calendar th {
        padding: 8px 2px;
        font-size: 0.6875rem;
        text-align: center;
    }

    .attendance-muster-index .card-body {
        padding: 12px;
    }

    .attendance-muster-index .row.g-3 > .col-12 {
        margin-bottom: 4px;
    }
}

/* Attendance muster filter — stacked on mobile */
@media (max-width: 767.98px) {
    .attendance-muster-index .card-header.bg-primary {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px;
    }

    .attendance-muster-index #muster-export-buttons {
        width: 100%;
    }

    .attendance-muster-index #muster-export-buttons .btn {
        flex: 1;
        min-height: 40px;
    }
}

/* --- Backdate requests: mobile card view --- */
.backdate-mobile-card {
    background: var(--ad-surface);
    border-bottom: 1px solid #f1f5f9;
    padding: 14px 16px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.04);
}

.backdate-mobile-card:last-child {
    border-bottom: none;
}

.backdate-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.backdate-mobile-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.backdate-mobile-meta {
    font-size: 0.75rem;
    color: var(--ad-text-muted);
    line-height: 1.4;
}

.backdate-mobile-reason {
    font-size: 0.8125rem;
    color: var(--ad-text);
    margin-top: 6px;
    padding: 8px 10px;
    background: var(--ad-bg);
    border-radius: var(--ad-radius-sm);
}

.backdate-mobile-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.backdate-mobile-actions .btn {
    flex: 1;
    min-height: 40px;
    font-size: 0.8125rem;
}

/* --- Supervisor dashboard: mobile tweaks --- */
@media (max-width: 575.98px) {
    .dashboard-container {
        padding: 0;
    }

    .sv-stat-card {
        padding: 14px;
    }

    .sv-stat-value {
        font-size: 1.125rem;
    }

    .sv-quick-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .sv-quick-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .sv-quick-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===================================================================
   GLOBAL COMPONENT STYLES — Cards, Tables, Forms, Lists, Views
   Applied automatically to all modules
   =================================================================== */

/* ---------- Cards ---------- */
.ad-content-card .card {
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    box-shadow: var(--ad-shadow-xs);
    overflow: hidden;
    margin-bottom: 1rem;
}

.ad-content-card .card-header {
    background: var(--ad-surface);
    border-bottom: 1px solid var(--ad-border);
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--ad-text);
}

.ad-content-card .card-body {
    padding: 1.25rem;
}

.ad-content-card .card-footer {
    background: #f8fafc;
    border-top: 1px solid var(--ad-border);
    padding: 0.75rem 1.25rem;
}

/* ---------- Page Headers ---------- */
.page-icon .fa-stack {
    font-size: 1rem;
}

.page-icon .fa-stack .fa-circle {
    color: var(--ad-primary);
}

.page-icon .fa-stack .fa-inverse {
    color: #fff;
}

.conttitle {
    padding: 0.25rem 0;
}

.conttitle h3.page-title,
.conttitle h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ad-text);
}

/* ---------- Tables / GridView ---------- */
.ad-content-card .table {
    font-size: 0.8125rem;
    color: var(--ad-text);
    margin-bottom: 0;
}

.ad-content-card .table > thead > tr > th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ad-text-muted);
    border-bottom: 2px solid var(--ad-border);
    padding: 0.75rem 0.875rem;
    white-space: nowrap;
}

.ad-content-card .table > tbody > tr > td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.ad-content-card .table > tbody > tr:last-child > td {
    border-bottom: none;
}

.ad-content-card .table > tbody > tr:hover {
    background: #f8fafc;
}

.ad-content-card .table > tbody > tr[style*="cursor: pointer"]:hover {
    background: var(--ad-primary-light);
}

.ad-content-card .table > tfoot > tr > td {
    font-weight: 700;
    border-top: 2px solid var(--ad-border);
    padding: 0.75rem 0.875rem;
}

.ad-content-card .table .filters input,
.ad-content-card .table .filters select {
    font-size: 0.8125rem;
    border-radius: var(--ad-radius-sm);
    border: 1.5px solid var(--ad-border);
    padding: 0.375rem 0.5rem;
}

.ad-content-card .table .filters input:focus,
.ad-content-card .table .filters select:focus {
    border-color: var(--ad-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* GridView action icons */
.action-icon {
    /* width: 32px; */
    /* height: 32px; */
    padding: 5px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: var(--ad-radius-sm);
    font-size: 0.8125rem;
    transition: all 0.15s;
}

.action-icon:hover {
    transform: translateY(-1px);
    box-shadow: var(--ad-shadow-sm);
}

/* ---------- Pagination ---------- */
.ad-content-card .pagination {
    gap: 0.25rem;
    margin: 1rem 0 0;
}

.ad-content-card .pagination .page-link {
    border-radius: var(--ad-radius-sm);
    border: 1px solid var(--ad-border);
    color: var(--ad-text);
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
}

.ad-content-card .pagination .page-item.active .page-link {
    background: var(--ad-primary);
    border-color: var(--ad-primary);
    color: #fff;
}

.ad-content-card .pagination .page-link:hover {
    background: var(--ad-primary-light);
    color: var(--ad-primary);
    border-color: var(--ad-primary);
}

/* ---------- DetailView ---------- */
.ad-content-card .detail-view {
    border-radius: var(--ad-radius);
    overflow: hidden;
    border: 1px solid var(--ad-border);
}

.ad-content-card .detail-view th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--ad-text-muted);
    white-space: nowrap;
    width: 35%;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
}

.ad-content-card .detail-view td {
    font-size: 0.8125rem;
    color: var(--ad-text);
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.ad-content-card .detail-view tr:last-child th,
.ad-content-card .detail-view tr:last-child td {
    border-bottom: none;
}

/* ---------- Forms ---------- */
.ad-content-card .form-label,
.ad-content-card label.control-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--ad-text);
    margin-bottom: 0.375rem;
}

.ad-content-card .form-control {
    border-radius: var(--ad-radius-sm);
    border: 1.5px solid var(--ad-border);
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    background: #f8fafc;
    transition: all 0.15s;
    color: var(--ad-text);
}

.ad-content-card .form-control:focus {
    border-color: var(--ad-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: #fff;
}

.ad-content-card .form-select {
    border-radius: var(--ad-radius-sm);
    border: 1.5px solid var(--ad-border);
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    background-color: #f8fafc;
    color: var(--ad-text);
}

.ad-content-card .form-select:focus {
    border-color: var(--ad-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ad-content-card .input-group-text {
    border-radius: var(--ad-radius-sm) 0 0 var(--ad-radius-sm);
    border: 1.5px solid var(--ad-border);
    border-right: none;
    background: #f1f5f9;
    color: var(--ad-text-muted);
    font-size: 0.8125rem;
}

.ad-content-card .input-group .form-control {
    border-radius: 0 var(--ad-radius-sm) var(--ad-radius-sm) 0;
}

.ad-content-card .form-text {
    font-size: 0.75rem;
    color: var(--ad-text-light);
}

.ad-content-card .invalid-feedback,
.ad-content-card .help-block.help-block-error {
    font-size: 0.75rem;
    color: var(--ad-danger);
    margin-top: 0.25rem;
}

.ad-content-card .has-error .form-control {
    border-color: var(--ad-danger);
}

.ad-content-card .has-error .form-control:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ---------- Buttons ---------- */
.ad-content-card .btn-success {
    background: linear-gradient(135deg, var(--ad-success) 0%, #059669 100%);
    border: none;
    border-radius: var(--ad-radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1.25rem;
    transition: all 0.15s;
}

.ad-content-card .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.ad-content-card .btn-primary {
    background: linear-gradient(135deg, var(--ad-primary) 0%, var(--ad-primary-dark) 100%);
    border: none;
    border-radius: var(--ad-radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1.25rem;
    transition: all 0.15s;
}

.ad-content-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ad-content-card .btn-danger {
    background: linear-gradient(135deg, var(--ad-danger) 0%, #dc2626 100%);
    border: none;
    border-radius: var(--ad-radius-sm);
}

.ad-content-card .btn-warning {
    border-radius: var(--ad-radius-sm);
    font-weight: 600;
}

.ad-content-card .btn-outline-primary {
    border: 1.5px solid var(--ad-primary);
    color: var(--ad-primary);
    border-radius: var(--ad-radius-sm);
    font-weight: 600;
    font-size: 0.8125rem;
}

.ad-content-card .btn-outline-primary:hover {
    background: var(--ad-primary);
    color: #fff;
}

.ad-content-card .btn-outline-success {
    border: 1.5px solid var(--ad-success);
    color: var(--ad-success);
    border-radius: var(--ad-radius-sm);
}

.ad-content-card .btn-outline-danger {
    border: 1.5px solid var(--ad-danger);
    color: var(--ad-danger);
    border-radius: var(--ad-radius-sm);
}

/* ---------- Tabs ---------- */
.ad-content-card .nav-tabs {
    border-bottom: 2px solid var(--ad-border);
    gap: 0.25rem;
}

.ad-content-card .nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--ad-text-muted);
    padding: 0.625rem 1rem;
    border-radius: var(--ad-radius-sm) var(--ad-radius-sm) 0 0;
    transition: all 0.15s;
}

.ad-content-card .nav-tabs .nav-link:hover {
    color: var(--ad-primary);
    background: var(--ad-primary-light);
}

.ad-content-card .nav-tabs .nav-link.active {
    color: var(--ad-primary);
    border-bottom-color: var(--ad-primary);
    background: transparent;
}

.ad-content-card .tab-content {
    padding: 1.25rem 0;
}

/* ---------- Badges ---------- */
.ad-content-card .badge {
    font-weight: 600;
    font-size: 0.6875rem;
    padding: 0.3em 0.65em;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

/* ---------- Alerts ---------- */
.ad-content-card .alert {
    border-radius: var(--ad-radius);
    border: none;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
}

.ad-content-card .alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.ad-content-card .alert-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.ad-content-card .alert-warning {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.ad-content-card .alert-info {
    background: #ecfeff;
    color: #0e7490;
    border: 1px solid #a5f3fc;
}

/* ---------- Modals ---------- */
.modal-content {
    border-radius: var(--ad-radius-lg);
    border: none;
    box-shadow: var(--ad-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--ad-border);
    padding: 1rem 1.25rem;
}

.modal-header .modal-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--ad-text);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--ad-border);
    padding: 0.75rem 1.25rem;
}

/* ---------- Mobile FAB ---------- */
.mobile-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1040;
}

.fab-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ad-primary) 0%, var(--ad-primary-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    text-decoration: none;
    transition: all 0.2s;
}

.fab-btn:hover,
.fab-btn:focus {
    transform: scale(1.1);
    color: #fff;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

/* ---------- Mobile Search ---------- */
.search-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--ad-text-light);
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    z-index: 2;
}

.search-clear-btn:hover {
    color: var(--ad-danger);
}

/* ---------- Select2 Widget Integration ---------- */
.ad-content-card .select2-container--krajee-bs5 .select2-selection {
    border: 1.5px solid var(--ad-border);
    border-radius: var(--ad-radius-sm);
    min-height: 40px;
    background: #f8fafc;
}

.ad-content-card .select2-container--krajee-bs5 .select2-selection:focus,
.ad-content-card .select2-container--krajee-bs5.select2-container--open .select2-selection {
    border-color: var(--ad-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.select2-dropdown {
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius-sm);
    box-shadow: var(--ad-shadow);
}

.select2-results__option--highlighted {
    background: var(--ad-primary) !important;
}

/* ---------- Bootstrap-Select Integration ---------- */
.ad-content-card .bootstrap-select .dropdown-toggle {
    border: 1.5px solid var(--ad-border);
    border-radius: var(--ad-radius-sm);
    background: #f8fafc;
    font-size: 0.875rem;
    padding: 0.625rem 0.75rem;
}

.ad-content-card .bootstrap-select .dropdown-toggle:focus {
    border-color: var(--ad-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ---------- Dashboard Styles ---------- */
.dashboard-container {
    padding: 0;
}

.dashboard-container .border-left-primary {
    border-left: 3px solid var(--ad-primary) !important;
    border: 1px solid var(--ad-border);
    border-left: 3px solid var(--ad-primary) !important;
    border-radius: var(--ad-radius);
}

.dashboard-container .border-left-success {
    border: 1px solid var(--ad-border);
    border-left: 3px solid var(--ad-success) !important;
    border-radius: var(--ad-radius);
}

.dashboard-container .border-left-info {
    border: 1px solid var(--ad-border);
    border-left: 3px solid var(--ad-info) !important;
    border-radius: var(--ad-radius);
}

.dashboard-container .border-left-warning {
    border: 1px solid var(--ad-border);
    border-left: 3px solid var(--ad-warning) !important;
    border-radius: var(--ad-radius);
}

.dashboard-container .card {
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    box-shadow: var(--ad-shadow-xs) !important;
}

.dashboard-container .card-header {
    background: var(--ad-surface);
    border-bottom: 1px solid var(--ad-border);
}

.dashboard-container .text-gray-300 {
    color: var(--ad-border) !important;
}

.dashboard-container .text-gray-800 {
    color: var(--ad-text) !important;
}

.dashboard-container .font-weight-bold {
    font-weight: 700 !important;
}

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

/* ---------- Project status badges ---------- */
.project-status-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25em 0.6em;
    border-radius: 6px;
}

.project-status-active {
    background: #f0fdf4;
    color: #15803d;
}

.project-status-completed {
    background: var(--ad-primary-light);
    color: var(--ad-primary);
}

.project-status-paused {
    background: #fffbeb;
    color: #b45309;
}

/* ---------- Skeleton loading animation ---------- */
.skeleton {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s infinite ease-in-out;
    border-radius: var(--ad-radius-sm);
}

@keyframes skeletonPulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Audit Feed ---------- */
.audit-card {
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: var(--ad-surface);
}

/* ===================================================================
   RESPONSIVE — Mobile optimizations for all modules
   =================================================================== */

@media (max-width: 767.98px) {
    /* Content card padding on mobile */
    .ad-content-card {
        padding: 0.75rem;
    }

    /* Table: prevent overflow + nicer sizing */
    .ad-content-card .table > thead > tr > th {
        padding: 0.4rem 0.525rem;
        font-size: 0.5875rem;
    }

    .ad-content-card .table > tbody > tr > td {
        padding: 0.4rem 0.525rem;
        font-size: 0.65rem;
    }

    /* Form fields stack full width */
    .ad-content-card .row.g-4.project-form .col-12.col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Page headers */
    .conttitle h3.page-title,
    .conttitle h2 {
        font-size: 1.025rem;
    }

    .page-icon .fa-stack {
        font-size: 0.775rem;
    }

    /* Tabs scroll horizontally */
    .ad-content-card .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .ad-content-card .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .ad-content-card .nav-tabs .nav-link {
        white-space: nowrap;
        font-size: 0.7125rem;
        padding: 0.5rem 0.75rem;
    }

    /* Mobile list cards */
    .employee-mobile-card .card-body,
    .project-mobile-card .card-body,
    .salary-mobile-card .card-body {
        padding: 0.775rem 0.9rem;
    }

    .employee-mobile-card,
    .project-mobile-card,
    .salary-mobile-card {
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border-bottom: 1px solid var(--ad-border) !important;
    }

    .employee-mobile-card:last-child,
    .project-mobile-card:last-child,
    .salary-mobile-card:last-child {
        border-bottom: none !important;
    }

    /* Dashboard: stacked metric cards */
    .dashboard-container .col-xl-3,
    .dashboard-container .col-md-6 {
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .dashboard-container .border-left-primary,
    .dashboard-container .border-left-success,
    .dashboard-container .border-left-info,
    .dashboard-container .border-left-warning {
        border-radius: var(--ad-radius-sm);
    }

    .dashboard-container .card-body {
        padding: 0.875rem;
    }

    .dashboard-container h1.h3 {
        font-size: 1.25rem;
    }

    /* Detail view on mobile */
    .ad-content-card .detail-view th {
        width: 40%;
        font-size: 0.75rem;
        padding: 0.5rem 0.625rem;
    }

    .ad-content-card .detail-view td {
        font-size: 0.75rem;
        padding: 0.5rem 0.625rem;
    }

    /* Quick actions on dashboard */
    .dashboard-container .btn-outline-primary,
    .dashboard-container .btn-outline-success,
    .dashboard-container .btn-outline-info,
    .dashboard-container .btn-outline-warning,
    .dashboard-container .btn-outline-secondary,
    .dashboard-container .btn-outline-danger {
        width: 100%;
        text-align: left;
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        border-radius: var(--ad-radius-sm);
    }

    .dashboard-container .btn-outline-primary i,
    .dashboard-container .btn-outline-success i,
    .dashboard-container .btn-outline-info i,
    .dashboard-container .btn-outline-warning i,
    .dashboard-container .btn-outline-secondary i,
    .dashboard-container .btn-outline-danger i {
        width: 20px;
        text-align: center;
    }

    .dashboard-container .btn br {
        display: none;
    }
}

@media (max-width: 575.98px) {
    /* Extra small: tighten further */
    .ad-content-card {
        padding: 0.5rem;
    }

    .ad-content-card .card-body {
        padding: 0.875rem;
    }

    .ad-content-card .form-control,
    .ad-content-card .form-select {
        font-size: 1rem;
        padding: 0.75rem 0.875rem;
    }

    /* Larger touch targets for buttons */
    .ad-content-card .btn {
        min-height: 42px;
    }
}

/* ===================================================================
   PRINT
   =================================================================== */
@media print {
    .ad-sidebar,
    .ad-topbar,
    .ad-sidebar-overlay,
    .ad-toast-container {
        display: none !important;
    }

    .ad-main {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    .ad-content-card {
        box-shadow: none;
        border: none;
        padding: 0;
    }
}
