/* EIO Admin — design system */

/* ── Tokens ── */
:root {
    --black:   #050505;
    --soft:    #0d0d0d;
    --surface: #111111;
    --panel:   #151515;
    --card:    #111111;
    --line:    #2b2b2b;
    --red:     #d60000;
    --green:   #12a56b;
    --ink:     #f5f5f5;
    --muted:   #a7a7a7;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    background: var(--black);
    color: var(--ink);
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
p { line-height: 1.5; margin-bottom: 12px; }

/* ── Typography ── */
h1 { font-size: clamp(22px, 3vw, 32px); font-weight: 900; letter-spacing: -.04em; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
h2 { font-size: 18px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 0; }

/* ── Buttons ── */
button, .btn, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 15px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    transition: opacity .15s;
    text-decoration: none;
    white-space: nowrap;
}
button:hover:not(:disabled), .btn:hover:not(:disabled) { opacity: .85; }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }

.btn.dark, button.dark   { background: #fff; color: #111; }
.btn.ghost, button.ghost { background: transparent; color: var(--ink); border: 1px solid #3a3a3a; }
.btn.danger              { background: rgba(214,0,0,.12); color: #f87171; border: 1px solid rgba(214,0,0,.25); }
.btn.sm, button.sm       { padding: 5px 11px; font-size: 12px; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; }

/* ── Cards ── */
.card, .panel, .admin-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 18px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}
.card-header h2 { margin: 0; }

/* ── Form section headings ── */
.form-section-title {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin: 22px 0 12px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.form-section-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* ── Labels ── */
label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 900;
    color: #b0b0b0;
    margin-bottom: 5px;
}

/* ── Inputs ── */
input, select, textarea, .form-control {
    width: 100%;
    padding: 8px 11px;
    background: var(--black);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}
input:focus, select:focus, textarea:focus, .form-control:focus { border-color: #555; }
textarea, .form-control textarea { min-height: 90px; resize: vertical; }

/* ── Field spacing ── */
.mb-3 { margin-bottom: 14px; }

/* ── 2-col and 3-col field rows ── */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
.field-row .mb-3 { margin-bottom: 0; }

.field-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
.field-row-3 .mb-3 { margin-bottom: 0; }

/* ── Form actions bar ── */
.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

/* ── Stat cards ── */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px 20px;
}
.stat-card-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(214,0,0,.12);
    color: var(--red);
    font-size: 20px;
}
.stat-card-body strong {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 900;
    color: var(--muted);
    margin-bottom: 4px;
}
.stat-card-body p {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
    color: var(--ink);
}

/* ── Table toolbar ── */
.table-toolbar { margin-bottom: 14px; }

/* ── Dashboard ── */
.dashboard-stat-cards {
    grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 1100px) {
    .dashboard-stat-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 700px) {
    .dashboard-stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}
.dashboard-filter { margin-bottom: 22px; }
.dashboard-filter-fields {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.dashboard-filter-fields .mb-3 { margin-bottom: 0; }
.dashboard-filter-fields label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 900;
    color: var(--muted);
    margin-bottom: 4px;
}
.dashboard-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
    margin-bottom: 22px;
}
.dashboard-chart-card h2 {
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin: 0 0 16px;
}
.dashboard-chart-card {
    position: relative;
}
.dashboard-chart-card .chart-wrapper {
    position: relative;
    height: 320px;
}
.dashboard-chart-card canvas {
    max-height: 320px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.toolbar-left  { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.search-input {
    width: 100%;
    max-width: 340px;
    padding: 7px 11px;
    background: var(--black);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}
.search-input:focus { border-color: #555; }

/* ── Table ── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }

.table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(255,255,255,.025); }
.clickable-row { cursor: pointer; }

.table td a {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    transition: color .12s;
}
.table td a:hover { color: var(--ink); }
.table td a + a { margin-left: 10px; }

/* ── Row action icons ── */
.row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    color: var(--muted);
    border: 1px solid var(--line);
    background: transparent;
    transition: color .12s, background .12s, border-color .12s;
}
.icon-action:hover {
    color: var(--ink);
    background: rgba(255,255,255,.06);
}
.icon-action.icon-action-danger:hover {
    color: #f87171;
    border-color: rgba(214,0,0,.25);
    background: rgba(214,0,0,.12);
}
.icon-action i { font-size: 14px; }

/* ── Badges ── */
.badge {
    display: inline-block;
    border-radius: 4px;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge.green  { background: rgba(18,165,107,.15); color: #34d399; }
.badge.yellow { background: rgba(234,179,8,.12);  color: #fbbf24; }
.badge.red    { background: rgba(214,0,0,.12);     color: #f87171; }
.badge.dark   { background: #1e1e1e;               color: var(--muted); }

/* ── Pager ── */
.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    gap: 12px;
    flex-wrap: wrap;
}
.pager-info { font-size: 13px; color: var(--muted); }
.pager-controls { display: flex; gap: 4px; }

.pager-btn {
    padding: 5px 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .12s;
}
.pager-btn:hover:not(:disabled) { border-color: #555; color: var(--ink); }
.pager-btn.active { background: var(--red); border-color: var(--red); color: #fff; }
.pager-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ── Flash messages ── */
.flash-message { border-radius: 6px; padding: 11px 14px; margin-bottom: 16px; font-size: 14px; font-weight: 600; }
.flash-success { background: rgba(18,165,107,.1); border: 1px solid rgba(18,165,107,.3); color: #34d399; }
.flash-error   { background: rgba(214,0,0,.1);    border: 1px solid rgba(214,0,0,.3);    color: #f87171; }

/* ── Validation ── */
.field-error, .validation-message { display: block; color: #f87171; font-size: 12px; margin-top: 4px; font-weight: 600; }
.text-danger  { color: #f87171; font-size: 14px; font-weight: 600; }
.text-success { color: #34d399; font-size: 14px; font-weight: 600; }

/* ── Tabs ── */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 22px;
}
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: color .12s, border-color .12s;
    border-radius: 0;
    letter-spacing: normal;
    text-transform: none;
}
.tab-btn:hover:not(:disabled) { color: var(--ink); opacity: 1; }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--red); }

/* ── Utility grids ── */
.grid  { display: grid; grid-template-columns: 1fr 1fr;       gap: 16px; }
.three { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.four  { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

/* ── Key/value detail rows ── */
.line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.line:last-child { border-bottom: none; }
.tab-empty-note { color: var(--muted); }

/* ── form-floating (Bootstrap Identity scaffold compatibility) ── */
/* Override form-floating to match the admin label-above-input style */
.form-floating {
    display: flex;
    flex-direction: column-reverse;
    margin-bottom: 14px;
}
.form-floating > .form-control,
.form-floating > .form-select {
    height: auto;
    padding: 8px 11px;
}
.form-floating > label {
    position: static;
    height: auto;
    padding: 0;
    margin-bottom: 5px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 900;
    color: #b0b0b0;
    pointer-events: none;
    transform: none !important;
    transition: none;
    opacity: 1 !important;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .field-row, .field-row-3 { grid-template-columns: 1fr; }
    .card, .panel, .admin-card { padding: 16px; }
}

/* ── Login ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 32px;
}

.login-card h1 {
    text-align: center;
    justify-content: center;
    margin-bottom: 22px;
}

.login-forgot {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
}

