:root {
    --bg: #0f1420;
    --bg-elevated: #161d2e;
    --bg-card: #1b2436;
    --border: #2a3550;
    --text: #e6eaf3;
    --text-dim: #93a0bd;
    --accent: #4f8cff;
    --accent-soft: #24314f;
    --green: #3ecf8e;
    --amber: #f2b84b;
    --red: #ef5a6f;
    --radius: 10px;
}

* { box-sizing: border-box; }

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

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

.topbar {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.brand:hover { text-decoration: none; opacity: 0.85; }
nav a {
    margin-left: 20px;
    color: var(--text-dim);
    font-weight: 500;
}
nav a:hover { color: var(--text); text-decoration: none; }

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

footer {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    padding: 20px;
    border-top: 1px solid var(--border);
}

.banner {
    max-width: 1100px;
    margin: 16px auto 0;
    padding: 12px 20px;
    border-radius: var(--radius);
}
.banner-info { background: var(--accent-soft); border: 1px solid var(--accent); }

h1 { font-size: 1.6rem; margin-bottom: 4px; }
h2 { font-size: 1.2rem; margin-top: 28px; }
.subtitle { color: var(--text-dim); margin-top: 0; margin-bottom: 20px; }

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    background: var(--accent);
    color: white;
    border: none;
    padding: 9px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn-secondary { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 14px;
}
.card:hover { border-color: #3a4970; }

.case-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }

.case-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.case-title a { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.case-title a:hover { color: var(--accent); text-decoration: none; }

.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 3px 8px;
    border-radius: 999px;
}
.badge-new { background: rgba(62, 207, 142, 0.15); color: var(--green); }
.badge-updated { background: rgba(242, 184, 75, 0.15); color: var(--amber); }
.badge-canceled { background: rgba(239, 90, 111, 0.15); color: var(--red); }

.meta-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 4px 12px;
    font-size: 0.9rem;
    margin-top: 8px;
}
.meta-grid dt { color: var(--text-dim); }
.meta-grid dd { margin: 0; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}
.empty-state .big { font-size: 2.5rem; margin-bottom: 12px; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 0.9rem;
}
table.data-table th, table.data-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
table.data-table th { color: var(--text-dim); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
table.data-table tr:hover td { background: var(--bg-elevated); }

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin: 16px 0;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.filter-bar input[type="text"], .filter-bar select {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
}
.filter-bar label { font-size: 0.85rem; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}
.stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-label { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 0.85rem; }
.bar-label { width: 160px; flex-shrink: 0; color: var(--text-dim); }
.bar-track { flex: 1; background: var(--bg); border-radius: 6px; overflow: hidden; height: 18px; }
.bar-fill { background: var(--accent); height: 100%; }
.bar-value { width: 40px; text-align: right; }

.doc-list { list-style: none; padding: 0; margin: 8px 0 0; }
.doc-list li { margin-bottom: 6px; }
.doc-size { color: var(--text-dim); font-size: 0.8rem; }

.description-box {
    white-space: pre-wrap;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    font-size: 0.9rem;
    margin-top: 6px;
}

.photo-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.photo-strip img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}
.photo-strip img:hover { border-color: var(--accent); transform: scale(1.03); }

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-img { max-width: 88vw; max-height: 85vh; border-radius: var(--radius); }
.lightbox-close, .lightbox-nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, 0.18); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

.table-thumb {
    width: 56px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: block;
}

.case-thumb {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.case-card-body { display: flex; gap: 14px; }
.case-card-body > div { flex: 1; min-width: 0; }

.status-ok { color: var(--green); }
.status-fail { color: var(--red); }

.breadcrumb { margin-bottom: 10px; font-size: 0.85rem; }
.breadcrumb a { color: var(--text-dim); }
