/* Admin portal shell — matches the Vue SPA design language:
   purple gradient shell, brand-green accents, Muli typography. */
:root {
    --brand-green: #09B585;
    --brand-green-dark: #058560;
    --shell-purple-from: #2e276c;
    --shell-purple-to: #2f0f56;
    --text-dark: #1e2022;
    --text-muted: #77838f;
    --content-bg: #f8fafd;
    --border: #e7eaf3;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Muli', 'Roboto', -apple-system, "Segoe UI", sans-serif;
    color: var(--text-dark);
    background: var(--content-bg);
}

h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.5rem;
}

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

.admin-shell {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.admin-sidebar {
    width: 240px;
    flex: 0 0 240px;
    background: linear-gradient(160deg, var(--shell-purple-from), var(--shell-purple-to));
    color: #e9e7f5;
    padding: 0 0 1rem;
}

.admin-brand {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    color: #fff;
    padding: 1.25rem 1.5rem;
}

.admin-nav {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}

.admin-nav li a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.5rem;
    color: #c9c4e3;
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: background-color .15s, color .15s, border-color .15s;
}

.admin-nav li a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.admin-nav li a.active {
    background: rgba(9, 181, 133, 0.14);
    color: #fff;
    border-left-color: var(--brand-green);
}

/* ---- Main column ---- */
.admin-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    background: var(--content-bg);
}

.admin-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.75rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.admin-user {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.admin-logout {
    margin: 0;
}

/* ---- Buttons ---- */
.admin-logout-btn,
.admin-btn {
    background: var(--brand-green);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.45rem 1rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color .15s;
}

.admin-logout-btn:hover,
.admin-btn:hover {
    background: var(--brand-green-dark);
}

/* Secondary action (e.g. Disable, Refresh): outlined, not filled. */
.admin-btn--secondary {
    background: #fff;
    color: var(--brand-green-dark);
    border: 1px solid var(--border);
}

.admin-btn--secondary:hover {
    background: var(--content-bg);
}

/* Destructive action (e.g. Delete). */
.admin-btn--danger {
    background: #c0392b;
}

.admin-btn--danger:hover {
    background: #a93226;
}

.admin-logout-btn {
    background: transparent;
    color: var(--text-muted);
    padding: 0.4rem 0.5rem;
}

.admin-logout-btn:hover {
    background: transparent;
    color: var(--brand-green-dark);
}

/* ---- Content ---- */
.admin-content {
    padding: 1.75rem;
}

.admin-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-top: 1rem;
    max-width: 380px;
    box-shadow: 0 1px 2px rgba(30, 32, 34, 0.04);
}

/* ---- Dashboard ---- */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.page-subtitle {
    color: var(--text-muted);
    margin: 0.15rem 0 0;
}

.admin-alert {
    background: #fdecea;
    border: 1px solid #f5c6c2;
    color: #b3261e;
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1rem;
}

.admin-alert--success {
    background: rgba(9, 181, 133, 0.1);
    border-color: rgba(9, 181, 133, 0.35);
    color: #058560;
}

.admin-alert--info {
    background: #eef4ff;
    border-color: #cfe0ff;
    color: #1565d8;
}

/* Form controls */
.form-input {
    width: 100%;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-dark);
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 3px rgba(9, 181, 133, 0.18);
}

.form-input:disabled {
    background: #f3f4f6;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.admin-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.empty-state__icon {
    font-size: 2.75rem;
    color: var(--brand-green);
}

.empty-state__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0.5rem 0 0.25rem;
}

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 1px 2px rgba(30, 32, 34, 0.04);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    flex: 0 0 46px;
}

.stat-icon--green  { background: linear-gradient(135deg, #09B585, #058560); }
.stat-icon--purple { background: linear-gradient(135deg, #5b4bbf, #2e276c); }
.stat-icon--blue   { background: linear-gradient(135deg, #2f8bff, #1565d8); }
.stat-icon--amber  { background: linear-gradient(135deg, #f7b733, #e08a00); }

.stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-dark);
}

.stat-label {
    font-weight: 600;
    color: var(--text-dark);
}

.stat-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

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

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.4rem;
    box-shadow: 0 1px 2px rgba(30, 32, 34, 0.04);
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.panel-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.panel-link {
    font-size: 0.85rem;
    font-weight: 600;
}

.panel-empty {
    color: var(--text-muted);
    margin: 0.5rem 0;
}

/* Bars */
.bar-row {
    display: grid;
    grid-template-columns: 72px 1fr 48px;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.bar-label {
    font-size: 0.88rem;
    color: var(--text-dark);
}

.bar-track {
    background: #eef1f6;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.bar-track--lg { height: 12px; }

.bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--brand-green);
    transition: width .3s ease;
    min-width: 2px;
}

.bar-fill--draft  { background: #9aa5b4; }
.bar-fill--done   { background: #2f8bff; }
.bar-fill--pushed { background: #f7b733; }
.bar-fill--lodged { background: var(--brand-green); }
.bar-fill--paid   { background: #16b8a6; }
.bar-fill--error  { background: #e65252; }

.bar-count {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: right;
    color: var(--text-dark);
}

/* STP cells */
.stp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    text-align: center;
    margin-bottom: 1rem;
}

.stp-cell {
    background: #f8fafd;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
}

.stp-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stp-value--green { color: #058560; }
.stp-value--red   { color: #e65252; }
.stp-value--amber { color: #e08a00; }

.stp-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stp-rate {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stp-rate .bar-track { flex: 1 1 auto; }

.stp-rate-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Data table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #f1f3f7;
}

.data-table tr:last-child td { border-bottom: none; }

.td-strong { font-weight: 600; color: var(--text-dark); }
.ta-right { text-align: right; }

.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.badge--green { background: rgba(9, 181, 133, 0.14); color: #058560; }
.badge--amber { background: rgba(240, 138, 0, 0.15); color: #b86e00; }
.badge--red   { background: rgba(230, 82, 82, 0.14); color: #c0392b; }
.badge--grey  { background: #eef1f6; color: #6b7280; }

/* Clickable table rows */
.data-table--hover tbody tr.clickable-row {
    cursor: pointer;
    transition: background-color .12s;
}

.data-table--hover tbody tr.clickable-row:hover {
    background: #f5fbf8;
}

.row-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
}

.data-table--hover tbody tr.clickable-row:hover .row-link {
    color: var(--brand-green-dark);
}

/* Back link + definition lists (detail page) */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.back-link:hover { color: var(--brand-green-dark); }

.dl {
    display: grid;
    grid-template-columns: 40% 60%;
    row-gap: 0.65rem;
    margin: 0;
}

.dl dt {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding-right: 0.75rem;
}

.dl dd {
    margin: 0;
    color: var(--text-dark);
    font-weight: 600;
    word-break: break-word;
}
