/* ==========================================================================
   AtriClass Admin Panel – Theme CSS
   Design System: Clean, professional, modern.
   Version: 2.0
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CUSTOM PROPERTIES (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* Brand */
    --ac-primary:        #2563eb;   /* Blue */
    --ac-primary-hover:  #1d4ed8;
    --ac-primary-light:  #eff6ff;
    --ac-primary-muted:  #bfdbfe;

    /* Neutrals */
    --ac-bg:             #f5f6fa;
    --ac-surface:        #ffffff;
    --ac-border:         #e5e7eb;
    --ac-border-light:   #f3f4f6;

    /* Text */
    --ac-text-primary:   #111827;
    --ac-text-secondary: #6b7280;
    --ac-text-muted:     #9ca3af;

    /* Status colours */
    --ac-new-bg:         #eff6ff;
    --ac-new-text:       #2563eb;
    --ac-new-border:     #bfdbfe;

    --ac-contacted-bg:   #f3e8ff;
    --ac-contacted-text: #7c3aed;
    --ac-contacted-border:#ddd6fe;

    --ac-followup-bg:    #fffbeb;
    --ac-followup-text:  #d97706;
    --ac-followup-border:#fde68a;

    --ac-converted-bg:   #f0fdf4;
    --ac-converted-text: #16a34a;
    --ac-converted-border:#bbf7d0;

    --ac-lost-bg:        #f9fafb;
    --ac-lost-text:      #6b7280;
    --ac-lost-border:    #e5e7eb;

    --ac-pending-bg:     #fff7ed;
    --ac-pending-text:   #ea580c;
    --ac-pending-border: #fed7aa;

    --ac-active-bg:      #f0fdf4;
    --ac-active-text:    #16a34a;
    --ac-active-border:  #bbf7d0;

    --ac-inactive-bg:    #fef2f2;
    --ac-inactive-text:  #dc2626;
    --ac-inactive-border:#fecaca;

    /* Shadows */
    --ac-shadow-sm:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --ac-shadow:         0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
    --ac-shadow-md:      0 10px 15px -3px rgba(0,0,0,.07), 0 4px 6px -2px rgba(0,0,0,.04);

    /* Radii */
    --ac-radius-sm:  4px;
    --ac-radius:     8px;
    --ac-radius-md:  12px;
    --ac-radius-full:9999px;

    /* Spacing */
    --ac-header-h:   64px;

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

/* --------------------------------------------------------------------------
   2. BASE RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 14px; }

body {
    font-family: var(--ac-font);
    background: var(--ac-bg);
    color: var(--ac-text-primary);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   3. NAVBAR / HEADER
   -------------------------------------------------------------------------- */
.navbar-custom {
    background: var(--ac-surface) !important;
    border-bottom: 1px solid var(--ac-border);
    height: var(--ac-header-h);
    box-shadow: var(--ac-shadow-sm);
    padding: 0 24px;
}

.navbar-custom .container,
.navbar-custom .container-fluid {
    height: 100%;
    max-width: 100%;
    padding: 0;
}

/* Brand */
.navbar-custom .navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ac-primary) !important;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
}

.navbar-custom .navbar-brand i { font-size: 1.15rem; }

/* Nav links */
.navbar-custom .navbar-nav { height: 100%; align-items: center; }

.header-nav-bar .nav-link {
    color: var(--ac-text-secondary) !important;
    font-size: .875rem;
    font-weight: 500;
    padding: 0 14px !important;
    height: var(--ac-header-h);
    display: flex !important;
    align-items: center;
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
    white-space: nowrap;
}

.header-nav-bar .nav-link:hover {
    color: var(--ac-primary) !important;
    border-bottom-color: var(--ac-primary-muted);
}

.header-nav-bar.active .nav-link,
.header-nav-bar .nav-link.active {
    color: var(--ac-primary) !important;
    border-bottom-color: var(--ac-primary);
    font-weight: 600;
}

