/* ============================================================================
   Australian Guard · Staff Portal
   Design system + motion layer.
   Tailwind utilities are still used by dashboard.js templates; this file owns
   the palette, layout, components and every animation.
   ========================================================================== */

:root {
    --paper: #eef1ec;
    --paper-2: #f7f8f5;
    --card: #ffffff;
    --card-2: #fbfcf9;
    --line: rgba(15, 23, 42, 0.09);
    --line-strong: rgba(15, 23, 42, 0.16);
    --text: #101a14;
    --muted: #5d6b60;
    --faint: #93a096;
    --army: #386641;
    --army-strong: #2a4d31;
    --olive: #a7c957;
    --gold: #c9a227;
    --danger: #c0392b;
    --info: #2b6cb0;
    --sidebar-bg: linear-gradient(180deg, #0a1410 0%, #10201a 52%, #0a1410 100%);
    --sidebar-text: #dbe7dd;
    --ring: rgba(56, 102, 65, 0.32);
    --shadow-1: 0 1px 2px rgba(16, 26, 20, 0.06), 0 8px 24px -18px rgba(16, 26, 20, 0.4);
    --shadow-2: 0 24px 60px -40px rgba(16, 26, 20, 0.55);
    --radius: 18px;
    --radius-sm: 12px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --speed: 260ms;
}

.dark {
    --paper: #060b11;
    --paper-2: #0a111a;
    --card: #0e1723;
    --card-2: #111c2a;
    --line: rgba(148, 163, 184, 0.14);
    --line-strong: rgba(148, 163, 184, 0.26);
    --text: #e8eef7;
    --muted: #9aa8b8;
    --faint: #6b7a8c;
    --army: #4f8a5c;
    --army-strong: #3f6b48;
    --olive: #b7d96a;
    --gold: #e0bf63;
    --sidebar-bg: linear-gradient(180deg, #050a10 0%, #0a1520 50%, #050a10 100%);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.45), 0 12px 30px -20px rgba(0, 0, 0, 0.9);
    --shadow-2: 0 30px 70px -45px rgba(0, 0, 0, 0.95);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--paper);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color var(--speed) ease, color var(--speed) ease;
}

.hidden { display: none !important; }

* { scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ---------------------------------------------------------------- login --- */

.login-shell {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background:
        radial-gradient(900px 500px at 15% 0%, rgba(167, 201, 87, 0.16), transparent 60%),
        radial-gradient(700px 600px at 100% 100%, rgba(56, 102, 65, 0.35), transparent 55%),
        linear-gradient(160deg, #08120d 0%, #0d1a14 45%, #060d0a 100%);
    overflow: hidden;
}

.login-shell::after {
    content: '';
    position: absolute;
    inset: -30%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    transform: perspective(600px) rotateX(58deg);
    animation: gridDrift 26s linear infinite;
    pointer-events: none;
}

@keyframes gridDrift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 64px 128px, 64px 128px; }
}

.login-card {
    position: relative;
    width: min(420px, 100%);
    padding: 2.25rem 2rem 1.75rem;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(18, 32, 26, 0.92), rgba(9, 17, 13, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 40px 120px -50px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    color: #e9f1ea;
    animation: loginRise 620ms var(--ease) both;
    backdrop-filter: blur(14px);
}

@keyframes loginRise {
    from { opacity: 0; transform: translateY(26px) scale(0.975); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(150deg, rgba(167, 201, 87, 0.55), transparent 35%, transparent 65%, rgba(56, 102, 65, 0.6));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.login-logo {
    width: 74px;
    height: 74px;
    object-fit: contain;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55));
    animation: floaty 6s ease-in-out infinite;
}

@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.login-title {
    margin: 1rem 0 0.25rem;
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    text-align: center;
}

.login-sub {
    margin: 0 0 1.5rem;
    text-align: center;
    font-size: 0.68rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(167, 201, 87, 0.75);
    font-weight: 700;
}

.login-error {
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    background: rgba(192, 57, 43, 0.16);
    border: 1px solid rgba(192, 57, 43, 0.45);
    color: #ffb4aa;
    font-size: 0.7rem;
    font-weight: 700;
    animation: shake 420ms ease;
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-3px); }
    40%, 60% { transform: translateX(3px); }
}

