/* =========================================================
   402nd RRIBn Personnel Management System - Stylesheet
   Refreshed visual pass — same green/gold identity, more
   modern spacing, depth and motion. Class names unchanged.
   ========================================================= */

:root {
    /* Core palette — deep field green + brass insignia accent */
    --primary: #1e3f2e;
    --primary-dark: #0c1c13;
    --primary-mid: #2c5940;
    --primary-light: #3f7256;
    --accent: #9c7a35;
    --accent-light: #c9a24d;
    --accent-dark: #7c5f28;

    --success: #2e7d32;
    --danger: #b3261e;
    --warning: #a8720d;
    --info: #1565c0;
    --secondary: #5b6b63;

    --bg: #eef1ec;
    --card-bg: #ffffff;
    --border: #dde4dd;
    --text: #000000;
    --text-muted: #333333;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-xs: 0 1px 2px rgba(13, 32, 22, 0.06);
    --shadow-sm: 0 2px 6px rgba(13, 32, 22, 0.07), 0 1px 2px rgba(13, 32, 22, 0.05);
    --shadow: 0 12px 28px rgba(13, 32, 22, 0.10), 0 2px 8px rgba(13, 32, 22, 0.06);
    --shadow-lg: 0 24px 60px rgba(10, 22, 15, 0.20);

    --font-display: 'Arial', var(--font-body);
    --font-body: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif;

    --sidebar-width: 264px;
    --ease: cubic-bezier(.22, .8, .32, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* Slim, unobtrusive scrollbars (WebKit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(13, 32, 22, 0.18); border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(13, 32, 22, 0.3); background-clip: content-box; }
.sidebar-nav::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); background-clip: content-box; }

/* ---------------- Login ---------------- */
.login-body {
    background:
        radial-gradient(circle at 15% 10%, rgba(156,122,53,0.16), transparent 45%),
        radial-gradient(circle at 85% 90%, rgba(63,114,86,0.22), transparent 50%),
        linear-gradient(160deg, rgba(12,28,19,0.97), rgba(30,63,46,0.95)),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 14px);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-wrapper { width: 100%; padding: 20px; }
.login-card {
    max-width: 420px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 42px 40px;
    box-shadow: var(--shadow-lg);
    border-top: 4px solid var(--accent);
    position: relative;
    animation: loginRise .5s var(--ease) both;
}
@keyframes loginRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.login-header { text-align: center; margin-bottom: 26px; }
.login-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}
.login-logo {
    width: 70px;
    height: 70px;
    max-width: 70px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 6px 16px rgba(0,0,0,0.28), 0 0 0 3px rgba(156,122,53,0.25);
    flex-shrink: 0;
    transition: transform .25s var(--ease);
}
.login-logo:hover { transform: translateY(-2px) scale(1.03); }
.login-header h1 {
    margin: 0;
    color: var(--primary-dark);
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 600;
    letter-spacing: .3px;
    line-height: 1.25;
    text-transform: uppercase;
}
.login-header h2 { margin: 8px 0 2px; font-size: 15px; color: var(--accent-dark); font-weight: 600; letter-spacing: .2px; }
.login-header p { margin: 0; font-size: 13px; color: var(--text-muted); }
.login-footnote { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 20px; }

/* ---------------- App Shell ---------------- */
.app-shell { display: flex; min-height: 100vh; }

.mobile-topbar { display: none; }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,22,15,0.6);
    backdrop-filter: blur(2px);
    z-index: 40;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(185deg, var(--primary-dark) 0%, #10251a 55%, #0a1810 100%);
    color: #e6ece8;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    /* Stays fixed in place while the page content scrolls, instead of
       scrolling away with it. align-self:flex-start stops the flex
       parent from stretching it past 100vh. */
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: flex-start;
    overflow-y: auto;
    box-shadow: 2px 0 18px rgba(0,0,0,0.18);
}
.sidebar-brand {
    padding: 22px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.09);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    background: rgba(255,255,255,0.02);
}
.sidebar-brand-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.sidebar-brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(201,162,77,0.35), 0 4px 10px rgba(0,0,0,0.3);
}
.sidebar-brand-text { display: flex; flex-direction: column; align-items: center; }
.sidebar-brand h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: .3px;
    line-height: 1.3;
    color: #fff;
    text-transform: uppercase;
}
.sidebar-brand span { font-size: 11px; color: var(--accent-light); text-transform: uppercase; letter-spacing: .6px; line-height: 1.3; margin-top: 3px; }

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #c3d0c8;
    padding: 10px 12px;
    font-size: 14.5px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    white-space: nowrap;
    transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.sidebar-nav a svg { flex-shrink: 0; opacity: .8; transition: opacity .15s var(--ease); }