/* Dropdown nav group */
.header-nav-bar.dropdown .dropdown-toggle {
    color: var(--ac-text-secondary) !important;
    font-size: .875rem;
    font-weight: 500;
    height: var(--ac-header-h);
    display: flex !important;
    align-items: center;
    border-bottom: 2px solid transparent;
    padding: 0 14px;
    transition: color .15s, border-color .15s;
}

.header-nav-bar.dropdown .dropdown-toggle::after {
    margin-left: 4px;
    border-top-color: var(--ac-text-muted);
}

.header-nav-bar.dropdown:hover .dropdown-toggle,
.header-nav-bar.dropdown.active .dropdown-toggle {
    color: var(--ac-primary) !important;
    border-bottom-color: var(--ac-primary);
}

.dropdown-menu {
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    box-shadow: var(--ac-shadow-md);
    padding: 6px;
    margin-top: 0;
}

.dropdown-item {
    border-radius: var(--ac-radius-sm);
    font-size: .85rem;
    color: var(--ac-text-primary);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background .12s;
}

.dropdown-item:hover { background: var(--ac-primary-light); color: var(--ac-primary); }
.dropdown-item.active,
.dropdown-item:active { background: var(--ac-primary); color: #fff; }

/* User pill in header */
.header-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--ac-radius-full);
    background: var(--ac-primary-light);
    color: var(--ac-primary) !important;
    font-size: .85rem;
    font-weight: 500;
    cursor: default;
    min-height: 36px;
    white-space: nowrap;
}

.header-user-pill img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--ac-primary-muted);
}

.header-nav-bar span.nav-link {
    color: var(--ac-text-secondary) !important;
    font-size: .875rem;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   4. MAIN LAYOUT
   -------------------------------------------------------------------------- */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 24px;
}

/* --------------------------------------------------------------------------
   5. PAGE HEADER  (title + action row above the card)
   -------------------------------------------------------------------------- */
.ac-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ac-page-header__text {}

.ac-page-header__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ac-text-primary);
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}

.ac-page-header__subtitle {
    font-size: .85rem;
    color: var(--ac-text-secondary);
    margin: 0;
}

.ac-page-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   6. SURFACE / CARD
   -------------------------------------------------------------------------- */
.ac-card {
    background: var(--ac-surface);
    border-radius: var(--ac-radius-md);
    border: 1px solid var(--ac-border);
    box-shadow: var(--ac-shadow-sm);
    overflow: hidden;
}

.ac-card-body { padding: 24px; }

/* Legacy content-card kept as alias */
.content-card {
    background: var(--ac-surface);
    border-radius: var(--ac-radius-md);
    border: 1px solid var(--ac-border);
    box-shadow: var(--ac-shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

/* --------------------------------------------------------------------------
   7. BUTTONS
   -------------------------------------------------------------------------- */

/* Primary */
.btn-ac-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ac-primary);
    color: #fff;
    border: none;
    border-radius: var(--ac-radius);
    padding: 9px 18px;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, box-shadow .15s, transform .1s;
    white-space: nowrap;
}

.btn-ac-primary:hover, .btn-ac-primary:focus {
    background: var(--ac-primary-hover);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,.3);
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-ac-primary:active { transform: translateY(0); }

/* Secondary / Ghost */
.btn-ac-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ac-surface);
    color: var(--ac-text-secondary);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    padding: 8px 16px;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
}

.btn-ac-secondary:hover, .btn-ac-secondary:focus {
    background: var(--ac-border-light);
    color: var(--ac-text-primary);
    border-color: #d1d5db;
    text-decoration: none;
}

/* Icon-only action buttons (table) */
.btn-ac-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--ac-radius-sm);
    border: 1px solid var(--ac-border);
    background: transparent;
    color: var(--ac-text-secondary);
    font-size: .8rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s, color .12s, border-color .12s;
    flex-shrink: 0;
}