.login-field { position: relative; }

.login-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #eef5ee;
    font-size: 0.9rem;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.login-input::placeholder { color: rgba(219, 231, 221, 0.42); }

.login-input:focus {
    outline: none;
    border-color: rgba(167, 201, 87, 0.6);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 4px rgba(167, 201, 87, 0.12);
}

.peek {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    color: rgba(219, 231, 221, 0.5);
    cursor: pointer;
    transition: color 160ms ease;
}

.peek:hover { color: var(--olive); }

.login-links {
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    display: grid;
    gap: 0.55rem;
    font-size: 0.72rem;
}

.login-links a { color: rgba(219, 231, 221, 0.66); text-decoration: none; transition: color 160ms ease; }
.login-links a:hover { color: var(--olive); }

/* ------------------------------------------------------------- app shell --- */

.app-shell {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--paper);
    animation: appFade 520ms var(--ease) both;
}

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

.app-sidebar {
    position: relative;
    width: 268px;
    flex: 0 0 268px;
    display: flex;
    flex-direction: column;
    color: var(--sidebar-text);
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 40;
    transition: transform 320ms var(--ease);
}

.app-sidebar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(420px 220px at 0% 0%, rgba(167, 201, 87, 0.12), transparent 70%);
    pointer-events: none;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.15rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #f2f7f0;
}

.brand-mark img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
}

.brand-mark span small {
    display: block;
    font-size: 0.55rem;
    letter-spacing: 0.22em;
    color: rgba(167, 201, 87, 0.8);
    font-weight: 700;
}

.bell {
    position: relative;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(219, 231, 221, 0.66);
    cursor: pointer;
    transition: transform 180ms var(--ease), background 180ms ease, color 180ms ease;
}

.bell:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.08); color: #fff; }

.notif-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff5c4d;
    box-shadow: 0 0 0 3px rgba(9, 17, 13, 0.9);
    animation: ping 1.9s ease-out infinite;
}

@keyframes ping {
    0% { box-shadow: 0 0 0 0 rgba(255, 92, 77, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(255, 92, 77, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 92, 77, 0); }
}

.nav-label {
    padding: 1.1rem 1.15rem 0.4rem;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(219, 231, 221, 0.34);
}

.app-nav {
    flex: 1;
    padding: 0 0.7rem 0.9rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: rgba(219, 231, 221, 0.72);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    transition: color 180ms ease, background 180ms ease, transform 220ms var(--ease);
}

.nav-btn i {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.75;
    transition: transform 220ms var(--ease), opacity 180ms ease;
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(3px);
}

.nav-btn:hover:not(:disabled) i { transform: scale(1.12); opacity: 1; }

.nav-btn:disabled { opacity: 0.34; cursor: not-allowed; }

.nav-btn.sidebar-active {
    background: linear-gradient(90deg, rgba(56, 102, 65, 0.95), rgba(56, 102, 65, 0.28));
    color: #fff;
    box-shadow: 0 14px 30px -20px rgba(167, 201, 87, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.nav-btn.sidebar-active i { opacity: 1; color: var(--olive); }

.nav-btn.sidebar-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 16%;
    bottom: 16%;
    width: 3px;
    border-radius: 999px;
    background: var(--olive);
    animation: navGlow 2.6s ease-in-out infinite;
}

@keyframes navGlow {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

.nav-btn.nav-cta {
    margin-top: auto;
    background: linear-gradient(120deg, rgba(43, 108, 176, 0.9), rgba(43, 108, 176, 0.55));
    color: #eaf3ff;
    box-shadow: 0 18px 36px -24px rgba(43, 108, 176, 1);
}

.nav-btn.nav-cta:hover { background: linear-gradient(120deg, #2b6cb0, #3a7dc4); }

.sidebar-foot {
    padding: 0.9rem 1rem 1.05rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: grid;
    gap: 0.5rem;
}

.sidebar-note {
    font-size: 0.58rem;
    line-height: 1.5;
    color: rgba(219, 231, 221, 0.38);
    letter-spacing: 0.02em;
    margin: 0 0 0.2rem;
}

.ghost-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(233, 241, 234, 0.86);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 170ms ease, transform 200ms var(--ease), color 170ms ease;
}

.ghost-btn:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); color: #fff; }

.ghost-btn.danger {
    border-color: rgba(192, 57, 43, 0.42);
    background: rgba(192, 57, 43, 0.14);
    color: #ffc2ba;
}

.ghost-btn.danger:hover { background: rgba(192, 57, 43, 0.28); }

/* ---------------------------------------------------------------- main --- */

.app-main {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--paper);
}

.app-main::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 460px at 100% -10%, rgba(56, 102, 65, 0.1), transparent 62%),
        radial-gradient(760px 420px at -10% 105%, rgba(167, 201, 87, 0.09), transparent 58%);
    pointer-events: none;
}

