/*
  Script India AMS - unified theme
  Loaded AFTER admin-assets/css/style.css. This file overrides the visual
  language (color, type, spacing, shadows) of that base theme while leaving
  its structural/behavioural rules (sidebar collapse, offcanvas, grid) intact.
*/

:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-light: #eff4ff;
    --success: #059669;
    --success-light: #ecfdf5;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --info: #0891b2;
    --info-light: #ecfeff;

    --surface: #ffffff;
    --bg: #f7f8fa;
    --text: #101828;
    --text-muted: #667085;
    --border: #e4e7ec;

    --sidebar-bg: #1a2234;
    --sidebar-bg-hover: #252f45;
    --sidebar-text: #b3bdcd;
    --sidebar-text-active: #ffffff;
    --sidebar-accent: #3b82f6;
    --sidebar-divider: rgba(255, 255, 255, .07);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 1px 3px rgba(16, 24, 40, .1), 0 1px 2px rgba(16, 24, 40, .06);
    --shadow-lg: 0 20px 40px rgba(16, 24, 40, .18);
}

/* ---------- Base ---------- */
html, body {
    background: var(--bg) !important;
    color: var(--text);
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 600; }

::selection { background: var(--brand-light); color: var(--brand-dark); }

/* ---------- Top navbar ---------- */
.navbar.default-layout-navbar {
    background: var(--surface) !important;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border);
}

.navbar .navbar-brand-wrapper {
    background: var(--surface) !important;
}

.navbar .navbar-menu-wrapper {
    background: transparent !important;
    color: var(--text) !important;
}

.navbar .navbar-toggler .mdi { color: var(--text-muted) !important; }

/* Profile button - matched to the base theme's specificity so it wins */
.navbar .navbar-menu-wrapper .navbar-nav .nav-item .nav-link.count-indicator,
.navbar .nav-link.count-indicator {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    padding: 0 !important;
    margin: 0 0 0 .5rem !important;
    border-radius: 50% !important;
    background: var(--brand-light) !important;
    background-image: none !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    align-self: center;
    border: 1px solid var(--border);
}
.navbar .navbar-menu-wrapper .navbar-nav .nav-item .nav-link.count-indicator:hover {
    background: var(--brand) !important;
}
.navbar .navbar-menu-wrapper .navbar-nav .nav-item .nav-link.count-indicator i,
.navbar .nav-link.count-indicator .fa,
.navbar .nav-link.count-indicator i {
    color: var(--brand) !important;
    font-size: 15px !important;
    margin: 0 !important;
}
.navbar .navbar-menu-wrapper .navbar-nav .nav-item .nav-link.count-indicator:hover i {
    color: #fff !important;
}
/* The base theme adds a notification dot via ::after */
.navbar .nav-link.count-indicator::after { display: none !important; }

.navbar-nav-right b.text-dark {
    color: var(--text) !important;
    font-weight: 600 !important;
    font-size: .875rem;
    margin-right: .25rem;
    align-self: center;
}

.navbar .navbar-menu-wrapper .navbar-nav.navbar-nav-right {
    align-items: center;
}

.preview-item .preview-icon.bg-logout {
    background: var(--danger-light) !important;
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.preview-item .preview-icon.bg-logout i { color: var(--danger) !important; }
.preview-subject { color: var(--text) !important; font-weight: 500; }

/* ---------- Sidebar ----------
   The base theme paints .sidebar .nav a separate #222, gives every
   .nav-item a 1px #555 bottom border and a 5px left border, and pads each
   nav-link by 1.125rem vertically. All of that is neutralised here so the
   rail reads as one flat surface with compact rows.
*/
.sidebar {
    background: var(--sidebar-bg) !important;
    border-right: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.sidebar .nav {
    background: transparent !important;
    margin-bottom: 0 !important;
    padding: .75rem .625rem 2.5rem !important;
}

.sidebar .nav .nav-item {
    padding: 0 !important;
    border-bottom: none !important;
    border-left: none !important;
    border-top: none !important;
}

.sidebar .nav .nav-item .nav-link {
    position: relative;
    padding: .625rem .8rem !important;
    margin: 1px 0;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text) !important;
    height: auto !important;
    transition: background .15s ease, color .15s ease;
}

.sidebar .nav .nav-item .nav-link:hover {
    background: var(--sidebar-bg-hover) !important;
    color: var(--sidebar-text-active) !important;
}

/* Active item: subtle tint plus a blue accent bar, rather than a solid fill */
.sidebar .nav .nav-item.active > .nav-link {
    background: var(--sidebar-bg-hover) !important;
    color: var(--sidebar-text-active) !important;
}
.sidebar .nav .nav-item.active > .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--sidebar-accent);
}
.sidebar .nav .nav-item.active > .nav-link .menu-title { font-weight: 600; }
.sidebar .nav .nav-item.active > .nav-link i.menu-icon {
    color: var(--sidebar-accent) !important;
    opacity: 1;
}