.btn-ac-icon:hover       { background: var(--ac-primary-light); color: var(--ac-primary); border-color: var(--ac-primary-muted); text-decoration: none; }
.btn-ac-icon.view:hover  { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.btn-ac-icon.edit:hover  { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.btn-ac-icon.delete:hover{ background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.btn-ac-icon.convert:hover{ background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }

/* Overrides for legacy Bootstrap btn-sm used in tables */
.btn-sm.btn-info    { background: transparent; border-color: var(--ac-border); color: var(--ac-text-secondary); width:30px; height:30px; padding:0; display:inline-flex; align-items:center; justify-content:center; border-radius: var(--ac-radius-sm); }
.btn-sm.btn-info:hover    { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.btn-sm.btn-success { background: transparent; border-color: var(--ac-border); color: var(--ac-text-secondary); width:30px; height:30px; padding:0; display:inline-flex; align-items:center; justify-content:center; border-radius: var(--ac-radius-sm); }
.btn-sm.btn-success:hover { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.btn-sm.btn-warning { background: transparent; border-color: var(--ac-border); color: var(--ac-text-secondary); width:30px; height:30px; padding:0; display:inline-flex; align-items:center; justify-content:center; border-radius: var(--ac-radius-sm); }
.btn-sm.btn-warning:hover { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.btn-sm.btn-danger  { background: transparent; border-color: var(--ac-border); color: var(--ac-text-secondary); width:30px; height:30px; padding:0; display:inline-flex; align-items:center; justify-content:center; border-radius: var(--ac-radius-sm); }
.btn-sm.btn-danger:hover  { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* Keep legacy btn-custom working */
.btn-custom { border-radius: var(--ac-radius); padding: 9px 18px; font-weight: 600; font-size: .875rem; }
.btn-primary { background-color: var(--ac-primary); border-color: var(--ac-primary); }
.btn-primary:hover { background-color: var(--ac-primary-hover); border-color: var(--ac-primary-hover); }

/* --------------------------------------------------------------------------
   8. FILTER DRAWER (right-side slide-over panel)
   -------------------------------------------------------------------------- */

/* Overlay backdrop */
.ac-filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.35);
    z-index: 1040;
    opacity: 0;
    transition: opacity .25s ease;
}

.ac-filter-overlay.is-open {
    display: block;
    opacity: 1;
}

/* Drawer panel */
.ac-filter-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 340px;
    max-width: 100vw;
    height: 100vh;
    background: var(--ac-surface);
    border-left: 1px solid var(--ac-border);
    box-shadow: -8px 0 32px rgba(17,24,39,.12);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}

.ac-filter-drawer.is-open {
    transform: translateX(0);
}

/* Drawer header */
.ac-filter-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--ac-border);
    flex-shrink: 0;
}

.ac-filter-drawer__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ac-text-primary);
    margin: 0;
}

.ac-filter-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--ac-radius-sm);
    border: 1px solid var(--ac-border);
    background: transparent;
    color: var(--ac-text-muted);
    font-size: .85rem;
    cursor: pointer;
    transition: background .12s, color .12s;
    flex-shrink: 0;
}

.ac-filter-drawer__close:hover {
    background: var(--ac-border-light);
    color: var(--ac-text-primary);
}

/* Drawer body – scrollable fields */
.ac-filter-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ac-filter-drawer__body .filter-field { margin-bottom: 20px; }

.ac-filter-drawer__body label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    color: var(--ac-text-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 7px;
}

.ac-filter-drawer__body .form-control {
    border-radius: var(--ac-radius-sm);
    border: 1px solid var(--ac-border);
    font-size: .875rem;
    height: 38px;
    padding: 8px 12px;
    color: var(--ac-text-primary);
    background: var(--ac-surface);
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}

.ac-filter-drawer__body .form-control:focus {
    border-color: var(--ac-primary-muted);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
    outline: none;
}

/* Search input with icon */
.ac-filter-input-wrap {
    position: relative;
}

.ac-filter-input-wrap .ac-filter-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ac-text-muted);
    font-size: .8rem;
    pointer-events: none;
}