.dark .app-main::before {
    background:
        radial-gradient(900px 460px at 100% -10%, rgba(56, 102, 65, 0.22), transparent 62%),
        radial-gradient(760px 420px at -10% 105%, rgba(167, 201, 87, 0.07), transparent 58%);
}

.app-topbar {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem clamp(1rem, 2.4vw, 2rem);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--paper-2) 72%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.crumbs {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--faint);
}

.crumbs .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--olive); }

.page-title {
    margin: 0.15rem 0 0;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1.1;
}

.topbar-tools { display: flex; align-items: center; gap: 0.6rem; }

.live-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.live-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--olive);
    box-shadow: 0 0 0 0 rgba(167, 201, 87, 0.5);
    animation: ping 2.4s ease-out infinite;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.32rem 0.85rem 0.32rem 0.32rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow-1);
    transition: transform 220ms var(--ease), box-shadow 220ms ease;
}

.user-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }

.user-avatar {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--army), var(--olive));
    color: #08120d;
    font-size: 0.72rem;
    font-weight: 900;
}

.user-name { font-size: 0.72rem; font-weight: 800; line-height: 1.2; }
.user-role { font-size: 0.55rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }

.icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--muted);
    cursor: pointer;
    transition: transform 200ms var(--ease), color 170ms ease, box-shadow 200ms ease;
}

.icon-btn:hover { transform: translateY(-1px); color: var(--army); box-shadow: var(--shadow-1); }

.burger {
    display: none;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    border: 0;
    background: linear-gradient(140deg, var(--army), var(--army-strong));
    color: #fff;
    cursor: pointer;
}

.app-scroll {
    position: relative;
    z-index: 1;
    flex: 1;
    overflow-y: auto;
    padding: clamp(1rem, 2.2vw, 1.9rem);
    scroll-behavior: smooth;
}

/* ----------------------------------------------------------- components --- */

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.section-title {
    margin: 0;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    line-height: 1;
    color: var(--text);
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--army);
}

.kicker::before { content: ''; width: 18px; height: 1px; background: currentColor; opacity: 0.6; }

.section-sub { margin: 0.45rem 0 0; font-size: 0.78rem; color: var(--muted); max-width: 60ch; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 1.05rem;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
    transition: transform 200ms var(--ease), box-shadow 220ms ease, background 180ms ease, color 180ms ease;
}

.btn:active { transform: translateY(1px) scale(0.99); }

.btn-lg { padding: 0.8rem 1rem; font-size: 0.72rem; letter-spacing: 0.22em; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.58rem; }

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 45%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: skewX(-18deg);
    opacity: 0;
    transition: opacity 200ms ease;
}

