/*
    SWRP Lizenz-Panel - "Tactical Ops Console"
    Gleiche Design-Sprache wie das In-Game-UI (dunkles Charcoal, mattes Gold
    als einziger Akzent, gekappte statt runde Ecken) - dieses Panel ist die
    Betriebs-Konsole hinter demselben Produkt, keine generische SaaS-UI.
*/

:root {
    --bg: #0c0c0e;
    --bg-grid: #101013;
    --surface: #17171b;
    --surface-alt: #1e1e23;
    --surface-hover: #26262c;
    --border: #2c2c32;
    --border-light: #3a3a42;

    --gold: #c4a45c;
    --gold-bright: #d8bc7a;
    --gold-dim: rgba(196, 164, 92, 0.14);

    --text: #e7e4dc;
    --text-muted: #8c8a86;
    --text-faint: #59585a;

    --ok: #7ab27a;
    --ok-dim: rgba(122, 178, 122, 0.14);
    --bad: #c25a5a;
    --bad-dim: rgba(194, 90, 90, 0.14);

    --font-display: 'Rajdhani', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --cut: 12px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.5;
    background-image:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0px, rgba(255, 255, 255, 0.012) 1px, transparent 1px, transparent 3px);
}

a {
    color: var(--gold);
    text-decoration: none;
}

a:hover {
    color: var(--gold-bright);
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0 0 4px;
    color: var(--text);
}

h1 {
    font-size: 28px;
    text-transform: uppercase;
}

h2 {
    font-size: 18px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 40px;
}

/* ------------------------------------------------------------------ */
/* Shell / Sidebar                                                     */
/* ------------------------------------------------------------------ */

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

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 28px 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.08em;
    color: var(--text);
    padding: 0 24px 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.brand span {
    color: var(--gold);
}

nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 24px;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.03em;
    border-left: 2px solid transparent;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

nav a:hover {
    background: var(--surface-alt);
    color: var(--text);
}

nav a.is-active {
    color: var(--gold);
    background: var(--gold-dim);
    border-left-color: var(--gold);
}

.nav-index {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
}

nav a.is-active .nav-index {
    color: var(--gold);
}

.sidebar-foot {
    padding: 16px 24px 0;
    border-top: 1px solid var(--border);
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.operator {
    font-size: 12px;
    color: var(--text-faint);
    line-height: 1.4;
}

.operator strong {
    color: var(--text-muted);
    font-weight: 600;
}

.logout {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.logout:hover {
    color: var(--bad);
}

.content {
    flex: 1;
    padding: 40px 48px 60px;
    max-width: 1100px;
}

/* ------------------------------------------------------------------ */
/* Page chrome                                                         */
/* ------------------------------------------------------------------ */

.breadcrumb {
    font-size: 12px;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
}

.page-header:first-of-type,
h1 + .page-header {
    margin-top: 0;
}

/* ------------------------------------------------------------------ */
/* Stat cards                                                          */
/* ------------------------------------------------------------------ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transform: translateY(6px);
    animation: rise 0.4s ease forwards;
}

.stat-card:nth-child(1) { animation-delay: 0.03s; }
.stat-card:nth-child(2) { animation-delay: 0.09s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }

@keyframes rise {
    to { opacity: 1; transform: translateY(0); }
}

.stat-value {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}

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

/* ------------------------------------------------------------------ */
/* Tables                                                              */
/* ------------------------------------------------------------------ */

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    padding: 0 14px 10px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.data-table tbody tr {
    position: relative;
    transition: background 0.12s ease;
}

.data-table tbody tr:hover {
    background: var(--surface-alt);
}

.data-table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--gold);
}

.data-table .empty {
    text-align: center;
    color: var(--text-faint);
    padding: 28px 0;
}

.data-table code {
    font-family: var(--font-mono);
    color: var(--gold-bright);
    background: var(--gold-dim);
    padding: 2px 6px;
    font-size: 12px;
}

/* ------------------------------------------------------------------ */
/* Badges                                                               */
/* ------------------------------------------------------------------ */

.badge {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    border: 1px solid transparent;
}

.badge-ok {
    color: var(--ok);
    background: var(--ok-dim);
    border-color: rgba(122, 178, 122, 0.3);
}

.badge-bad {
    color: var(--bad);
    background: var(--bad-dim);
    border-color: rgba(194, 90, 90, 0.3);
}

/* ------------------------------------------------------------------ */
/* Forms                                                                */
/* ------------------------------------------------------------------ */

.panel-form {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 22px 24px;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.panel-form.collapsible {
    display: none;
}

.panel-form.collapsible.open {
    display: flex;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row label {
    flex: 1;
    min-width: 200px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.checkbox-row {
    flex-direction: row;
    align-items: center;
    text-transform: none;
    letter-spacing: normal;
    font-size: 13px;
    gap: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
textarea {
    background: var(--bg-grid);
    border: 1px solid var(--border-light);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 9px 11px;
    outline: none;
    transition: border-color 0.12s ease;
}

input:focus,
textarea:focus {
    border-color: var(--gold);
}

textarea {
    resize: vertical;
    font-family: inherit;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
}

.btn-primary {
    align-self: flex-start;
    background: var(--gold);
    color: #17140c;
    border: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 20px;
    cursor: pointer;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    transition: background 0.12s ease;
}

.btn-primary:hover {
    background: var(--gold-bright);
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    padding: 0;
}

.btn-link:hover {
    color: var(--gold);
}

.btn-danger:hover {
    color: var(--bad);
}

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

.inline-form {
    display: inline;
}

/* ------------------------------------------------------------------ */
/* Login                                                                */
/* ------------------------------------------------------------------ */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(196, 164, 92, 0.08), transparent 55%),
        var(--bg);
}

.login-card {
    width: 340px;
    background: var(--surface);
    border: 1px solid var(--border);
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
    padding: 32px 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-card .brand {
    border: none;
    padding: 0 0 6px;
    margin: 0;
    text-align: center;
    font-size: 22px;
}

.login-card .error {
    background: var(--bad-dim);
    border: 1px solid rgba(194, 90, 90, 0.3);
    color: var(--bad);
    font-size: 12px;
    padding: 8px 10px;
    margin: 0;
}

.login-card button {
    margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
    .stat-card {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