.ac-filter-input-wrap .form-control {
    padding-left: 32px;
}

/* Drawer footer */
.ac-filter-drawer__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--ac-border);
    background: var(--ac-border-light);
    flex-shrink: 0;
}

.ac-filter-drawer__footer .btn-ac-secondary {
    flex: 1;
    justify-content: center;
}

.ac-filter-drawer__footer .btn-ac-primary {
    flex: 1.8;
    justify-content: center;
}

/* Legacy inline filter-section (kept for backward compat on other pages) */
.filter-section {
    background: var(--ac-border-light);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.filter-section .form-control {
    border-radius: var(--ac-radius-sm);
    border-color: var(--ac-border);
    font-size: .85rem;
    height: 36px;
    padding: 6px 10px;
    color: var(--ac-text-primary);
    background: var(--ac-surface);
    transition: border-color .15s, box-shadow .15s;
}

.filter-section .form-control:focus {
    border-color: var(--ac-primary-muted);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
    outline: none;
}

.filter-section label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--ac-text-secondary);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}

/* --------------------------------------------------------------------------
   9. TABLE
   -------------------------------------------------------------------------- */
.table-responsive { border-radius: var(--ac-radius); overflow: hidden; }

.table {
    margin: 0;
    font-size: .875rem;
    border-collapse: collapse;
    width: 100%;
}

.table thead tr {
    background: var(--ac-border-light);
    border-bottom: 2px solid var(--ac-border);
}

.table thead th {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ac-text-secondary);
    padding: 12px 16px;
    border: none;
    white-space: nowrap;
    background: transparent;
}

.table tbody tr {
    border-bottom: 1px solid var(--ac-border-light);
    transition: background .12s;
}

.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--ac-primary-light); }

.table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border: none;
    color: var(--ac-text-primary);
}

/* Override Bootstrap table-striped / table-bordered */
.table-striped tbody tr:nth-of-type(odd) { background-color: transparent; }
.table-striped tbody tr:nth-of-type(odd):hover { background: var(--ac-primary-light); }
.table-bordered { border: none; }
.table-bordered td,
.table-bordered th { border: none; border-bottom: 1px solid var(--ac-border-light); }

/* Record code link */
.record-code {
    font-size: .8rem;
    font-weight: 600;
    color: var(--ac-primary);
    font-family: 'SFMono-Regular', Consolas, monospace;
    text-decoration: none;
}

.record-code:hover { text-decoration: underline; color: var(--ac-primary-hover); }

/* Primary cell text */
.cell-primary { font-weight: 600; color: var(--ac-text-primary); }
.cell-secondary { font-size: .8rem; color: var(--ac-text-muted); margin-top: 2px; }

.btn-group .btn + .btn { margin-left: 4px; }

/* --------------------------------------------------------------------------
   10. STATUS BADGES
   -------------------------------------------------------------------------- */
.ac-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--ac-radius-full);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1.4;
}

.ac-badge-new       { background: var(--ac-new-bg);       color: var(--ac-new-text);       border-color: var(--ac-new-border); }
.ac-badge-contacted { background: var(--ac-contacted-bg);  color: var(--ac-contacted-text); border-color: var(--ac-contacted-border); }
.ac-badge-followup  { background: var(--ac-followup-bg);   color: var(--ac-followup-text);  border-color: var(--ac-followup-border); }
.ac-badge-converted { background: var(--ac-converted-bg);  color: var(--ac-converted-text); border-color: var(--ac-converted-border); }
.ac-badge-lost      { background: var(--ac-lost-bg);       color: var(--ac-lost-text);      border-color: var(--ac-lost-border); }
.ac-badge-pending   { background: var(--ac-pending-bg);    color: var(--ac-pending-text);   border-color: var(--ac-pending-border); }
.ac-badge-active    { background: var(--ac-active-bg);     color: var(--ac-active-text);    border-color: var(--ac-active-border); }
.ac-badge-inactive  { background: var(--ac-inactive-bg);   color: var(--ac-inactive-text);  border-color: var(--ac-inactive-border); }