.sidebar .nav .nav-item .nav-link .menu-title {
    color: inherit !important;
    font-weight: 500;
    font-size: .8438rem;
    line-height: 1.3;
}

/* Font Awesome glyphs.
   The base theme styles `i.menu-icon` with `margin-left: auto` (intended for
   an icon-on-the-right layout) and a hard-coded colour. That selector carries
   one more element than a plain `.menu-icon` one, so it must be matched
   exactly here - otherwise every row right-aligns and the icons turn purple.
*/
.sidebar .nav .nav-item .nav-link i.menu-icon {
    margin-left: 0 !important;
    margin-right: .7rem !important;
    width: 18px;
    min-width: 18px;
    height: auto !important;
    font-size: .9rem;
    line-height: 1;
    text-align: center;
    color: inherit !important;
    opacity: .72;
    filter: none;
    transition: opacity .15s ease, color .15s ease;
}
.sidebar .nav .nav-item .nav-link:hover i.menu-icon { opacity: 1; }

.sidebar .nav .nav-item .nav-link .menu-arrow {
    color: inherit;
    opacity: .6;
    margin-left: auto;
}

/* Collapsible sub-menus */
.sidebar .nav .nav-item .collapse,
.sidebar .nav .nav-item .collapsing { background: transparent !important; }

.sidebar .nav.sub-menu {
    padding: .125rem 0 .25rem !important;
    margin-bottom: 0 !important;
    background: transparent !important;
}

/* Indent guide line down the left of a sub-menu group */
.sidebar .nav.sub-menu {
    position: relative;
}
.sidebar .nav.sub-menu::before {
    content: '';
    position: absolute;
    left: 1.35rem;
    top: .25rem;
    bottom: .35rem;
    width: 1px;
    background: var(--sidebar-divider);
}

.sidebar .nav.sub-menu .nav-item .nav-link {
    color: var(--sidebar-text) !important;
    font-size: .8125rem;
    padding: .42rem .75rem .42rem 2.05rem !important;
    position: relative;
}
.sidebar .nav.sub-menu .nav-item .nav-link:hover {
    background: var(--sidebar-bg-hover) !important;
    color: var(--sidebar-text-active) !important;
}
.sidebar .nav.sub-menu .nav-item.active > .nav-link {
    background: var(--sidebar-bg-hover) !important;
    color: var(--sidebar-text-active) !important;
    font-weight: 600;
}
/* Children use the guide line, so suppress the parent's accent bar */
.sidebar .nav.sub-menu .nav-item.active > .nav-link::before { display: none; }

.sidebar .nav.sub-menu .nav-item .nav-link i.menu-icon {
    width: 15px;
    min-width: 15px;
    font-size: .78rem;
    margin-left: 0 !important;
    margin-right: .55rem !important;
    opacity: .6;
}
.sidebar .nav.sub-menu .nav-item.active > .nav-link i.menu-icon {
    color: var(--sidebar-accent) !important;
    opacity: 1;
}

/* Collapsed rail: the base theme zeroes the icon margins to centre the glyph,
   but without !important - so the !important margins above would otherwise
   win and push it off-centre. */
.sidebar-icon-only .sidebar { background: var(--sidebar-bg) !important; }
.sidebar-icon-only .sidebar .nav .nav-item .nav-link i.menu-icon {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: auto;
    min-width: 0;
    font-size: 1rem;
}
.sidebar-icon-only .sidebar .nav .nav-item .nav-link { padding: .7rem .5rem !important; }

