

:root {
    --brand:      #003F44;
    --brand-700:  #0A4F54;
    --brand-600:  #15666C;
    --accent:     #00C46F;   
    --accent-700: #00A85F;
    --accent-bright:#00ED85;
    --accent-tint:#EAF7F0;

    --bg:        #F5F7F6;
    --surface:   #FFFFFF;
    --surface-2: #FAFBFB;
    --line:      #E3E7E6;
    --line-2:    #CFD6D5;
    --ink:       #0E1A19;
    --muted:     #5E6E6C;
    --muted-2:   #8A9897;

    --success:   #137A3E;
    --success-bg:#E7F4EC;
    --warning:   #B45309;
    --warning-bg:#FBF0E0;
    --danger:    #C0392B;
    --danger-bg: #FBEBE9;
    --info:      #0B6E86;
    --info-bg:   #E5F2F6;

    --radius:    4px;
    --radius-sm: 3px;
    --ring:      0 0 0 3px rgba(0,63,68,.16);

    --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --sidebar-w: 248px;
    --shadow:    0 10px 30px rgba(14,26,25,.12);

    
    --border:     var(--line);
    --border-2:   var(--line-2);
    --accent-600: var(--accent-700);
    --accent-soft:var(--accent-tint);
    --radius-lg:  6px;
    --shadow-sm:  none;
    --shadow-lg:  var(--shadow);
    --brand-900:  #00282C;
    --brand-800:  #00343A;
    --brand-500:  var(--brand-600);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; line-height: 1.18; letter-spacing: -.012em; color: var(--ink); }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; display: block; }
p { margin: 0 0 1rem; }
hr { border: none; border-top: 1px solid var(--line); margin: 1.25rem 0; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 24px; }
.stack > * + * { margin-top: var(--gap, 1rem); }
.grid { display: grid; gap: 18px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: .5rem; } .gap { gap: 1rem; } .gap-lg { gap: 1.5rem; }
.wrap { flex-wrap: wrap; }
.text-muted { color: var(--muted); }
.text-sm { font-size: .86rem; }
.text-xs { font-size: .76rem; }
.text-center { text-align: center; }
.mt-0{margin-top:0}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-0{margin-bottom:0}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}
.w-full{width:100%}.nowrap{white-space:nowrap}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hide { display: none !important; }

.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); }