/* Legacy badge shims */
.badge-new       { background: var(--ac-new-bg);       color: var(--ac-new-text);       }
.badge-contacted { background: var(--ac-contacted-bg);  color: var(--ac-contacted-text); }
.badge-followup  { background: var(--ac-followup-bg);   color: var(--ac-followup-text);  }
.badge-converted { background: var(--ac-converted-bg);  color: var(--ac-converted-text); }
.badge-lost      { background: var(--ac-lost-bg);       color: var(--ac-lost-text);      }

/* --------------------------------------------------------------------------
   11. FORMS
   -------------------------------------------------------------------------- */
.form-control {
    border-radius: var(--ac-radius-sm);
    border: 1px solid var(--ac-border);
    font-size: .875rem;
    color: var(--ac-text-primary);
    transition: border-color .15s, box-shadow .15s;
    background: var(--ac-surface);
}

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

label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--ac-text-secondary);
    margin-bottom: 6px;
}

.form-group { margin-bottom: 16px; }

.required::after,
.required-field::after { content: ' *'; color: #dc2626; }

/* Form section headings inside cards */
.section-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--ac-primary);
    border-bottom: 2px solid var(--ac-border);
    padding-bottom: 10px;
    margin-bottom: 20px;
    letter-spacing: -.01em;
}

/* --------------------------------------------------------------------------
   12. PAGINATION
   -------------------------------------------------------------------------- */
.pagination { gap: 4px; }

.page-item .page-link {
    border-radius: var(--ac-radius-sm) !important;
    border: 1px solid var(--ac-border);
    color: var(--ac-text-secondary);
    font-size: .82rem;
    padding: 6px 11px;
    min-width: 34px;
    text-align: center;
    transition: background .12s, color .12s, border-color .12s;
    background: var(--ac-surface);
}

.page-item .page-link:hover { background: var(--ac-primary-light); color: var(--ac-primary); border-color: var(--ac-primary-muted); }
.page-item.active .page-link { background: var(--ac-primary); border-color: var(--ac-primary); color: #fff; font-weight: 600; }
.page-item.disabled .page-link { opacity: .4; pointer-events: none; }

.pagination-info {
    font-size: .82rem;
    color: var(--ac-text-secondary);
}

/* --------------------------------------------------------------------------
   13. STAT CARDS (dashboard)
   -------------------------------------------------------------------------- */
.stat-card {
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-md);
    box-shadow: var(--ac-shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
    transition: box-shadow .2s, transform .2s;
}

.stat-card:hover { box-shadow: var(--ac-shadow-md); transform: translateY(-2px); }

.stat-card .stat-icon { font-size: 2.5rem; opacity: .75; margin-bottom: 8px; display: block; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; margin: 8px 0 4px; color: var(--ac-text-primary); display: block; }
.stat-card .text-muted { font-size: .82rem; color: var(--ac-text-secondary) !important; }

.quick-links {
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-md);
    box-shadow: var(--ac-shadow-sm);
    padding: 24px;
    margin-top: 20px;
}

/* --------------------------------------------------------------------------
   14. PAGE HEADER inside card (legacy .page-header)
   -------------------------------------------------------------------------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--ac-border);
}

.page-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ac-text-primary);
    margin: 0;
}

/* --------------------------------------------------------------------------
   15. INFO / DETAIL ROWS  (view pages)
   -------------------------------------------------------------------------- */
.detail-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--ac-border-light);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.detail-row:last-child { border-bottom: none; }

.detail-label,
.info-label {
    font-size: .8rem;
    font-weight: 700;
    color: var(--ac-text-secondary);
    text-transform: uppercase;
    letter-spacing: .04em;
    min-width: 160px;
    flex-shrink: 0;
}

.detail-value,
.info-value { color: var(--ac-text-primary); font-size: .875rem; }