.sidebar-nav a:hover { background: rgba(255,255,255,0.07); color: #fff; text-decoration: none; transform: translateX(1px); }
.sidebar-nav a:hover svg { opacity: 1; }
.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(201,162,77,0.16), rgba(201,162,77,0.03));
    border-left: 3px solid var(--accent-light);
    color: #fff;
    font-weight: 600;
}
.sidebar-nav a.active svg { opacity: 1; color: var(--accent-light); }
.nav-badge {
    margin-left: auto;
    background: var(--danger, #d64545);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 20px;
    min-width: 16px;
    text-align: center;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.06);
}

.sidebar-footer { padding: 16px 20px 20px; border-top: 1px solid rgba(255,255,255,0.09); background: rgba(0,0,0,0.12); }
.user-chip { display: flex; flex-direction: column; margin-bottom: 12px; }
.user-chip strong { font-size: 14px; color: #fff; font-weight: 600; }
.user-chip span { font-size: 11.5px; color: var(--accent-light); text-transform: uppercase; letter-spacing: .4px; margin-top: 1px; }
.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    padding: 9px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    transition: background .15s var(--ease), border-color .15s var(--ease);
}
.btn-logout:hover { background: var(--danger); border-color: var(--danger); text-decoration: none; }

.main-content { flex: 1; min-width: 0; padding: 32px 40px 48px; }

/* ---------------- Headers ---------------- */
.page-header { margin-bottom: 26px; }
.page-header h1 {
    margin: 0 0 5px 0;
    color: var(--primary-dark);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 27px;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.page-header p { margin: 0; color: var(--text-muted); font-size: 15px; }

/* ---------------- Cards & Grids ---------------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    transition: box-shadow .2s var(--ease);
}
.card h3 {
    margin-top: 0;
    color: var(--primary-dark);
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: .2px;
    font-size: 18px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 11px;
    text-transform: uppercase;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    min-width: 0;
}

/* Dashboard reports stacked one per row (full width) instead of side by
   side, so each chart gets the whole card width to lay its bars out. */
.dashboard-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}
.bar-chart-panel-spaced {
    margin-top: 20px;
}

.text-muted { color: var(--text-muted); font-size: 14px; }

/* ---------------- Bar Charts (dependency-free, modern style) ---------------- */
.chart-card h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.chart-total-badge {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(30, 63, 46, 0.08);
    border-radius: 999px;
    padding: 3px 12px;
    white-space: nowrap;
    letter-spacing: .2px;
}
.chart-total-badge.accent {
    color: var(--accent-dark);
    background: rgba(156, 122, 53, 0.14);
}