.btn {
    --btn-bg: var(--brand); --btn-fg: #fff; --btn-bd: var(--brand);
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .6rem 1.05rem; border-radius: var(--radius-sm);
    background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
    font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
    white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn svg { width: 17px; height: 17px; }

.btn-accent { --btn-bg: var(--accent); --btn-bd: var(--accent); --btn-fg: #04231A; }
.btn-accent:hover { background: var(--accent-700); border-color: var(--accent-700); color: #04231A; }
.btn-outline { --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: var(--line-2); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--line-2); color: var(--ink); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--muted); --btn-bd: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.05); color: var(--ink); border-color: transparent; }
.btn-danger { --btn-bg: var(--danger); --btn-bd: var(--danger); }
.btn-danger:hover { background: #a5291c; border-color: #a5291c; }
.btn-light { --btn-bg:#fff; --btn-fg: var(--brand); --btn-bd: var(--line-2); }
.btn-sm { padding: .42rem .7rem; font-size: .82rem; }
.btn-lg { padding: .78rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: 34px; height: 34px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 22px; }
.card-head {
    padding: 14px 20px; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.card-head h3 { margin: 0; font-size: .95rem; font-weight: 700; display: flex; align-items: center; }
.card-head h3 svg { width: 18px; height: 18px; color: var(--muted); }
.card-body { padding: 20px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.stat { position: relative; padding: 18px 20px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat__icon { display: none; }                 
.stat__value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.stat__label { color: var(--muted); font-size: .8rem; margin-top: 8px; }
.stat::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; background: var(--line-2); }
.stat:nth-child(1)::before { background: var(--brand); }
.stat:nth-child(2)::before { background: var(--accent); }
.stat:nth-child(3)::before { background: var(--warning); }
.stat:nth-child(4)::before { background: var(--info); }
.stat:nth-child(5)::before { background: var(--brand-600); }

.badge {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .22rem .5rem; border-radius: var(--radius-sm); font-size: .74rem; font-weight: 700;
    line-height: 1.2; border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-present { background: var(--success-bg); color: var(--success); }
.badge-absent  { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.badge-role    { background: var(--accent-tint); color: var(--accent-700); }
.badge-admin   { background: #E8EEF1; color: var(--brand); }
.badge-on      { background: var(--success-bg); color: var(--success); }
.badge-off     { background: var(--danger-bg); color: var(--danger); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: 11px 16px; text-align: left; vertical-align: middle; }
table.data thead th {
    background: var(--surface-2); color: var(--muted);
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
    border-bottom: 1px solid var(--line);
}
table.data tbody tr { border-bottom: 1px solid var(--line); }
table.data tbody tr:last-child { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .actions { display: flex; gap: .3rem; justify-content: flex-end; }

.avatar {
    width: 34px; height: 34px; border-radius: var(--radius-sm); flex: none;
    display: grid; place-items: center; font-weight: 700; font-size: .78rem;
    background: var(--brand); color: #fff;
}
.cell-user { display: flex; align-items: center; gap: .65rem; }
.cell-user small { color: var(--muted); }

.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label.lbl { display: block; font-weight: 600; font-size: .84rem; margin-bottom: .35rem; color: var(--ink); }
label .opt { color: var(--muted-2); font-weight: 500; }
.input, .select, textarea.input {
    width: 100%; padding: .6rem .75rem; font: inherit; font-size: .92rem;
    color: var(--ink); background: var(--surface);
    border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--brand-600); box-shadow: var(--ring); }
.input.is-invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .8rem; margin-top: .3rem; display: flex; align-items: center; gap: .3rem; }
.field-error svg { width: 14px; height: 14px; }
textarea.input { resize: vertical; min-height: 92px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted-2); }
.input-icon .input, .input-icon .select { padding-left: 2.3rem; }
.help { color: var(--muted); font-size: .82rem; margin-top: .35rem; }

.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 40px; height: 22px; border-radius: 3px; background: var(--line-2); position: relative; transition: background .12s ease; }
.switch .track::after { content:""; position:absolute; top:3px; left:3px; width:16px; height:16px; border-radius:2px; background:#fff; transition: transform .12s ease; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }

.alert {
    display: flex; gap: .6rem; align-items: flex-start;
    padding: .75rem .9rem; border-radius: var(--radius-sm);
    border: 1px solid transparent; border-left-width: 3px;
    font-size: .9rem; margin-bottom: 1rem;
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-success { background: var(--success-bg); color: #0E5A2E; border-color: var(--success); }
.alert-danger  { background: var(--danger-bg); color: #8A241A; border-color: var(--danger); }
.alert-info    { background: var(--info-bg); color: #0A4F60; border-color: var(--info); }
.alert-warning { background: var(--warning-bg); color: #7A3B07; border-color: var(--warning); }

.divider { height: 1px; background: var(--line); margin: 1.2rem 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.page-head .sub { color: var(--muted); margin: .25rem 0 0; font-size: .9rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty svg { width: 46px; height: 46px; color: var(--line-2); margin-bottom: 1rem; }
.kbd { font-family: ui-monospace, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; padding: .1rem .4rem; font-size: .8rem; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 90; padding: .8rem 1.1rem; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 600; color: #fff; background: var(--ink); opacity: 0; transition: opacity .2s ease, transform .2s ease; max-width: 90vw; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--danger { background: var(--danger); }
.toast--success { background: var(--success); }
.toast--info { background: var(--brand); }

@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
    .page-head h1 { font-size: 1.3rem; }
    .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .stat { border-right: none; border-bottom: 1px solid var(--line); }
}