.btn:hover::after { opacity: 1; animation: sweep 620ms ease; }

@keyframes sweep {
    from { left: -60%; }
    to { left: 130%; }
}

.btn-primary {
    background: linear-gradient(135deg, var(--army), var(--army-strong));
    color: #fff;
    box-shadow: 0 16px 32px -22px rgba(56, 102, 65, 1);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 22px 44px -24px rgba(56, 102, 65, 1); }

.btn-soft {
    background: var(--card);
    border-color: var(--line);
    color: var(--muted);
}

.btn-soft:hover { color: var(--text); transform: translateY(-2px); box-shadow: var(--shadow-1); }

.btn-danger { background: rgba(192, 57, 43, 0.12); border-color: rgba(192, 57, 43, 0.35); color: var(--danger); }
.btn-danger:hover { background: rgba(192, 57, 43, 0.2); transform: translateY(-2px); }

.card {
    position: relative;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(170deg, var(--card), var(--card-2));
    box-shadow: var(--shadow-1);
    transition: transform 260ms var(--ease), box-shadow 260ms ease, border-color 260ms ease;
}

.card-pad { padding: 1.25rem; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--line);
}

.card-title {
    margin: 0;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    position: relative;
    padding: 1.1rem 1.15rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(165deg, var(--card), var(--card-2));
    box-shadow: var(--shadow-1);
    overflow: hidden;
    transition: transform 260ms var(--ease), box-shadow 260ms ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--army), var(--olive));
    opacity: 0.85;
    transform: scaleX(0);
    transform-origin: left;
    animation: barIn 900ms var(--ease) forwards;
}

@keyframes barIn { to { transform: scaleX(1); } }

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

.stat-label {
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--faint);
}

.stat-value {
    margin-top: 0.35rem;
    font-size: 1.9rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.stat-foot { margin-top: 0.35rem; font-size: 0.62rem; color: var(--faint); }
.stat-danger .stat-value { color: #e05c4b; }
.stat-good .stat-value { color: var(--army); }

/* tables */
.table-shell {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; text-align: left; }

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.8rem 1.15rem;
    background: color-mix(in srgb, var(--card-2) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--faint);
    white-space: nowrap;
}

.data-row {
    border-bottom: 1px solid var(--line);
    transition: background 170ms ease, transform 170ms ease;
}

.data-row:last-child { border-bottom: 0; }
.data-row:hover { background: color-mix(in srgb, var(--army) 6%, transparent); }

.data-row td { padding: 0.9rem 1.15rem; vertical-align: middle; }

.cell-primary { font-size: 0.84rem; font-weight: 800; color: var(--text); }

.cell-sub {
    margin-top: 0.2rem;
    font-size: 0.6rem;
    letter-spacing: 0.04em;
    color: var(--faint);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.row-actions { display: flex; gap: 0.35rem; justify-content: flex-end; flex-wrap: wrap; }

.link-btn {
    padding: 0.3rem 0.55rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    color: var(--muted);
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.link-btn:hover { transform: translateY(-1px); background: var(--card-2); border-color: var(--line); color: var(--text); }
.link-btn.blue { color: var(--info); }
.link-btn.green { color: var(--army); }
.link-btn.red { color: var(--danger); }
.link-btn.gold { color: var(--gold); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card-2);
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    transition: transform 180ms var(--ease), border-color 180ms ease;
}

.badge:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.badge.green { background: rgba(56, 102, 65, 0.12); color: #2f7a45; border-color: rgba(56, 102, 65, 0.28); }
.badge.amber { background: rgba(201, 162, 39, 0.14); color: #96751a; border-color: rgba(201, 162, 39, 0.32); }
.badge.red { background: rgba(192, 57, 43, 0.12); color: #b03a2e; border-color: rgba(192, 57, 43, 0.3); }
.badge.blue { background: rgba(43, 108, 176, 0.12); color: var(--info); border-color: rgba(43, 108, 176, 0.28); }
.badge.slate { background: var(--card-2); color: var(--muted); }

.dark .badge.green { color: #93d6a2; }
.dark .badge.amber { color: #f0d188; }
.dark .badge.red { color: #f2a097; }
.dark .badge.blue { color: #9dc6ee; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: var(--text);
    cursor: pointer;
    transition: transform 180ms var(--ease), border-color 180ms ease, box-shadow 180ms ease;
}

.pill:hover { transform: translateY(-2px); border-color: var(--army); box-shadow: var(--shadow-1); }

/* task cards */
.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.task-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.1rem 1.15rem 0.95rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(170deg, var(--card), var(--card-2));
    box-shadow: var(--shadow-1);
    overflow: hidden;
    transition: transform 280ms var(--ease), box-shadow 280ms ease, border-color 280ms ease;
}

.task-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gold);
    transition: background 200ms ease;
}

.task-card.done::before { background: #3f9c58; }
.task-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }

.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }

.task-title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1.25;
}

.task-desc {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.55;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-meta { display: grid; gap: 0.3rem; font-size: 0.63rem; color: var(--faint); }
.task-meta b { color: var(--muted); font-weight: 800; }

.task-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.35rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--line);
}

/* list rows (portal activity, notifications, alts) */
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.8rem 1.1rem;
    border-bottom: 1px solid var(--line);
    transition: background 160ms ease;
}

.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: color-mix(in srgb, var(--army) 5%, transparent); }