.bar-chart-panel {
    position: relative;
    padding: 18px 6px 0;
    background:
        repeating-linear-gradient(
            to top,
            var(--border) 0,
            var(--border) 1px,
            transparent 1px,
            transparent 25%
        );
    background-size: 100% 170px;
    background-position: 0 0;
    background-repeat: no-repeat;
    border-radius: var(--radius-sm);
}
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    height: 240px;
    padding: 0 6px;
    overflow-x: auto;
    overflow-y: visible;
}
.bar-chart-col {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    min-width: 30px;
    flex: 1 0 auto;
}
.bar-chart-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
}
.bar-chart-track {
    width: 24px;
    height: 170px;
    display: flex;
    align-items: flex-end;
    overflow: visible;
}
.bar-chart-bar {
    width: 100%;
    min-height: 3px;
    background: linear-gradient(180deg, var(--primary-light), var(--primary) 85%);
    border-radius: 6px 6px 2px 2px;
    box-shadow: 0 3px 8px rgba(30, 63, 46, 0.25);
    transform-origin: bottom;
    animation: barGrow .7s cubic-bezier(.34,1.15,.64,1) both;
    transition: filter .15s ease, box-shadow .15s ease;
}
.bar-chart-col:hover .bar-chart-bar {
    filter: brightness(1.12);
    box-shadow: 0 4px 12px rgba(30, 63, 46, 0.35);
}
.bar-chart-bar-accent {
    background: linear-gradient(180deg, var(--accent-light), var(--accent) 85%);
    box-shadow: 0 3px 8px rgba(156, 122, 53, 0.28);
}
.bar-chart-col:hover .bar-chart-bar-accent {
    box-shadow: 0 4px 12px rgba(156, 122, 53, 0.4);
}
/* Stagger each bar's grow-in animation left to right for a livelier load. */
.bar-chart-col:nth-child(1)  .bar-chart-bar { animation-delay: .00s; }
.bar-chart-col:nth-child(2)  .bar-chart-bar { animation-delay: .03s; }
.bar-chart-col:nth-child(3)  .bar-chart-bar { animation-delay: .06s; }
.bar-chart-col:nth-child(4)  .bar-chart-bar { animation-delay: .09s; }
.bar-chart-col:nth-child(5)  .bar-chart-bar { animation-delay: .12s; }
.bar-chart-col:nth-child(6)  .bar-chart-bar { animation-delay: .15s; }
.bar-chart-col:nth-child(7)  .bar-chart-bar { animation-delay: .18s; }
.bar-chart-col:nth-child(8)  .bar-chart-bar { animation-delay: .21s; }
.bar-chart-col:nth-child(9)  .bar-chart-bar { animation-delay: .24s; }
.bar-chart-col:nth-child(10) .bar-chart-bar { animation-delay: .27s; }
.bar-chart-col:nth-child(11) .bar-chart-bar { animation-delay: .30s; }
.bar-chart-col:nth-child(12) .bar-chart-bar { animation-delay: .33s; }
.bar-chart-col:nth-child(13) .bar-chart-bar { animation-delay: .36s; }
.bar-chart-col:nth-child(14) .bar-chart-bar { animation-delay: .39s; }
.bar-chart-col:nth-child(15) .bar-chart-bar { animation-delay: .42s; }
@keyframes barGrow {
    from { transform: scaleY(0); }
    to   { transform: scaleY(1); }
}
.bar-chart-label {
    margin-top: 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    transform: rotate(-40deg);
    transform-origin: top center;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bar-chart-col:hover .bar-chart-label {
    color: var(--primary-dark);
    font-weight: 700;
}
/* Used for company-name labels so they sit upright instead of slanted;
   wraps onto a couple of lines instead of being clipped with an ellipsis. */
.bar-chart-label-straight {
    transform: none;
    white-space: normal;
    max-width: 90px;
    line-height: 1.25;
    overflow: visible;
    text-overflow: clip;
}
.bar-chart-col-wide {
    min-width: 90px;
}
/* Bar columns that link out (e.g. Dashboard "Personnel by Gender" -> filtered
   Personnel Records list) need to shed the default <a> underline/color and
   show a pointer so they still read as chart bars, not text links. */
.bar-chart-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.bar-chart-link:hover {
    text-decoration: none;
}
@media (prefers-reduced-motion: reduce) {
    .bar-chart-bar { animation: none; }
}

/* Recently Updated Records sits on its own full-width row above
   .dashboard-grid so its columns (Name, Rank, Last Updated) always
   have room to breathe instead of being squeezed into a 1/3-width card. */
.card-full {
    width: 100%;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    min-width: 0;
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    position: relative;
    overflow: hidden;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--primary-light), var(--primary));
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card.stat-success::before { background: linear-gradient(180deg, #4c9950, var(--success)); }
.stat-card.stat-info::before { background: linear-gradient(180deg, #4386d6, var(--info)); }
.stat-card.stat-warning::before { background: linear-gradient(180deg, var(--accent-light), var(--warning)); }
.stat-card.stat-muted::before { background: linear-gradient(180deg, #9aa3ab, var(--secondary)); }
/* Dashboard stat cards that link to a filtered Personnel Records list */
a.stat-link { text-decoration: none; color: inherit; cursor: pointer; }
a.stat-link:hover { text-decoration: none; }
a.stat-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 600; color: var(--primary-dark); line-height: 1.15; }
.stat-label { font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-top: 3px; font-weight: 600; }

/* ---------------- Tables ---------------- */
/* .table-responsive wraps every table at runtime (see script.js) so wide
   tables scroll horizontally inside their own card instead of stretching
   the page layout and causing it to overflow ("lagpas-lagpas"). */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
}

.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.data-table th, .data-table td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table th {
    color: var(--primary-dark);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .6px;
    font-weight: 700;
    background: rgba(30, 63, 46, 0.045);
    position: sticky;
    top: 0;
}
.data-table tbody tr { transition: background .12s ease; }
.data-table tr:hover { background: #f5f8f5; }
.data-table tbody tr:last-child td { border-bottom: none; }

.detail-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.detail-table th { text-align: left; padding: 9px 12px 9px 0; width: 38%; color: var(--text-muted); font-weight: 600; vertical-align: top; white-space: nowrap; }
.detail-table td { padding: 9px 0; }

.action-links a { margin-right: 10px; font-size: 14px; font-weight: 600; }
.action-links form.inline-form { display: inline; margin: 0; }
.btn-link-danger {
    background: none;
    border: none;
    padding: 0;
    margin-right: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #b3261e;
    cursor: pointer;
    text-decoration: none;
}
.btn-link-danger:hover { text-decoration: underline; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 16px; display: flex; flex-direction: column; }
.form-group label { font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--text); text-transform: uppercase; letter-spacing: .3px; }
.form-group input, .form-group select, .form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    width: 100%;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.form-group textarea { min-height: 70px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(63,114,86,0.15);
}
.form-group input:hover, .form-group select:hover, .form-group textarea:hover { border-color: #b9c6bd; }

.form-grid { display: block; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 4px; }
.form-group-full { grid-column: 1 / -1; }
.form-section-title {
    margin: 26px 0 14px 0;
    color: var(--primary);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 16.5px;
    text-transform: uppercase;
    letter-spacing: .3px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 9px;
}
.form-section-title:first-child { margin-top: 0; }
.form-actions { margin-top: 26px; display: flex; gap: 10px; flex-wrap: wrap; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filter-bar input, .filter-bar select { padding: 10px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 15px; background: #fff; transition: border-color .15s var(--ease); }
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(63,114,86,0.15); }

.inline-form { display: inline-flex; gap: 6px; align-items: center; }

/* ---------------- Searchable personnel picker ---------------- */
.personnel-search-wrap { position: relative; max-width: 420px; }
.personnel-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.personnel-search-input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(63,114,86,0.15); }
.personnel-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 20;
}
.personnel-search-item { padding: 10px 12px; font-size: 15px; cursor: pointer; transition: background .1s ease; }
.personnel-search-item:hover, .personnel-search-item.active { background: #f0f4f0; }
.personnel-search-empty { padding: 10px 12px; font-size: 15px; color: var(--text-muted); }

/* ---------------- 2x2 ID Picture ---------------- */
.photo-2x2-row { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 20px; }
.photo-2x2-frame {
    width: 130px;
    height: 130px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f9f7;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 6px;
}
.photo-2x2-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-2x2-controls { display: flex; flex-direction: column; gap: 6px; max-width: 320px; }
.photo-2x2-controls label { font-size: 14px; font-weight: 600; color: var(--text); }
.photo-2x2-controls input[type="file"] {
    padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px;
}
.photo-2x2-hint { font-size: 13px; color: var(--text-muted); margin: 0; }

.photo-thumb {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f9f7;
    color: var(--text-muted);
    font-size: 13px;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .4px;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s var(--ease), box-shadow .15s var(--ease), filter .15s var(--ease);
    box-shadow: var(--shadow-xs);
}
.btn:hover { filter: brightness(1.06); text-decoration: none; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0); filter: brightness(0.97); }
.btn-block { display: flex; width: 100%; justify-content: center; text-align: center; }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-xs { padding: 3px 8px; font-size: 11.5px; gap: 3px; border-radius: 4px; }
.btn-primary { background: linear-gradient(155deg, var(--primary-light), var(--primary) 75%); color: #fff; }
.btn-secondary { background: #e3e8e3; color: var(--text); }
.btn-secondary:hover { background: #d7ded7; }
.btn-success { background: linear-gradient(155deg, #3f9a45, var(--success) 75%); color: #fff; }
.btn-danger { background: linear-gradient(155deg, #d1483e, var(--danger) 75%); color: #fff; }

.tab-actions { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }

/* ---------------- Badges & Alerts ---------------- */
.badge { display: inline-block; padding: 4px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: .4px; }
.badge-success { background: var(--success); }
.badge-danger { background: var(--danger); }
.badge-warning { background: var(--warning); }
.badge-info { background: var(--info); }
.badge-secondary { background: var(--secondary); }

.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 15px;
    border-left-width: 4px;
    border-left-style: solid;
    box-shadow: var(--shadow-xs);
}
.alert-error { background: #fbeae8; color: var(--danger); border: 1px solid #f0c4be; border-left-color: var(--danger); }
.alert-success { background: #e7f3e8; color: var(--success); border: 1px solid #b9dfb9; border-left-color: var(--success); }
.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    color: inherit;
    opacity: .6;
    padding: 0 2px;
}
.alert-close:hover { opacity: 1; }
.alert-info { background: #e8f0fb; color: var(--info); border: 1px solid #bcd4f0; border-left-color: var(--info); }

/* ---------------- QR Code ---------------- */
.qr-card { text-align: center; }
.qr-box {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px auto;
}
.qr-box-large { margin: 20px auto; }
.qr-hint { font-size: 14px; color: var(--text-muted, #667); margin: 6px 0; }
.qr-print-card {
    max-width: 420px;
    margin: 0 auto;
    text-align: center;
    padding: 32px 24px;
}
.qr-print-card h2 { margin-bottom: 4px; }

/* ---------------- Public QR scan landing page (qr_view.php) ---------------- */
.login-card-wide { max-width: 480px; }
.qr-public-photo {
    width: 120px;
    height: 120px;
    margin: 0 auto 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 13px;
}
.qr-public-photo img { width: 100%; height: 100%; object-fit: cover; }
.qr-public-name { font-size: 23px !important; letter-spacing: .3px; }
.qr-public-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 16px;
    margin: 4px 0 22px;
}
.qr-public-info-grid div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.qr-public-info-grid span {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
}
.qr-public-info-grid strong {
    font-size: 15px;
    color: var(--text);
    font-weight: 600;
}
.qr-public-edit-btn { margin-top: 10px; }

/* Disabled inputs on the personnel self-edit form should still read clearly */
.form-group input:disabled, .form-group select:disabled {
    background: #f3f4f6;
    color: #1a1a1a;
    cursor: not-allowed;
}

/* ---------------- Print ---------------- */
@media print {
    .sidebar, .mobile-topbar, .tab-actions, .filter-bar, .form-actions, .no-print { display: none !important; }
    .main-content { padding: 0; }
    .table-responsive { overflow-x: visible; }
    .qr-print-card { border: none; box-shadow: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
    .app-shell { min-height: 100vh; }

    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        background: linear-gradient(120deg, var(--primary-dark), #10251a);
        color: #fff;
        padding: 14px 16px;
        position: sticky;
        top: 0;
        z-index: 30;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }
    .mobile-topbar strong { font-family: var(--font-display); font-size: 15.5px; letter-spacing: .3px; text-transform: uppercase; }
    .mobile-topbar-logo { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
    .menu-toggle {
        background: rgba(255,255,255,0.1);
        border: none;
        color: #fff;
        width: 36px;
        height: 36px;
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
        transition: background .15s ease;
    }
    .menu-toggle:hover { background: rgba(255,255,255,0.18); }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform .25s var(--ease);
        box-shadow: 0 0 40px rgba(0,0,0,0.3);
    }
    .app-shell.nav-open .sidebar { transform: translateX(0); }
    .app-shell.nav-open .sidebar-backdrop { display: block; }

    .main-content { padding: 20px; }
}

@media (max-width: 520px) {
    .main-content { padding: 16px; }
    .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .login-card { padding: 26px 20px; }
    .card { padding: 16px; }
    .login-logo-row { gap: 10px; margin-bottom: 10px; }
    .login-logo { width: 56px; height: 56px; max-width: 56px; }
    .login-header { margin-bottom: 16px; }
    .login-header h1 { font-size: 17px; }
    .login-header h2 { font-size: 13px; }
    .photo-2x2-row { gap: 12px; }
    .photo-2x2-frame { width: 84px; height: 84px; font-size: 11px; }
    .photo-2x2-controls { max-width: 100%; }
}

/* --- Add Personnel: optional login-account section --- */
.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}
.checkbox-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8825rem;
    line-height: 1.45;
    color: var(--text-muted);
}
/* =========================================================
   Personnel Profile — header card + tabbed view layout
   ========================================================= */

.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    background: linear-gradient(135deg, var(--card-bg), #fbfcfa 60%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px 26px;
    margin-bottom: 22px;
    border-top: 3px solid var(--accent);
    flex-wrap: wrap;
}

.profile-photo {
    width: 110px;
    height: 110px;
    min-width: 110px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    box-shadow: 0 4px 14px rgba(13,32,22,0.15);
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }

.profile-identity { flex: 1; min-width: 240px; }
.profile-identity h1 {
    font-family: var(--font-display);
    font-size: 23px;
    margin: 0 0 4px;
    color: var(--primary-dark);
    text-transform: uppercase;
}
.profile-subline { margin: 0 0 2px; font-size: 14px; color: var(--text-muted); }
.profile-unit { margin: 0 0 10px; font-size: 15px; color: var(--text); font-weight: 600; }

.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

.contact-row { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--text-muted); }

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 170px;
}

.profile-body {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.profile-tabs {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 220px;
    flex: 0 0 220px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 8px;
    position: sticky;
    top: 20px;
}

.profile-tab {
    text-align: left;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    font-family: var(--font-body);
    transition: background .15s ease, color .15s ease;
}
.profile-tab:hover { background: var(--bg); }
.profile-tab.active { background: linear-gradient(120deg, var(--primary), var(--primary-mid)); color: #fff; }

.profile-panels {
    flex: 1;
    min-width: 320px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
}

.profile-panel { display: none; }
.profile-panel.active { display: block; animation: panelFade .2s ease; }
@keyframes panelFade { from { opacity: 0; } to { opacity: 1; } }
.profile-panel h3 {
    font-family: var(--font-display);
    margin: 0 0 16px;
    color: var(--primary-dark);
    text-transform: uppercase;
    font-size: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 18px;
}

.field-box { display: flex; flex-direction: column; gap: 4px; }
.field-box-wide { grid-column: 1 / -1; }
.field-box-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}
.field-box-value {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    padding: 9px 11px;
    font-size: 15px;
    color: var(--text);
    min-height: 20px;
}
.field-box-empty { color: var(--text-muted); }

@media (max-width: 720px) {
    .profile-header { flex-direction: column; align-items: center; text-align: center; }
    .contact-row { justify-content: center; }
    .profile-body { flex-direction: column; }
    .profile-tabs { width: 100%; flex-direction: row; overflow-x: auto; position: static; }
}

/* =========================================================
   Mobile layout fixes
   - The top bar was being laid out as a flex column BESIDE the page
     content (app-shell is a row), so it ate half the screen. On small
     screens the shell now stacks: top bar on top, content below.
   - Compact spacing/type so pages are less cramped on phones.
   - Documents table turns into one card per document on phones.
   ========================================================= */
@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .mobile-topbar { width: 100%; box-sizing: border-box; flex-shrink: 0; }
    .main-content { width: 100%; box-sizing: border-box; }
    .page-header { margin-bottom: 16px; }
    .page-header h1 { font-size: 23px; }
    .page-header p { font-size: 14px; }
}

@media (max-width: 640px) {
    .main-content { padding: 12px; }
    .card { padding: 14px; margin-bottom: 16px; }
    .card h3 { font-size: 16px; padding-bottom: 8px; }
    .data-table { font-size: 14px; }

    /* Documents: one card per document instead of a wide, cut-off table */
    .doc-table, .doc-table tbody, .doc-table tr, .doc-table td { display: block; width: 100%; box-sizing: border-box; }
    .doc-table thead { display: none; }
    .doc-table tr {
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 10px 12px;
        margin-bottom: 12px;
        background: #fff;
    }
    .doc-table tr:hover { background: #fff; }
    .doc-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 6px 0;
        border: none;
        white-space: normal;
        text-align: right;
    }
    .doc-table td::before {
        content: attr(data-label);
        flex-shrink: 0;
        text-align: left;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .4px;
        color: var(--text-muted);
    }
    .doc-table td.doc-name {
        display: block;
        text-align: left;
        font-weight: 600;
        font-size: 15px;
        padding: 0 0 8px 0;
        margin-bottom: 4px;
        border-bottom: 1px solid var(--border);
    }
    .doc-table td.doc-name::before { display: none; }
    .doc-table td.doc-upload,
    .doc-table td.doc-action { flex-direction: column; align-items: stretch; text-align: left; }
    .doc-table td.doc-upload::before,
    .doc-table td.doc-action::before { margin-bottom: 4px; }
    .doc-table .inline-form { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
    .doc-table input[type="file"] { flex: 1 1 100%; max-width: 100%; font-size: 13px; }
    .doc-table .btn { flex: 1 1 auto; }
}

/* =========================================================
   Login reCAPTCHA + inactivity (auto logout) warning
   ========================================================= */
.recaptcha-wrap { display: flex; justify-content: center; margin: 4px 0 14px; }
@media (max-width: 380px) {
    /* the reCAPTCHA checkbox is 304px wide; shrink it on very narrow phones */
    .recaptcha-wrap .g-recaptcha { transform: scale(.85); transform-origin: center top; }
}

.idle-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10,22,15,0.65);
    backdrop-filter: blur(2px);
}
.idle-modal {
    width: 100%;
    max-width: 380px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    border-top: 3px solid var(--accent);
    animation: loginRise .25s var(--ease);
}
.idle-modal h3 { margin: 0 0 8px; color: var(--primary-dark); font-family: var(--font-display); font-size: 19px; text-transform: uppercase; }
.idle-modal p { margin: 0 0 16px; font-size: 15px; color: var(--text); }
.idle-modal .idle-count { font-weight: 700; color: var(--danger); }
.idle-modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* =========================================================
   Generic modal (announcement edit form + delete warning box)
   ========================================================= */
.app-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10,22,15,0.65);
    backdrop-filter: blur(2px);
}
.app-modal-backdrop.active { display: flex; }
.app-modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    animation: loginRise .25s var(--ease);
}
.app-modal h3 { margin: 0 0 4px; color: var(--primary-dark); font-family: var(--font-display); font-size: 19px; text-transform: uppercase; }
.app-modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }

.app-modal-confirm { max-width: 380px; text-align: center; }
.app-modal-confirm .app-modal-warning-icon {
    width: 46px; height: 46px; line-height: 46px; margin: 0 auto 10px;
    border-radius: 50%; background: #fbeae9; color: var(--danger);
    font-size: 25px; font-weight: 700;
}
.app-modal-confirm p { margin: 0 0 4px; font-size: 15px; color: var(--text); }
.app-modal-confirm .app-modal-subtext { font-size: 14px; color: var(--text-muted); }
.app-modal-confirm .app-modal-actions { justify-content: center; }


/* Personnel Records: summary of the filters applied (e.g. coming from the Dashboard) */
.filter-summary { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 14px; font-size:13.5px; }
.filter-chip { background:#eef3ef; border:1px solid var(--border); border-radius:999px; padding:3px 12px; font-weight:600; color:var(--primary-dark); }

/* Personnel list on Document Tracking / RMPF: upload progress mini-bar */
.mini-progress { width: 110px; height: 5px; background: #e4e8e5; border-radius: 999px; margin-top: 5px; overflow: hidden; }
.mini-progress-bar { height: 100%; border-radius: 999px; }
.mini-progress-success { background: var(--success); }
.mini-progress-warning { background: var(--warning); }
.mini-progress-danger { background: var(--danger, #b3261e); }

/* ---- Per-section editing ---- */
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    margin: 0 0 16px;
    padding-bottom: 8px;
}
.profile-panel .panel-head h3 { margin: 0; padding: 0; border-bottom: none; }

.edit-section-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.edit-section-nav a {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}
.edit-section-nav a:hover { background: var(--bg); }
.edit-section-nav a.active {
    background: linear-gradient(120deg, var(--primary), var(--primary-mid));
    color: #fff;
    border-color: transparent;
}

/* =========================================================
   Success popup (centered, animated check mark)
   ========================================================= */
.sx-overlay {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(8, 22, 15, .55);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    animation: sxFade .22s ease both;
}
.sx-overlay.sx-out { animation: sxFadeOut .22s ease both; }
.sx-card {
    position: relative; overflow: hidden;
    width: 100%; max-width: 290px;
    background: #fff; border-radius: 18px;
    padding: 26px 22px 22px; text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.4) inset;
    animation: sxPop .5s cubic-bezier(.2,1.3,.4,1) both;
}
.sx-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
    background: linear-gradient(90deg, var(--primary-light), var(--success), var(--accent-light));
}
.sx-icon { position: relative; width: 66px; height: 66px; margin: 0 auto 12px; }
.sx-ring {
    position: absolute; inset: 0; border-radius: 50%;
    background: rgba(46, 125, 50, .18);
    animation: sxRing 1.1s ease-out .35s both;
}
.sx-check {
    position: relative; width: 66px; height: 66px; display: block;
    border-radius: 50%;
    background: linear-gradient(145deg, #43a047, var(--success));
    box-shadow: 0 6px 14px rgba(46,125,50,.4);
    animation: sxScale .45s cubic-bezier(.2,1.4,.4,1) .1s both;
}
.sx-check-circle { stroke: rgba(255,255,255,.35); stroke-width: 2; stroke-dasharray: 145; stroke-dashoffset: 145; animation: sxDraw .6s ease .15s forwards; }
.sx-check-mark { stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: sxDraw .4s ease .5s forwards; }
.sx-sparks { position: absolute; inset: 0; pointer-events: none; }
.sx-sparks i {
    position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px;
    border-radius: 50%; background: var(--accent-light); opacity: 0;
    animation: sxSpark .8s ease-out .55s both;
}
.sx-sparks i:nth-child(even) { background: var(--primary-light); width: 5px; height: 5px; margin: -2.5px; }
.sx-title { margin: 0 0 6px; font-family: 'Oswald', sans-serif; font-size: 20px; letter-spacing: .5px; color: var(--primary); animation: sxUp .4s ease .45s both; }
.sx-msg { margin: 0 0 16px; font-size: 13.5px; line-height: 1.45; color: var(--text-muted); animation: sxUp .4s ease .55s both; }
.sx-btn {
    min-width: 96px; padding: 8px 24px; border: 0; border-radius: 999px; cursor: pointer;
    font-size: 13.5px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 6px 14px rgba(30,63,46,.3);
    transition: transform .15s ease, box-shadow .15s ease;
    animation: sxUp .4s ease .65s both;
}
.sx-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 18px rgba(30,63,46,.35); }
.sx-btn:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }
.sx-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #e7f3e8; }
.sx-progress span { display: block; height: 100%; background: var(--success); transform-origin: left; animation: sxBar linear forwards; }

@keyframes sxFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sxFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes sxPop { from { opacity: 0; transform: scale(.7) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes sxScale { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes sxDraw { to { stroke-dashoffset: 0; } }
@keyframes sxRing { from { transform: scale(.8); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
@keyframes sxSpark { 0% { opacity: 1; transform: rotate(var(--a)) translateY(-30px) scale(.4); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-48px) scale(1); } }
@keyframes sxUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sxBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
    .sx-overlay, .sx-card, .sx-check, .sx-ring, .sx-sparks i, .sx-title, .sx-msg, .sx-btn { animation-duration: .01s !important; animation-delay: 0s !important; }
    .sx-check-circle, .sx-check-mark { stroke-dashoffset: 0; animation: none; }
}


/* ---------------- Personnel Records table: fit the card, no sideways overflow ---------------- */
.personnel-table { table-layout: auto; font-size: 14px; }
.personnel-table th, .personnel-table td { padding: 10px 8px; white-space: normal; vertical-align: middle; word-break: break-word; }
.personnel-table th { font-size: 11px; letter-spacing: .4px; }
.personnel-table th:first-child, .personnel-table td:first-child { width: 58px; padding-left: 10px; }
.personnel-table td:nth-child(2) { white-space: nowrap; word-break: normal; }          /* AFPSN */
.personnel-table td:nth-child(4) { white-space: nowrap; }                              /* Rank */
.personnel-table td:nth-child(6), .personnel-table td:nth-child(7) { white-space: nowrap; } /* badges */
.personnel-table .badge { padding: 3px 9px; font-size: 11px; }
.personnel-table .photo-thumb { width: 40px; height: 40px; }
.personnel-table td.action-links { display: table-cell; min-width: 150px; }
.personnel-table td.action-links a, .personnel-table td.action-links .btn-link-danger { display: inline-block; margin: 2px 10px 2px 0; }
.personnel-table td.action-links form.inline-form { display: inline-block; }
