/* ============================================================
   Administrācijas paneļa stils
   ============================================================ */

:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;

    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #4338ca;
    --sidebar-hover: #1e293b;

    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;

    --radius: 14px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; }
h2 { font-size: 19px; }

/* ---------- Izkārtojums ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 248px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.brand-mark {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 10px;
    font-size: 18px;
}

.nav { display: flex; flex-direction: column; padding: 12px 10px; gap: 4px; }

.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-weight: 500;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--sidebar-active); color: #fff; }
.nav-ico { width: 20px; text-align: center; font-size: 15px; }

.sidebar-foot {
    margin-top: auto;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 26px;
    position: sticky;
    top: 0;
    z-index: 5;
}
.topbar-title { font-weight: 700; font-size: 17px; }

.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip-name { font-weight: 600; }

.content { flex: 1; padding: 26px; max-width: 1200px; width: 100%; margin: 0 auto; }

.foot {
    padding: 14px 26px;
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* ---------- Kartes un režģi ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 22px;
}
.card-narrow { max-width: 620px; }

.card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.card-head-split { align-items: flex-start; }
.card-head h2 { margin-bottom: 2px; }
.muted { color: var(--muted); font-size: 13px; margin: 0; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}
.stat-num { font-size: 30px; font-weight: 800; color: var(--primary); }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 2px; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
}
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Tabula ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8fafc; }
.table-condensed th { width: 40%; background: transparent; text-transform: none; letter-spacing: 0; font-size: 13px; }
.table-scroll { overflow-x: auto; }
.empty { text-align: center; color: var(--muted); padding: 26px !important; }
.ta-right { text-align: right; }
.inline { display: inline; }

.actions { white-space: nowrap; }
.actions form { margin: 0; }

/* ---------- Statusi un žetoni ---------- */
.status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.status-on { color: #166534; background: #dcfce7; }
.status-off { color: #991b1b; background: #fee2e2; }

.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.badge-admin { color: #3730a3; background: #e0e7ff; }
.badge-gramatvedis { color: #065f46; background: #d1fae5; }
.badge-you { color: #92400e; background: #fef3c7; }

/* ---------- Filtrs ---------- */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: #f1f5f9;
    border: 1px solid var(--border);
}
.chip:hover { text-decoration: none; background: #e2e8f0; }
.chip.active { color: #fff; background: var(--primary); border-color: var(--primary); }

/* ---------- Pogas ---------- */
.btn {
    display: inline-block;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn:hover { background: #f1f5f9; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fee2e2; }
.btn-block { width: 100%; }

/* ---------- Formas ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.field > span { font-size: 13px; font-weight: 600; }
.field small { color: var(--muted); font-size: 12px; }

input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}
input:disabled { background: #f1f5f9; color: var(--muted); }

.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 16px; height: 16px; }

.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.sep { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* ---------- Paziņojumi ---------- */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 18px;
    font-weight: 500;
}
.alert-success { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; }
.alert-error   { color: #991b1b; background: #fee2e2; border: 1px solid #fecaca; }
.alert-info    { color: #1e40af; background: #dbeafe; border: 1px solid #bfdbfe; }

/* ---------- Īpašie bloki ---------- */
.welcome-hero {
    background: linear-gradient(135deg, #eef2ff, #ffffff);
    border: 1px solid #e0e7ff;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 22px;
}
.welcome-hero p { margin: 4px 0 0; color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* ============================================================
   Pieteikšanās lapa
   ============================================================ */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #312e81 55%, #4338ca 100%);
    padding: 20px;
}

.login-wrap { width: 100%; max-width: 400px; text-align: center; }

.login-card {
    background: var(--surface);
    border-radius: 18px;
    padding: 34px 30px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .35);
    text-align: left;
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo {
    width: 56px; height: 56px;
    display: inline-grid; place-items: center;
    font-size: 28px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-radius: 16px;
    margin-bottom: 12px;
}
.login-brand h1 { font-size: 21px; margin-bottom: 4px; }
.login-brand p { color: var(--muted); margin: 0; font-size: 14px; }

.login-card form { display: flex; flex-direction: column; gap: 16px; }

.login-hint { color: rgba(255, 255, 255, .7); font-size: 13px; margin-top: 16px; }

/* ---------- Responsivitāte ---------- */
@media (max-width: 760px) {
    .sidebar { width: 64px; }
    .brand-text, .nav-link { font-size: 0; }
    .nav-link { justify-content: center; padding: 12px; }
    .brand { justify-content: center; padding: 18px 8px; }
    .content { padding: 18px; }
    .topbar { padding: 12px 18px; }
    .table { font-size: 13px; }
}

/* ---------- KYC modulis (skats / atbildes) ---------- */
.ans-sec { margin-bottom: 22px; }
.ans-sec h3 {
    font-size: 15px;
    color: #3730a3;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
    margin: 0 0 10px;
}
.ans-consent p { margin: 0; }

.kv {
    display: grid;
    grid-template-columns: 220px 1fr;
    row-gap: 6px;
    column-gap: 12px;
    margin: 0;
}
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; } }

.link-box {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #f8fafc;
    border: 1px dashed #c7d2fe;
    border-radius: 10px;
    padding: 10px 14px;
}
.link-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    word-break: break-all;
    background: #eef2ff;
    color: #3730a3;
    padding: 4px 8px;
    border-radius: 6px;
}

.details {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    background: #fbfcfe;
}
.details summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
}
.details .field { margin-top: 12px; }

/* KYC — statusa atzīmes un mazās rindiņas */
.small { font-size: 12px; }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
}
.pill-done { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; }
.pill-wait { color: #92400e; background: #fef3c7; border: 1px solid #fde68a; }
.meta-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text);
}
.meta-line .muted { font-size: 12.5px; }