.list-main { min-width: 0; }
.list-title { font-size: 0.76rem; font-weight: 700; color: var(--text); }
.list-sub { margin-top: 0.15rem; font-size: 0.62rem; color: var(--faint); }
.list-side { flex: 0 0 auto; font-size: 0.6rem; color: var(--faint); font-variant-numeric: tabular-nums; }

.empty-state {
    padding: 2.6rem 1.5rem;
    text-align: center;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--faint);
}

.empty-state i { display: block; margin-bottom: 0.6rem; font-size: 1.2rem; opacity: 0.55; }

/* inputs inside panels */
.field-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--faint);
}

input:focus, textarea:focus, select:focus, button:focus-visible { outline: none; }

input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), textarea, select {
    transition: border-color 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):focus, textarea:focus, select:focus {
    border-color: rgba(56, 102, 65, 0.55) !important;
    box-shadow: 0 0 0 3px var(--ring);
}

/* --------------------------------------------------------------- modals --- */

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(6, 12, 9, 0.62);
    backdrop-filter: blur(6px);
    animation: veilIn 200ms ease both;
}

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

.modal-panel {
    position: relative;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 40px 120px -60px #000;
    animation: panelIn 320ms var(--ease-spring) both;
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(10px);
}

.modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--text);
}

.modal-close {
    border: 0;
    background: transparent;
    color: var(--faint);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 160ms ease, transform 220ms var(--ease);
}

.modal-close:hover { color: var(--danger); transform: rotate(90deg); }

.modal-body { padding: 1.4rem; }

/* notifications drawer */
.notif-panel {
    position: fixed;
    top: 64px;
    left: 280px;
    width: 340px;
    max-width: calc(100vw - 2rem);
    z-index: 210;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow-2);
    overflow: hidden;
    animation: panelIn 240ms var(--ease) both;
}

.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ------------------------------------------------------------ animations --- */

.section-content { display: block; }

.section-popup { animation: sectionIn 420ms var(--ease) both; }

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

.reveal {
    opacity: 0;
    animation: revealUp 480ms var(--ease) forwards;
    animation-delay: calc(var(--i, 0) * 42ms);
}

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

.skeleton {
    position: relative;
    overflow: hidden;
    background: color-mix(in srgb, var(--line) 60%, transparent);
    border-radius: 0.75rem;
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    animation: shimmer 1.4s infinite;
}

.dark .skeleton::after { background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.16), transparent); }

