:root {
    --sixy-bg: #f4f6f8;
    --sixy-surface: #ffffff;
    --sixy-border: #e2e5ea;
    --sixy-text: #1c2530;
    --sixy-text-muted: #667085;
    --sixy-primary: #1f6f5c;
    --sixy-primary-dark: #17564a;
    --sixy-danger: #b3261e;
    --sixy-danger-bg: #fbeceb;
    --sixy-success: #1f6f5c;
    --sixy-success-bg: #e7f3ef;
    --sixy-warning: #8a5a00;
    --sixy-warning-bg: #fdf3dd;
    --sixy-radius: 10px;
    --sixy-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

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

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

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

.sixy-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #14201d;
    color: #d8e3df;
    padding: 20px 0;
}

.sixy-sidebar .brand {
    font-weight: 700;
    font-size: 20px;
    color: #fff;
    padding: 0 20px 20px;
    letter-spacing: 0.5px;
}

.sixy-sidebar nav a {
    display: block;
    padding: 10px 20px;
    color: #b9c7c2;
    font-size: 14px;
}

.sixy-sidebar nav a:hover { background: rgba(255,255,255,0.06); text-decoration: none; color: #fff; }
.sixy-sidebar nav a.active { background: var(--sixy-primary); color: #fff; }
.sixy-sidebar .nav-logout { margin: 0; }
.sixy-sidebar .nav-logout button {
    width: 100%; border: 0; background: transparent; color: inherit;
    cursor: pointer; font: inherit; text-align: left; padding: 10px 14px;
}
.sixy-sidebar .nav-logout button:hover { background: rgba(255,255,255,0.06); color: #fff; }

.sixy-main { flex: 1; min-width: 0; }

.sixy-topbar {
    background: var(--sixy-surface);
    border-bottom: 1px solid var(--sixy-border);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sixy-topbar h1 { font-size: 18px; margin: 0; }
.sixy-topbar .user { font-size: 13px; color: var(--sixy-text-muted); }

.sixy-content { padding: 24px; max-width: 1200px; }

.sixy-flash {
    padding: 12px 16px;
    border-radius: var(--sixy-radius);
    margin-bottom: 18px;
    font-size: 14px;
}
.sixy-flash.success { background: var(--sixy-success-bg); color: var(--sixy-success); }
.sixy-flash.error { background: var(--sixy-danger-bg); color: var(--sixy-danger); }

.sixy-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.sixy-card {
    background: var(--sixy-surface);
    border: 1px solid var(--sixy-border);
    border-radius: var(--sixy-radius);
    padding: 16px 18px;
    box-shadow: var(--sixy-shadow);
}

.sixy-card .label { font-size: 12.5px; color: var(--sixy-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sixy-card .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.sixy-card .sub { font-size: 12.5px; color: var(--sixy-text-muted); margin-top: 4px; }

.sixy-panel {
    background: var(--sixy-surface);
    border: 1px solid var(--sixy-border);
    border-radius: var(--sixy-radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--sixy-shadow);
}

.sixy-panel h2 { margin-top: 0; font-size: 16px; }

table.sixy-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.sixy-table th, table.sixy-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--sixy-border);
    vertical-align: top;
}
table.sixy-table th { font-size: 12px; text-transform: uppercase; color: var(--sixy-text-muted); letter-spacing: 0.04em; }
table.sixy-table tr:last-child td { border-bottom: none; }

.sixy-table-wrap { overflow-x: auto; }

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge.category { background: #eef2ff; color: #3538cd; }
.badge.score-high { background: var(--sixy-success-bg); color: var(--sixy-success); }
.badge.score-mid { background: var(--sixy-warning-bg); color: var(--sixy-warning); }
.badge.score-low { background: var(--sixy-danger-bg); color: var(--sixy-danger); }
.badge.decision-pending { background: #eef0f2; color: var(--sixy-text-muted); }
.badge.decision-approved { background: var(--sixy-success-bg); color: var(--sixy-success); }
.badge.decision-rejected { background: var(--sixy-danger-bg); color: var(--sixy-danger); }
.badge.trust { background: #f3f0ff; color: #5925dc; }
.badge.active-yes { background: var(--sixy-success-bg); color: var(--sixy-success); }
.badge.active-no { background: #f1f2f4; color: var(--sixy-text-muted); }
.badge.status-draft { background: var(--sixy-warning-bg); color: var(--sixy-warning); }
.badge.status-published { background: var(--sixy-success-bg); color: var(--sixy-success); }
.badge.delivery-reserve { background: #eef2ff; color: #3538cd; }
.badge.delivery-scheduled { background: #f3f0ff; color: #5925dc; }
.badge.delivery-live { background: var(--sixy-success-bg); color: var(--sixy-success); }
.badge.delivery-used { background: #f1f2f4; color: var(--sixy-text-muted); }
.badge.delivery-unassigned { background: var(--sixy-warning-bg); color: var(--sixy-warning); }

.sixy-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; margin-top: 14px; }
.sixy-form label:first-child { margin-top: 0; }
.sixy-form input[type=text],
.sixy-form input[type=url],
.sixy-form input[type=email],
.sixy-form input[type=password],
.sixy-form input[type=number],
.sixy-form select,
.sixy-form textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--sixy-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--sixy-text);
}
.sixy-form textarea { min-height: 80px; resize: vertical; }
.sixy-form .checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.sixy-form .checkbox-row input { width: auto; }
.sixy-form .hint { font-size: 12.5px; color: var(--sixy-text-muted); margin-top: 4px; }

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--sixy-primary); color: #fff; }
.btn-primary:hover { background: var(--sixy-primary-dark); }
.btn-secondary { background: #fff; border-color: var(--sixy-border); color: var(--sixy-text); }
.btn-secondary:hover { background: #f2f4f6; }
.btn-danger { background: #fff; border-color: var(--sixy-danger); color: var(--sixy-danger); }
.btn-danger:hover { background: var(--sixy-danger-bg); }
.btn-success { background: #fff; border-color: var(--sixy-success); color: var(--sixy-success); }
.btn-success:hover { background: var(--sixy-success-bg); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.inline-form { display: inline-block; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: end; }
.filters .field { display: flex; flex-direction: column; gap: 4px; }
.filters label { font-size: 12px; color: var(--sixy-text-muted); font-weight: 600; }
.filters select, .filters input { padding: 7px 10px; border: 1px solid var(--sixy-border); border-radius: 8px; font-size: 13.5px; }

.pagination { display: flex; gap: 6px; margin-top: 16px; }
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid var(--sixy-border);
    border-radius: 6px;
    font-size: 13px;
}
.pagination .current { background: var(--sixy-primary); border-color: var(--sixy-primary); color: #fff; }

.candidate-card {
    border: 1px solid var(--sixy-border);
    border-radius: var(--sixy-radius);
    padding: 18px 20px;
    margin-bottom: 16px;
    background: var(--sixy-surface);
    box-shadow: var(--sixy-shadow);
}
.candidate-card .top-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.candidate-card h3 { margin: 10px 0 6px; font-size: 17px; }
.candidate-card .meta { font-size: 12.5px; color: var(--sixy-text-muted); }
.candidate-card .reason { margin-top: 10px; font-size: 14px; }
.candidate-card .risks { margin-top: 8px; font-size: 13.5px; color: var(--sixy-warning); background: var(--sixy-warning-bg); padding: 8px 12px; border-radius: 8px; }
.candidate-card .scores { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--sixy-text-muted); }
.candidate-card .scores b { color: var(--sixy-text); }

.story-editor .top-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.story-editor .meta { font-size: 12.5px; color: var(--sixy-text-muted); }
.story-editor .field-limit { color: var(--sixy-text-muted); font-weight: 400; }
.story-grid { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 12px; }
.schedule-inline { display:inline-flex!important; align-items:center; gap:8px; margin:0!important; font-size:12px!important; }
.schedule-inline input { padding:7px 9px; border:1px solid var(--sixy-border); border-radius:8px; }
.reserve-warning { background: var(--sixy-warning-bg); color: var(--sixy-warning); border:1px solid #f2d18a; }

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sixy-bg);
}
.login-box {
    background: var(--sixy-surface);
    border: 1px solid var(--sixy-border);
    border-radius: var(--sixy-radius);
    box-shadow: var(--sixy-shadow);
    padding: 32px;
    width: 100%;
    max-width: 360px;
}
.login-box h1 { font-size: 22px; margin: 0 0 4px; }
.login-box p.tagline { color: var(--sixy-text-muted); font-size: 13.5px; margin-top: 0; margin-bottom: 20px; }

@media (max-width: 800px) {
    .sixy-layout { flex-direction: column; }
    .sixy-sidebar { width: 100%; }
    .sixy-sidebar nav { display: flex; overflow-x: auto; }
    .sixy-sidebar nav a { white-space: nowrap; }
    .sixy-content { padding: 16px; }
    .story-grid { grid-template-columns: 1fr; gap: 0; }
}
