/* SROBot SaaS — minimal Dark UI. Avalonia uygulamasının renk paletiyle uyumlu. */

:root {
    --bg: #0f1114;
    --surface: #171a1f;
    --surface-2: #1f242c;
    --border: #23272e;
    --border-strong: #2e353e;
    --text: #e6e8eb;
    --text-muted: #9ea1a7;
    --text-dim: #6b6f76;
    --accent: #4ec9b0;
    --accent-hover: #5ed8c0;
    --primary: #0e639c;
    --primary-hover: #1976d2;
    --danger: #d9534f;
    --success: #8ac94a;
    --warn: #f0c848;
    --radius: 6px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; padding: 32px 0; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ── Topbar ── */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}
.topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--accent);
    font-weight: 700;
    font-size: 17px;
}
.brand-mark { font-size: 18px; }
.brand-tag {
    background: var(--border);
    color: var(--text-muted);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
}
.nav a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.nav a:hover { color: var(--text); }
.nav-user {
    color: var(--accent);
    font-weight: 600;
    border-left: 1px solid var(--border);
    padding-left: 12px;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--border); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: white; }
.btn-ghost { background: transparent; border-color: transparent; padding: 4px 10px; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-block { display: block; width: 100%; }

.inline { display: inline; }

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}
.card-header {
    margin: -24px -24px 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--radius) var(--radius) 0 0;
}
.card h1, .card h2, .card h3 { margin-top: 0; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.form-control {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(78, 201, 176, 0.2);
}
.form-help {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}
.field-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid;
}
.alert-info { background: rgba(78, 201, 176, 0.1); border-color: var(--accent); color: var(--accent); }
.alert-danger { background: rgba(217, 83, 79, 0.1); border-color: var(--danger); color: var(--danger); }
.alert-warn { background: rgba(240, 200, 72, 0.1); border-color: var(--warn); color: var(--warn); }

.validation-summary {
    background: rgba(217, 83, 79, 0.08);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.validation-summary ul { margin: 0; padding-left: 20px; }

/* ── Auth pages ── */
.auth-page { max-width: 420px; margin: 60px auto; }
.auth-page h1 { font-size: 24px; margin-bottom: 8px; }
.auth-page .subtitle { color: var(--text-muted); margin-bottom: 24px; }
.auth-page .form-footer { text-align: center; margin-top: 16px; color: var(--text-muted); font-size: 13px; }
.auth-page .form-footer a { color: var(--accent); }

/* ── Landing ── */
.hero {
    text-align: center;
    padding: 64px 0 48px;
}
.hero h1 {
    font-size: 38px;
    margin: 0 0 12px;
    color: var(--text);
}
.hero .hero-accent { color: var(--accent); }
.hero p {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto 28px;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; }
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 48px 0;
}
.feature-grid .card { margin: 0; }
.feature-grid h3 { color: var(--accent); font-size: 16px; }
.feature-grid p { color: var(--text-muted); margin-bottom: 0; }

/* ── Dashboard ── */
.dashboard h1 { margin-top: 0; }
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state h3 { color: var(--text); }

/* ── Footer ── */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 16px 0;
    margin-top: auto;
}
.footer .container { display: flex; justify-content: space-between; }

.muted { color: var(--text-muted); font-size: 12px; }

/* ── Utility ── */
.mono { font-family: "Menlo", "Consolas", monospace; font-size: 13px; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 16px; }

/* ── Admin Shell (sidebar layout) ── */
.admin-body main { padding: 0; }
.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 56px);
}
.admin-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.admin-sidebar nav { display: flex; flex-direction: column; }
.admin-sidebar nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.admin-sidebar nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-sidebar nav a.active {
    color: var(--accent);
    background: var(--surface-2);
    border-left-color: var(--accent);
    font-weight: 600;
}
.admin-sidebar nav a .icon {
    color: var(--text-dim);
    font-size: 16px;
    width: 18px;
    text-align: center;
}
.admin-sidebar nav a.active .icon { color: var(--accent); }
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}
.sidebar-footer a { text-decoration: none; font-size: 12px; }

.admin-main {
    padding: 24px 32px;
    overflow-x: auto;
}

/* ── Page header (breadcrumb + actions) ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header h1 { margin: 0; font-size: 22px; }
.page-header .subtitle { color: var(--text-muted); margin-top: 4px; font-size: 13px; }
.page-header-actions { display: flex; gap: 8px; }

/* ── Data table ── */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.table thead th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .col-actions { text-align: right; white-space: nowrap; }
.table .col-mono { font-family: "Menlo", "Consolas", monospace; }

/* ── Badges (status pills) ── */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-success { background: rgba(138, 201, 74, 0.15); color: var(--success); }
.badge-warn    { background: rgba(240, 200, 72, 0.15); color: var(--warn); }
.badge-danger  { background: rgba(217, 83, 79, 0.15);  color: var(--danger); }
.badge-muted   { background: rgba(158, 161, 167, 0.15); color: var(--text-muted); }
.badge-accent  { background: rgba(78, 201, 176, 0.15); color: var(--accent); }

/* ── Filter bar ── */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-bar input, .filter-bar select {
    background: var(--bg);
    border: 1px solid var(--border-strong);
    color: var(--text);
    padding: 8px 10px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
}
.filter-bar input:focus, .filter-bar select:focus {
    outline: none;
    border-color: var(--accent);
}

/* ── Pagination ── */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 16px;
}
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 12px;
}
.pagination a:hover { background: var(--surface-2); color: var(--text); }
.pagination .current {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    font-weight: 600;
}
.pagination .disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Detail view ── */
.kv-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px 16px;
    align-items: center;
}
.kv-grid .k { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.kv-grid .v { font-family: "Menlo", "Consolas", monospace; }

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0;
}
.action-buttons form { display: inline; }
.action-buttons button { font-size: 13px; }

/* ── Timeline / event list (detail page) ── */
.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}
.timeline li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
}
.timeline li:last-child { border-bottom: 0; }
.timeline .time { color: var(--text-dim); font-family: "Menlo", monospace; font-size: 12px; }
.timeline .body { color: var(--text); }
.timeline .body .ev-data {
    color: var(--text-muted);
    font-family: "Menlo", monospace;
    font-size: 11px;
    margin-top: 2px;
    white-space: pre-wrap;
    word-break: break-all;
}
