/* Shared admin styles for Stadi Admin */
:root {
    /* Match frontend app authPalette */
    --bg: #14202C;
    /* background */
    --surface: #1B2B3A;
    /* surface */
    --card: #192734;
    /* card */
    --text: #FCFCFC;
    /* textPrimary */
    --subtle: #B4C4C3;
    /* textSecondary */
    --muted: #8EA09F;
    /* muted */
    --brand: #16bb9d;
    /* accent */
    --brand-700: #119b83;
    /* accentAlt */
    --danger: #FF6B6B;
    /* danger */
    --warning: #f0ad4e;
    --success: #3DD598;
    /* success */
    --border: rgba(180, 196, 195, 0.2);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    background: var(--bg);
    color: var(--text);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

.footer small {
    margin: auto;
    color: white;
}

header.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.brand .logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), #1fe1c0);
    box-shadow: 0 6px 16px rgba(22, 187, 157, 0.35);
}

.brand .title {
    font-size: 16px;
    color: var(--text);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link {
    color: var(--subtle);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    transition: color .15s, background .15s;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.btn {
    appearance: none;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #12181d, #0e1317);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: .2px;
    transition: transform .06s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

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

.btn-primary {
    border-color: rgba(22, 187, 157, 0.55);
    background: linear-gradient(180deg, rgba(22, 187, 157, 0.18), rgba(22, 187, 157, 0.12));
    color: #14202C;
    box-shadow: 0 8px 18px rgba(22, 187, 157, 0.25);
}

.btn-primary:hover {
    border-color: var(--brand);
    box-shadow: 0 10px 20px rgba(22, 187, 157, 0.35);
}

.btn-danger {
    border-color: rgba(255, 93, 93, 0.45);
    background: linear-gradient(180deg, rgba(255, 93, 93, 0.15), rgba(255, 93, 93, 0.08));
    color: #ffecec;
}

.btn-muted {
    background: #0e1317;
    color: var(--subtle);
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .grid.cols-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .grid.cols-2 {
        grid-template-columns: 1fr;
    }
}

.card {
    background: linear-gradient(180deg, #0f1419, #0c1014);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card .card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card .card-title {
    font-size: 14px;
    color: var(--subtle);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card .card-body {
    padding: 16px;
}

.stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: radial-gradient(600px 200px at 90% -10%, rgba(22, 187, 157, 0.08), transparent 50%), #0f1419;
}

.stat .label {
    color: var(--subtle);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat .value {
    font-weight: 700;
    font-size: 22px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    outline: none;
    background: #0d1216;
    color: var(--text);
}

input::placeholder,
textarea::placeholder {
    color: #6b7e8b;
}

label {
    color: var(--subtle);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .8px;
    display: block;
    margin-bottom: 6px;
}

.field {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}


.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    border-bottom: 1px solid var(--border);
    padding: 12px 10px;
    text-align: left;
}

.table th {
    color: var(--subtle);
    font-size: 12px;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #0e1418;
    font-size: 12px;
    color: var(--subtle);
}

.notice {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #0f151a;
    color: var(--subtle);
}

.notice.success {
    border-color: rgba(34, 197, 94, .35);
    background: rgba(34, 197, 94, .08);
    color: #c6f6d5;
}

.notice.error {
    border-color: rgba(255, 93, 93, .35);
    background: rgba(255, 93, 93, .08);
    color: #ffd6d6;
}

.center {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.panel {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(180deg, #0f1419, #0c1014);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel .panel-header {
    padding: 18px 18px 12px;
    border-bottom: 1px solid var(--border);
}

.panel .panel-body {
    padding: 18px;
}

.panel .panel-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.muted {
    color: var(--subtle);
}

.spacer {
    height: 16px;
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.row.right {
    justify-content: flex-end;
}

.hidden {
    display: none !important;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #0f151a;
    color: var(--subtle);
    font-size: 12px;
}

/* Links */
a {
    color: #a0f0df;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Toasts */
.toast-container {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: grid;
    gap: 8px;
    z-index: 9999;
}

.toast {
    position: relative;
    border: 1px solid var(--border);
    background: #0f151a;
    color: var(--text);
    padding: 10px 12px 10px 36px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    min-width: 240px;
}

.toast::before {
    content: '•';
    position: absolute;
    left: 12px;
    top: 10px;
    font-size: 18px;
}

.toast.success {
    border-color: rgba(34, 197, 94, .35);
    background: rgba(34, 197, 94, .08);
    color: #c6f6d5;
}

.toast.error {
    border-color: rgba(255, 93, 93, .35);
    background: rgba(255, 93, 93, .08);
    color: #ffd6d6;
}

.toast.success::before {
    content: '✓';
}

.toast.error::before {
    content: '✕';
}

.toast .close {
    position: absolute;
    right: 8px;
    top: 6px;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.8;
}

.toast .close:hover {
    opacity: 1;
}