:root {
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --surface: #f9fafb;
    --accent: #1d4ed8;
    --accent-dark: #1e40af;
    --accent-soft: #dbeafe;
    --success: #047857;
    --success-soft: #d1fae5;
    --danger: #b42318;
    --danger-soft: #fdecea;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--surface);
}

h1, h2 {
    margin: 0 0 12px;
    line-height: 1.2;
}

h1 { font-size: 26px; }
h2 { font-size: 20px; }

a { color: var(--accent); }

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

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

.card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    margin: 0;
}

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

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.topbar .muted { margin-left: auto; font-size: 14px; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin: 14px 0 6px;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font: inherit;
    background: #ffffff;
}

input:focus, select:focus, button:focus-visible, a:focus-visible {
    outline: 3px solid var(--accent-soft);
    border-color: var(--accent);
}

.logo {
    display: block;
    height: 36px;
    width: auto;
}

.login-card .logo {
    height: 44px;
    margin-bottom: 24px;
}

.topbar .logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.topbar .logo-wrap span {
    padding-left: 12px;
    border-left: 1px solid var(--line);
    color: var(--muted);
}

.row {
    display: flex;
    gap: 8px;
}

.hint {
    margin: 6px 0 16px;
    font-size: 13px;
    color: var(--muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn-full { width: 100%; margin-top: 20px; }
.btn-primary { background: var(--accent); color: #ffffff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-light { background: #ffffff; color: var(--ink); border-color: var(--line); }
.btn-light:hover { background: var(--surface); }
.btn-danger { background: #ffffff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin: 0 0 20px;
}

.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 16px 0 20px;
    padding: 32px 16px;
    border: 2px dashed var(--line);
    border-radius: 14px;
    text-align: center;
    font-weight: 400;
    cursor: pointer;
}

.dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.dropzone.dragging,
.dropzone:hover { border-color: var(--accent); background: var(--surface); }
.dropzone.has-file { border-color: var(--accent); background: var(--accent-soft); }

.table-scroll { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

th {
    text-align: left;
    font-weight: 500;
    color: var(--muted);
    padding: 10px 12px 10px 0;
    border-bottom: 2px solid var(--line);
}

td {
    padding: 12px 12px 12px 0;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.inline-form {
    display: flex;
    gap: 6px;
    margin: 0;
}

.inline-form input {
    min-height: 34px;
    width: 140px;
    font-size: 14px;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
}

code {
    font-family: Menlo, Consolas, monospace;
    font-size: 13px;
}

.code {
    margin: 12px 0;
    padding: 14px;
    border-radius: 10px;
    background: var(--ink);
    color: #ffffff;
    font-family: Menlo, Consolas, monospace;
    font-size: 13px;
    overflow-x: auto;
}

.snippet {
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    white-space: nowrap;
}

.thumb {
    display: block;
    width: 64px;
    height: 48px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.row .snippet {
    align-self: center;
}

.badge-ok {
    background: #d1fae5;
    color: #047857;
}

.badge-warn {
    background: #fef3c7;
    color: #92400e;
}

.file-btn {
    position: relative;
    margin: 0;
    overflow: hidden;
}

.file-btn input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

@media (max-width: 800px) {
    .grid-2 { grid-template-columns: 1fr; }
    .topbar .muted { display: none; }
    .topbar .btn { margin-left: auto; }
}