/* ---------- Page shell ---------- */
.content-wrapper {
    background: var(--bg) !important;
    padding: 1.75rem 1.75rem 2.5rem !important;
}

.page-body-wrapper { background: var(--bg); }

.footer {
    background: var(--surface) !important;
    color: var(--text-muted) !important;
    font-size: .78rem;
    border-top: 1px solid var(--border);
    padding: .9rem 1.75rem !important;
    margin: 0 !important;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    align-items: center;
    justify-content: center;
}
.footer a { color: var(--brand); font-weight: 600; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ---------- Card shell used by every master/detail page ---------- */
.content-box {
    background: var(--surface) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 1.5rem !important;
}

.main-title-box {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 1rem 1.4rem !important;
    border-radius: 0 !important;
    text-align: left !important;
}

.main-title-box h1 {
    color: var(--text) !important;
    text-transform: none !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    letter-spacing: -.005em !important;
    text-align: left !important;
    margin: 0 !important;
}

.content-inner {
    background: var(--surface) !important;
    padding: 1.4rem !important;
}

/* ---------- Page header ---------- */
.ams-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.ams-page-eyebrow {
    display: block;
    font-size: .69rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--brand);
    margin-bottom: .3rem;
}
.ams-page-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--text);
    margin: 0;
}
.ams-page-sub {
    font-size: .8125rem;
    color: var(--text-muted);
    margin: .25rem 0 0;
}

/* Legacy banner class - kept so any view still using it stays readable */
.company-title {
    background: var(--surface) !important;
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius) !important;
    padding: .9rem 1.15rem !important;
    margin-bottom: 1.5rem !important;
    box-shadow: var(--shadow-sm);
}
.company-title h5 {
    color: var(--text) !important;
    font-size: .9rem !important;
    font-weight: 600;
    text-align: left !important;
    margin: 0 !important;
}

/* ---------- Forms ---------- */
.form-group label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: .4rem;
}

.form-control,
select.form-control {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    padding: .55rem .8rem !important;
    font-size: .9rem !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    box-shadow: none !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control:focus, select.form-control:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px var(--brand-light) !important;
}

.form-control[readonly] { background: var(--bg) !important; color: var(--text-muted) !important; }

span.text-danger, span.field-validation-valid, span.field-validation-error {
    font-size: .78rem;
    display: inline-block;
    margin-top: .25rem;
}

/* ---------- Buttons ---------- */
.btn-default, .btn-theme-red, .btn-delete, .btn-update,
.btn.theme-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: .6rem 1.25rem !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    font-size: .875rem !important;
    border: none !important;
    box-shadow: var(--shadow-sm);
    transition: transform .1s ease, box-shadow .15s ease, background .15s ease;
}
.btn-default:hover, .btn-theme-red:hover, .btn-delete:hover, .btn-update:hover, .btn.theme-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-default, .btn.theme-btn {
    background: var(--brand) !important;
    color: #fff !important;
}
.btn-default:hover, .btn.theme-btn:hover { background: var(--brand-dark) !important; }

.btn-update {
    background: var(--warning) !important;
    color: #fff !important;
}
.btn-update:hover { background: #b45309 !important; }

.btn-theme-red {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none;
}
.btn-theme-red:hover { background: var(--bg) !important; }

.btn-delete {
    background: var(--danger) !important;
    color: #fff !important;
}
.btn-delete:hover { background: #b91c1c !important; }

.btn.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.btn-success { background: var(--success); border-color: var(--success); }

/* ---------- Tables / DataTables ---------- */
.table {
    color: var(--text);
}
.table thead th {
    background: var(--bg) !important;
    color: var(--text-muted) !important;
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .4px;
    font-weight: 700;
    border-bottom: 1px solid var(--border) !important;
    white-space: nowrap;
}
.table td {
    vertical-align: middle;
    font-size: .875rem;
    border-color: var(--border);
}
.table tbody tr:nth-child(even) {
    background-color: var(--bg) !important;
}
.table tbody tr:hover {
    background-color: var(--brand-light) !important;
}

.text-white.bg-theme-dark { background: transparent !important; }

.ams-table-toolbar { margin-bottom: .85rem; }
.ams-table-footer { margin-top: .85rem; }

/* Scope line above a table, e.g. the company the rows belong to */
.ams-table-caption {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin: 0 0 1rem;
}

.ams-upper { text-transform: uppercase; }

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .4rem .7rem;
    font-size: .875rem;
    background: var(--surface);
    color: var(--text);
}
.dataTables_wrapper .dataTables_filter input {
    min-width: 220px;
    margin-left: 0;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-light);
}
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info {
    color: var(--text-muted);
    font-size: .8125rem;
    padding: .75rem 0;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--radius-sm) !important;
    margin-left: 2px;
    border: 1px solid transparent !important;
    color: var(--text) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--brand) !important;
    color: #fff !important;
    border-color: var(--brand) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--brand-light) !important;
    color: var(--brand-dark) !important;
}