.status-section {
    background: var(--ac-primary-light);
    border: 1px solid var(--ac-primary-muted);
    border-left: 4px solid var(--ac-primary);
    border-radius: var(--ac-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   16. TIMELINE
   -------------------------------------------------------------------------- */
.timeline {
    position: relative;
    padding-left: 28px;
    border-left: 2px solid var(--ac-border);
    margin-top: 12px;
}

.timeline-item { position: relative; padding-bottom: 20px; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -36px;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ac-surface);
    border: 2px solid var(--ac-primary);
}

.timeline-date { font-size: .78rem; color: var(--ac-text-muted); margin-bottom: 4px; }

.timeline-content {
    background: var(--ac-border-light);
    padding: 10px 14px;
    border-radius: var(--ac-radius-sm);
    border: 1px solid var(--ac-border);
    font-size: .85rem;
}

/* --------------------------------------------------------------------------
   17. MODALS
   -------------------------------------------------------------------------- */
.modal-content {
    border-radius: var(--ac-radius-md);
    border: 1px solid var(--ac-border);
    box-shadow: var(--ac-shadow-md);
    overflow: hidden;
}

.modal-header {
    background: var(--ac-surface);
    border-bottom: 1px solid var(--ac-border);
    padding: 16px 20px;
}

.modal-header .modal-title { font-size: 1rem; font-weight: 700; color: var(--ac-text-primary); }
.modal-header.bg-primary { background: var(--ac-primary) !important; }
.modal-header.bg-primary .modal-title { color: #fff; }
.modal-header.bg-primary .close { color: #fff; opacity: .8; }

.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--ac-border); background: var(--ac-border-light); }

/* --------------------------------------------------------------------------
   18. PHOTO / LOGO THUMBNAILS
   -------------------------------------------------------------------------- */
.company-logo-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--ac-radius-sm);
    border: 1px solid var(--ac-border);
}

.company-logo-large {
    max-width: 260px;
    max-height: 260px;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    padding: 8px;
    background: var(--ac-surface);
}

.logo-preview {
    max-width: 180px;
    max-height: 180px;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    padding: 4px;
    margin-top: 8px;
}

/* --------------------------------------------------------------------------
   19. MISC UTILITIES
   -------------------------------------------------------------------------- */
.nav-bar-container { margin-left: 5px !important; }

.student-selection-with-search .bootstrap-select .dropdown-toggle {
    border: 1px solid var(--ac-border);
    background-color: var(--ac-surface);
    color: var(--ac-text-primary) !important;
    border-radius: var(--ac-radius-sm);
}

/* No-data row */
.table-empty-row td {
    text-align: center;
    padding: 48px 16px;
    color: var(--ac-text-muted);
    font-size: .9rem;
}

/* Status dropdown in table */
.status-update.form-control-sm {
    font-size: .78rem;
    height: 30px;
    padding: 3px 8px;
    border-radius: var(--ac-radius-sm);
    border-color: var(--ac-border);
}

/* Conversion card */
.conversion-card { border-top: 4px solid var(--ac-converted-text); }

/* --------------------------------------------------------------------------
   20. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
    .navbar-custom { height: auto; padding: 12px 16px; }
    .header-nav-bar .nav-link { height: auto; padding: 8px 12px !important; border-bottom: none; }
    .main-container { padding: 16px; }
    .ac-page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 767px) {
    .content-card,
    .ac-card-body { padding: 16px; }
    .table thead th,
    .table tbody td { padding: 10px 12px; }
    .ac-page-header__title { font-size: 1.2rem; }
}

/* --------------------------------------------------------------------------
   21. FORM LAYOUTS  (Add / Edit pages)
   -------------------------------------------------------------------------- */

/* Form section divider */
.ac-form-section {
    font-size: .82rem;
    font-weight: 700;
    color: var(--ac-primary);
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 2px solid var(--ac-border);
    padding-bottom: 10px;
    margin: 28px 0 18px;
}

.ac-form-section:first-of-type { margin-top: 0; }