@keyframes shimmer { 100% { transform: translateX(100%); } }

/* click ripple */
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: rgba(255, 255, 255, 0.42);
    pointer-events: none;
    animation: rippleOut 560ms ease-out forwards;
}

.dark .ripple { background: rgba(255, 255, 255, 0.24); }

@keyframes rippleOut {
    to { transform: scale(2.6); opacity: 0; }
}

.form-page-card { border-top: 6px solid var(--army); transition: border-color 200ms ease; }

.header-img-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 10rem;
    border-radius: 12px;
    background: var(--card-2);
    border: 1px dashed var(--line-strong);
    color: var(--faint);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.preserve-whitespace { white-space: pre-wrap; }

/* --------------------------------------------------------------- layout --- */

@media (min-width: 768px) {
    #sidebar { transform: translateX(0) !important; }
    .burger { display: none; }
}

@media (max-width: 767px) {
    .app-sidebar { position: fixed; inset: 0 auto 0 0; height: 100%; box-shadow: 0 0 80px rgba(0, 0, 0, 0.5); }
    .burger { display: grid; }
    .notif-panel { left: 1rem; right: 1rem; width: auto; }
    .user-chip { display: none; }
    .data-table thead { display: none; }
    .data-row { display: grid; gap: 0.35rem; padding: 0.9rem 1rem; }
    .data-row td { padding: 0; }
    .row-actions { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; }
}

/* Brand wordmark — the full organisation name replaces the old "AG" mark. */
.brand-mark span {
    display: block;
    max-width: 8.8rem;
    font-size: 0.68rem;
    line-height: 1.25;
    letter-spacing: 0.1em;
}

/* Platform panels share the existing card system; these only tighten spacing. */
#roblox-result .badge,
#discord-result .badge,
#link-result .badge {
    letter-spacing: 0.04em;
}

#roblox-result .field-label,
#discord-result .field-label,
#link-result .field-label {
    margin-bottom: 0.35rem;
}

/* ------------------------------------------------------------ guild picker --- */
.guild-picker { position: relative; }

.guild-picker-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease;
}

.guild-picker-btn:hover { border-color: var(--muted); }

.guild-picker-icon { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; }
.guild-picker-caret { margin-left: auto; font-size: 10px; color: var(--faint); }

.guild-picker-menu {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    margin-top: 6px;
    max-height: 280px;
    overflow: auto;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
}

.guild-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: .85rem;
    text-align: left;
    cursor: pointer;
}

.guild-option:hover,
.guild-option.active { background: var(--card-2); }

.guild-option-icon { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; flex: none; }

.guild-option-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--card-2);
    color: var(--faint);
    font-size: 10px;
}

.role-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 9999px;
    vertical-align: middle;
}

/* Keyboard focus for the guild pickers. The global button:focus-visible rule
   clears outlines, so restore a visible ring for the picker control and its
   options. */
.guild-picker-btn:focus-visible,
.guild-picker.kb-focus .guild-picker-btn,
.guild-option:focus-visible {
    outline: 2px solid var(--army);
    outline-offset: 2px;
}

/* ------------------------------------------------------- role checklists --- */
.role-checklist { position: relative; }

.role-checklist-btn {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    font-size: 0.75rem;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease;
}

.role-checklist-btn:hover { border-color: var(--muted); }

.role-checklist-menu {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    margin-top: 6px;
    max-height: 240px;
    overflow: auto;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
}

.role-checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.78rem;
    cursor: pointer;
}

.role-checklist-item:hover { background: var(--card-2); }
.role-checklist-item input { width: 12px; height: 12px; flex: none; accent-color: var(--army); }
.role-checklist-item .role-dot { margin-right: 0; }
.role-dot-empty { background: transparent; border: 1px solid var(--muted); }

.role-checklist-btn:focus-visible,
.role-checklist-item:focus-within {
    outline: 2px solid var(--army);
    outline-offset: 2px;
}