/* ---------- Alerts ---------- */
.alert-danger {
    background: var(--danger-light) !important;
    color: #991b1b !important;
    border: 1px solid #fecaca !important;
    border-radius: var(--radius) !important;
}
.alert-success {
    background: var(--success-light) !important;
    color: #166534 !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: var(--radius) !important;
}

/* ---------- Stat cards (dashboard) ---------- */
.stat-card {
    position: relative;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow .15s ease, transform .1s ease;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

/* Thin colour accent along the top edge */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--stat-accent, var(--brand));
}

.stat-card .card-body { padding: 1.35rem 1.4rem; }

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.02em;
    color: var(--text);
}
.stat-card .stat-label {
    font-size: .7rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: .3rem;
    text-transform: uppercase;
    letter-spacing: .07em;
}
.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: var(--stat-tint, var(--brand-light));
    color: var(--stat-accent, var(--brand));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex: 0 0 auto;
}

.stat-card.stat-primary { --stat-accent: var(--brand);   --stat-tint: var(--brand-light); }
.stat-card.stat-info    { --stat-accent: var(--info);    --stat-tint: var(--info-light); }
.stat-card.stat-success { --stat-accent: var(--success); --stat-tint: var(--success-light); }
.stat-card.stat-warning { --stat-accent: var(--warning); --stat-tint: var(--warning-light); }

/* ---------- Read-only key/value summary panel ---------- */
.ams-summary {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.ams-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--border);
    font-size: .875rem;
}
.ams-summary-row:last-child { border-bottom: none; }
.ams-summary-row:nth-child(odd) { background: var(--bg); }
.ams-summary-label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    align-self: center;
}
.ams-summary-value { font-weight: 600; text-align: right; word-break: break-word; }

/* ---------- Face capture ---------- */
.ams-capture-pose {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--brand);
    margin-bottom: .85rem;
}
.ams-capture-frame {
    position: relative;
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 500 / 380;
    max-width: 520px;
    margin: 0 auto;
}
.ams-capture-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ams-capture .progress { max-width: 520px; margin-left: auto; margin-right: auto; }

/* ---------- Filter bar (report toolbars) ---------- */
.ams-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}
.ams-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .85rem;
    margin: 0;
}
.ams-filter-form .form-group { margin: 0; min-width: 160px; }

/* ---------- Status legend ---------- */
.ams-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem 1.1rem;
    padding: 0 .25rem 1rem;
}
.ams-legend-item {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 500;
}
.ams-legend-count {
    margin-left: auto;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}
.ams-swatch {
    width: 11px;
    height: 11px;
    border-radius: 3px;
    display: inline-block;
    background: var(--st-bg, var(--bg));
    border: 1px solid var(--st-bd, var(--border));
}