/* Class card (assigned classes in student form) */
.ac-class-card {
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    border-left: 3px solid var(--ac-converted-text);
    border-radius: var(--ac-radius);
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ac-class-card__info { flex: 1; min-width: 0; }
.ac-class-card__name { font-weight: 600; font-size: .9rem; color: var(--ac-converted-text); }
.ac-class-card__meta { font-size: .78rem; color: var(--ac-text-muted); margin-top: 2px; }

/* Parent row card */
.ac-parent-row {
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    border-left: 3px solid var(--ac-primary-muted);
    border-radius: var(--ac-radius);
    padding: 14px 16px;
    margin-bottom: 10px;
}

/* input-group theming */
.input-group-text {
    background: var(--ac-border-light);
    border-color: var(--ac-border);
    color: var(--ac-text-secondary);
    font-size: .875rem;
    border-radius: var(--ac-radius-sm) 0 0 var(--ac-radius-sm);
}

.input-group .form-control { border-radius: 0 var(--ac-radius-sm) var(--ac-radius-sm) 0; }
.input-group .form-control:focus { z-index: 3; }

/* Alert shim */
.alert { border-radius: var(--ac-radius); font-size: .875rem; }
.alert-warning { background: var(--ac-followup-bg); border-color: var(--ac-followup-border); color: var(--ac-followup-text); }
.alert-danger  { background: var(--ac-inactive-bg); border-color: var(--ac-inactive-border); color: var(--ac-inactive-text); }

/* Form footer actions */
.ac-form-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--ac-border);
    margin-top: 24px;
}

/* Add-row ghost button */
.btn-ac-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--ac-primary);
    border: 1px dashed var(--ac-primary-muted);
    border-radius: var(--ac-radius);
    padding: 7px 14px;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s, border-color .12s;
    text-decoration: none;
}

.btn-ac-ghost:hover {
    background: var(--ac-primary-light);
    border-color: var(--ac-primary);
    color: var(--ac-primary);
    text-decoration: none;
}

/* Import modal steps */
.ac-import-step h6 { font-weight: 700; font-size: .85rem; color: var(--ac-text-primary); margin-bottom: 6px; }
.ac-import-step p  { font-size: .82rem; color: var(--ac-text-secondary); }

/* --------------------------------------------------------------------------
   22. ATTENDANCE – Tab Navigation & Pagination Wrapper
   -------------------------------------------------------------------------- */
.tab-nav-btn {
    border-radius: var(--ac-radius);
    font-weight: 600;
    font-size: .875rem;
    padding: 8px 18px;
    border: 1px solid var(--ac-border);
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ac-surface);
    color: var(--ac-text-secondary);
    text-decoration: none;
}

.tab-nav-btn.active {
    background: var(--ac-primary);
    color: #fff;
    border-color: var(--ac-primary);
    box-shadow: 0 2px 8px rgba(37,99,235,.28);
}

.tab-nav-btn:not(.active):hover {
    background: var(--ac-primary-light);
    color: var(--ac-primary);
    border-color: var(--ac-primary-muted);
}

.tab-content-panel { display: none !important; }
.tab-content-panel.active { display: block !important; }

.tab-spinner { display: none; }

.badge-count {
    font-size: .7rem;
    vertical-align: middle;
    margin-left: 4px;
    background: rgba(255,255,255,.25);
    border-radius: var(--ac-radius-full);
    padding: 1px 6px;
}

.tab-nav-btn:not(.active) .badge-count {
    background: var(--ac-border-light);
    color: var(--ac-text-secondary);
}

.att-pagination-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

/* Filter active hint shown inside drawer */
.ac-filter-active-hint {
    display: none;
    font-size: .78rem;
    color: var(--ac-followup-text);
    background: var(--ac-followup-bg);
    border: 1px solid var(--ac-followup-border);
    border-radius: var(--ac-radius-sm);
    padding: 6px 10px;
    margin-bottom: 16px;
    align-items: center;
    gap: 6px;
}

.ac-filter-active-hint.visible {
    display: flex;
}