/* Shared status palette, used by swatches, grid cells and summary chips */
.is-present            { --st-bg: #e7f6ee; --st-bd: #a9dfc2; --st-fg: #10693f; }
.is-absent             { --st-bg: #fdecec; --st-bd: #f5b9b9; --st-fg: #a02020; }
.is-weekoff            { --st-bg: #eef0f3; --st-bd: #d3d8e0; --st-fg: #5b6472; }
.is-weekoff-present    { --st-bg: #e8f4fb; --st-bd: #aed7ef; --st-fg: #15607f; }
.is-holiday            { --st-bg: #efeafc; --st-bd: #cbbdf3; --st-fg: #4c2f9e; }
.is-halfday            { --st-bg: #fdf3e0; --st-bd: #f2cf94; --st-fg: #8a5406; }
.is-leave              { --st-bg: #fdf6e0; --st-bd: #efd992; --st-fg: #7d5f05; }
.is-ot                 { --st-bg: #e8f1fd; --st-bd: #b3cdf5; --st-fg: #17458f; }
.is-other              { --st-bg: #f2f4f7; --st-bd: #dfe3e9; --st-fg: #475467; }

/* ---------- Employee report card ---------- */
.ams-emp-card { margin-bottom: 1.1rem !important; }

.ams-emp-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.ams-emp-code {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--brand);
    background: var(--brand-light);
    border-radius: 4px;
    padding: .15rem .45rem;
    margin-bottom: .35rem;
}
.ams-emp-name {
    font-size: .975rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: -.005em;
    margin: 0;
    color: var(--text);
}
.ams-emp-meta {
    margin: .2rem 0 0;
    font-size: .78rem;
    color: var(--text-muted);
}
.ams-emp-meta span + span::before {
    content: '·';
    margin: 0 .4rem;
    opacity: .6;
}

/* Summary chips (P / AB / WO / …) */
.ams-emp-stats { display: flex; flex-wrap: wrap; gap: .35rem; }
.ams-stat-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 42px;
    padding: .3rem .4rem;
    border-radius: var(--radius-sm);
    background: var(--st-bg, var(--bg));
    border: 1px solid var(--st-bd, var(--border));
    line-height: 1.15;
}
.ams-stat-chip b {
    font-size: .875rem;
    font-weight: 700;
    color: var(--st-fg, var(--text));
}
.ams-stat-chip small {
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--st-fg, var(--text-muted));
    opacity: .8;
}

/* ---------- Day matrix ----------
   31 day columns scroll horizontally while the metric label column stays
   pinned to the left edge.
*/
.ams-daygrid-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.ams-daygrid {
    border-collapse: separate;
    border-spacing: 0;
    width: auto;
    min-width: 100%;
    margin: 0;
    font-variant-numeric: tabular-nums;
}
.ams-daygrid th,
.ams-daygrid td {
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: .4rem .5rem;
    font-size: .75rem;
    text-align: center;
    white-space: nowrap;
    min-width: 54px;
    color: var(--text);
    background: var(--surface);
}
.ams-daygrid tbody tr:last-child th,
.ams-daygrid tbody tr:last-child td { border-bottom: none; }

.ams-daygrid thead th {
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 700;
    font-size: .7rem;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* Pinned label column */
.ams-daygrid .ams-daygrid-label {
    position: sticky;
    left: 0;
    z-index: 3;
    text-align: left;
    min-width: 96px;
    background: var(--surface);
    font-weight: 600;
    font-size: .72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    box-shadow: 1px 0 0 var(--border);
}
.ams-daygrid thead .ams-daygrid-label {
    z-index: 4;
    background: var(--bg);
}

/* Status cells carry the shared palette */
.ams-daygrid td.ams-status {
    font-weight: 700;
    font-size: .7rem;
    color: var(--st-fg, var(--text-muted));
    background: var(--st-bg, var(--surface));
}

/* Off-screen but rendered, so the Excel exporter can still read it */
.ams-export-source {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Dashboard quick links ---------- */
.ams-quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .85rem;
}
.ams-quick-link {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .9rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.ams-quick-link:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
    color: var(--text);
    text-decoration: none;
}
.ams-quick-link strong { display: block; font-size: .875rem; font-weight: 600; }
.ams-quick-link small { display: block; font-size: .75rem; color: var(--text-muted); margin-top: .1rem; }
.ams-quick-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--brand-light);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* ---------- Login page ---------- */
body.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-bg) !important;
    padding: 2rem 1rem;
}
.auth-shell { width: 100%; max-width: 410px; }

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2.25rem;
    border-top: 3px solid var(--brand);
}

.auth-card .logoimg { text-align: center; margin-bottom: 1.5rem; }
.auth-card .logoimg img { width: 170px; max-width: 100%; }

.auth-heading { text-align: center; margin-bottom: 1.75rem; }
.auth-heading h1 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 .3rem;
    color: var(--text);
}
.auth-heading p {
    font-size: .8125rem;
    color: var(--text-muted);
    margin: 0;
}

.auth-card .form-group { margin-bottom: 1.15rem; }
.auth-card .form-group label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: .4rem;
    display: block;
}

/* Input with a leading icon (and optional trailing toggle) */
.auth-field { position: relative; }
.auth-field .auth-field-icon {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: .875rem;
    pointer-events: none;
}
.auth-field .form-control {
    padding-left: 2.4rem !important;
    padding-right: 2.4rem !important;
    height: auto;
}
.auth-field .auth-field-toggle {
    position: absolute;
    right: .4rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    padding: .35rem .5rem;
    cursor: pointer;
    line-height: 1;
}
.auth-field .auth-field-toggle:hover { color: var(--brand); }

.auth-card .theme-btn { width: 100%; margin-top: .35rem; padding: .7rem 1.25rem !important; }
.auth-card .alert { font-size: .8125rem; padding: .65rem .85rem; margin-bottom: 1rem; }

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(255,255,255,.6);
    font-size: .78rem;
}
.auth-footer a { color: rgba(255,255,255,.9); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { color: #fff; text-decoration: underline; }

/* ---------- Form footer: Back on the left, primary action on the right ---------- */
.ams-form-footer {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
}
.ams-form-footer > :only-child { margin-left: auto; }

/* Section heading inside a form (e.g. "Present Address") */
.ams-fieldset-title {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    padding-bottom: .5rem;
    margin: .5rem 0 1rem;
    border-bottom: 1px solid var(--border);
}

/* Inline radio group that reads as one control */
.ams-radio-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding-top: .35rem;
}
.ams-radio-group label {
    margin: 0 0 0 .35rem;
    font-size: .875rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    cursor: pointer;
}
.ams-radio-group input[type="radio"] { cursor: pointer; }

.ams-field-hint {
    font-size: .72rem;
    color: var(--text-muted);
    margin: .25rem 0 0;
}
.ams-field-hint.is-ok { color: var(--success); font-weight: 600; }
.ams-field-hint.is-error { color: var(--danger); font-weight: 600; }

/* Narrow, centred column for focused single-purpose forms */
.ams-narrow { max-width: 520px; margin: 0 auto; }

/* Large muted glyph for empty / error / welcome states */
.ams-empty-icon {
    width: 64px;
    height: 64px;
    margin: .5rem auto 1.25rem;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

/* Readable prose blocks (privacy, help text) */
.ams-prose { font-size: .9rem; line-height: 1.65; max-width: 68ch; }

/* User rights tree (UserEdit) */
.ams-rights-item { margin-bottom: .5rem; }
.ams-rights-item > label { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text); }
.ams-rights-item .plants { margin-left: 1.5rem; }
.ams-rights-plant {
    display: block;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    font-size: .8125rem;
}

/* ---------- Page action bar (Add New / Export row above a table) ---------- */
.ams-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 1rem;
}
.ams-actions .ams-actions-left { margin-right: auto; }

/* Head Type filter pills (Salary Head Master: All / Earning / Deduction) */
.ams-head-filter { display: flex; flex-wrap: wrap; gap: .5rem; }
.ams-head-filter-btn {
    padding: .5rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: .8125rem;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.ams-head-filter-btn:hover { background: var(--bg); }
.ams-head-filter-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* Buttons rendered inside table cells need to stay compact */
.table td .btn-default,
.table td .btn-theme-red,
.table td .btn-delete,
.table td .btn-update {
    padding: .3rem .7rem !important;
    font-size: .78rem !important;
    box-shadow: none;
}
.table td .btn-default:hover,
.table td .btn-theme-red:hover,
.table td .btn-delete:hover,
.table td .btn-update:hover { transform: none; }

button.is-busy { opacity: .6; cursor: progress; }

/* ---------- Misc ---------- */
.card { border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.card-header.bg-primary { background: var(--brand) !important; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.badge { border-radius: 999px; font-weight: 600; }
.progress { border-radius: 999px; height: 10px; background: var(--bg); }
.progress-bar { background-color: var(--brand); }

@media (max-width: 991px) {
    .content-wrapper { padding: 1.25rem !important; }
}
