:root {
    --bg: #f3f5f7;
    --panel: #ffffff;
    --text: #1f252d;
    --muted: #66707c;
    --line: #d7dde5;
    --line-soft: #e8edf3;
    --accent: #c5222a;
    --accent-strong: #9f1c22;
    --accent-soft: #fff1f2;
    --steel: #25313f;
    --success: #18794e;
    --warning: #9a6700;
    --danger: #b42318;
    --radius: 8px;
    --shadow: 0 16px 38px rgba(29, 39, 52, 0.07);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

a:hover {
    text-decoration: underline;
}

code {
    background: #f1f4f8;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    color: #2d3748;
    font-size: 12px;
    padding: 1px 5px;
}

.topbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    color: var(--text);
    display: inline-flex;
    align-items: center;
    font-size: 19px;
    font-weight: 700;
    gap: 10px;
    line-height: 1;
}

.brand::before {
    background: var(--accent);
    content: "";
    display: inline-block;
    height: 18px;
    width: 5px;
}

.serviko-logo-image {
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    display: block;
    object-fit: contain;
}

.serviko-logo-header {
    height: 34px;
    padding: 4px;
    width: 38px;
}

.serviko-logo-hero {
    height: 86px;
    padding: 8px;
    width: 94px;
}

.serviko-logo-dashboard {
    height: 32px;
    padding: 4px;
    width: 36px;
}

.nav {
    align-items: center;
    display: flex;
    gap: 18px;
}

.nav a {
    color: #364152;
    font-weight: 650;
}

.nav form {
    margin: 0;
}

.link-button {
    background: transparent;
    border: 0;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.page {
    margin: 0 auto;
    max-width: 1240px;
    padding: 32px 24px 58px;
}

.page-head {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-head h1,
.panel h1 {
    font-size: 32px;
    line-height: 1.15;
    margin: 0;
}

.panel h2 {
    font-size: 18px;
    margin: 6px 0 12px;
}

.eyebrow {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
    margin: 6px 0 0;
}

.messages {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.message {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 22px rgba(29, 39, 52, 0.04);
    padding: 12px 14px;
}

.message-success {
    border-color: #9fd8bd;
    color: var(--success);
}

.message-error {
    border-color: #f3b5b0;
    color: var(--danger);
}

.button {
    align-items: center;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 650;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    text-decoration: none;
    white-space: nowrap;
}

.button:hover {
    background: var(--accent-strong);
    text-decoration: none;
}

.button:disabled {
    background: #a9b4c3;
    border-color: #a9b4c3;
    cursor: not-allowed;
}

.button-secondary {
    background: var(--accent-soft);
    border-color: #facdd0;
    color: var(--accent);
}

.button-secondary:hover {
    background: #ffe3e5;
}

.button-ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--text);
}

.button-ghost:hover {
    background: #f7f8fa;
}

.button-danger {
    background: #fff;
    border-color: #f3b5b0;
    color: var(--danger);
}

.button-danger:hover {
    background: #fff5f5;
}

.button-small {
    font-size: 13px;
    min-height: 34px;
    padding: 6px 10px;
}

.panel,
.list-panel {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 0;
    padding: 20px;
}

.panel + .panel,
.panel + .list-panel,
.list-panel + .panel {
    margin-top: 18px;
}

.panel-head {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.action-panel {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.notice-panel {
    align-items: center;
    border-color: #f3d18b;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.notice-panel h2 {
    margin-top: 0;
}

.action-panel form {
    margin: 0;
}

.metrics-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.metric {
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: 0 10px 24px rgba(29, 39, 52, 0.04);
    min-height: 96px;
    padding: 16px;
    position: relative;
}

.metric::before {
    background: var(--accent);
    content: "";
    height: 3px;
    left: 16px;
    position: absolute;
    right: 16px;
    top: 0;
}

.metric span {
    color: var(--muted);
    display: block;
    font-size: 13px;
}

.metric strong {
    display: block;
    font-size: 28px;
    line-height: 1.2;
    margin-top: 8px;
    overflow-wrap: anywhere;
}

.lot-overview {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.overview-card {
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: 0 10px 24px rgba(29, 39, 52, 0.04);
    min-height: 86px;
    padding: 14px 16px;
}

.overview-card span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

.overview-card strong {
    display: block;
    font-size: 16px;
    line-height: 1.25;
    margin-top: 8px;
    overflow-wrap: anywhere;
}

.workspace-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    margin-bottom: 18px;
}

.detail-list {
    display: grid;
    gap: 0;
    margin: 10px 0 0;
}

.detail-list div {
    border-top: 1px solid var(--line-soft);
    display: grid;
    gap: 10px;
    grid-template-columns: 150px minmax(0, 1fr);
    padding: 12px 0;
}

.detail-list div:first-child {
    border-top: 0;
}

.detail-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.dashboard-grid {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

.moderation-head {
    align-items: flex-start;
}

.filter-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.filter-bar input,
.filter-bar select {
    min-height: 34px;
    width: auto;
}

.filter-bar input {
    min-width: 220px;
}

.data-table.moderation-table {
    min-width: 1060px;
    table-layout: fixed;
}

.moderation-table th,
.moderation-table td {
    overflow-wrap: anywhere;
}

.moderation-table th:nth-child(1),
.moderation-table td:nth-child(1) {
    width: 19%;
}

.moderation-table th:nth-child(2),
.moderation-table td:nth-child(2) {
    width: 9%;
}

.moderation-table th:nth-child(3),
.moderation-table td:nth-child(3) {
    width: 13%;
}

.moderation-table th:nth-child(4),
.moderation-table td:nth-child(4) {
    width: 13%;
}

.moderation-table th:nth-child(5),
.moderation-table td:nth-child(5) {
    width: 14%;
}

.moderation-table th:nth-child(6),
.moderation-table td:nth-child(6) {
    width: 10%;
}

.moderation-table th:nth-child(7),
.moderation-table td:nth-child(7) {
    width: 22%;
}

.audit-table {
    min-width: 860px;
}

.moderation-table form {
    margin: 0;
}

.moderation-action-form {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.moderation-action-form textarea {
    min-height: 52px;
}

.role-checks {
    background: #f8fafc;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    display: grid;
    gap: 4px;
    padding: 8px;
}

.action-stack {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-stack .button {
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
    white-space: normal;
    width: 100%;
}

.moderation-block-button {
    grid-column: 1 / -1;
}

.moderation-comment-hint {
    margin-top: -3px;
}

.dashboard-panel {
    overflow: hidden;
}

.auth-shell {
    display: grid;
    margin: 36px auto;
    max-width: 460px;
}

.auth-wide {
    max-width: 820px;
}

.auth-layout {
    align-items: stretch;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.8fr);
    margin: 40px auto;
    max-width: 980px;
}

.auth-intro {
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 420px;
    padding: 34px;
    position: relative;
}

.auth-intro::before {
    background: var(--accent);
    content: "";
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 5px;
}

.auth-intro h1 {
    font-size: 34px;
    line-height: 1.12;
    margin: 0;
}

.hero-brand {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    font-size: 15px;
    font-weight: 750;
    gap: 12px;
    margin-bottom: 18px;
}

.dashboard-brand {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-size: 13px;
    font-weight: 750;
    gap: 10px;
    margin: 0 0 8px;
}

.auth-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.auth-points span {
    background: #f4f6f9;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    color: #364152;
    font-size: 13px;
    font-weight: 750;
    padding: 7px 11px;
}

.auth-card {
    align-content: center;
    display: grid;
}

.form-panel h1 {
    margin-bottom: 18px;
}

.stack-form {
    display: grid;
    gap: 16px;
}

.resend-form {
    border-top: 1px solid var(--line-soft);
    margin-top: 18px;
    padding-top: 18px;
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-section {
    border-top: 1px solid var(--line-soft);
    padding-top: 16px;
}

.form-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.form-section h2 {
    margin-bottom: 4px;
}

label {
    color: #344054;
    display: grid;
    font-size: 13px;
    font-weight: 650;
    gap: 6px;
}

input,
select,
textarea {
    background: #fff;
    border: 1px solid #cbd2df;
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    min-height: 38px;
    padding: 8px 10px;
    width: 100%;
}

textarea {
    min-height: 86px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(197, 34, 42, 0.12);
    outline: none;
}

.checkbox-line {
    align-items: center;
    display: flex;
    gap: 8px;
    min-height: 38px;
}

.checkbox-line input {
    min-height: 0;
    width: auto;
}

.wide-form {
    width: 100%;
}

.hint-panel {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: #344054;
    padding: 14px;
}

.hint-panel p {
    margin: 6px 0 4px;
}

.excel-response-form {
    align-items: end;
    background: #f8fafc;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(260px, 1fr) auto;
    margin: 14px 0;
    padding: 12px;
}

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

.actions {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.list-panel {
    display: grid;
    gap: 0;
    padding: 0;
}

.list-row {
    align-items: center;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    min-height: 76px;
    padding: 16px 18px;
}

.list-row:last-child {
    border-bottom: 0;
}

.list-row-main {
    min-width: 0;
}

.row-meta {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 6px;
}

.row-meta span {
    align-items: center;
    display: inline-flex;
}

.row-meta span + span::before {
    color: #b5beca;
    content: "•";
    margin-right: 12px;
}

.row-side {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 10px;
}

.row-title {
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
}

.status {
    background: #eef1f5;
    border-radius: 999px;
    color: #344054;
    font-size: 13px;
    font-weight: 650;
    padding: 5px 10px;
    white-space: nowrap;
}

.status-success {
    background: #dff8e9;
    color: var(--success);
}

.status-warning {
    background: #fff3d8;
    color: var(--warning);
}

.status-danger {
    background: #fff1f0;
    color: var(--danger);
}

.empty-state {
    color: var(--muted);
    padding: 28px;
}

.compact-list {
    display: grid;
    gap: 0;
    margin-top: 12px;
}

.section-label {
    color: #3b4654;
    font-size: 12px;
    font-weight: 800;
    margin-top: 18px;
    text-transform: uppercase;
}

.compact-row {
    align-items: center;
    border-top: 1px solid var(--line-soft);
    color: var(--text);
    display: flex;
    gap: 14px;
    justify-content: space-between;
    min-height: 64px;
    padding: 12px 0;
}

.compact-row:hover {
    text-decoration: none;
}

.compact-row strong,
.compact-row small {
    display: block;
}

.compact-row strong {
    font-size: 15px;
    line-height: 1.25;
}

.compact-row small {
    color: var(--muted);
    margin-top: 4px;
}

.compact-empty {
    border-top: 1px solid var(--line-soft);
    padding: 18px 0 8px;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.data-table {
    border-collapse: collapse;
    min-width: 760px;
    width: 100%;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line-soft);
    padding: 11px 10px;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.data-table strong {
    display: block;
    font-weight: 750;
}

.table-actions {
    min-width: 96px;
    white-space: nowrap;
}

.cell-note {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

.ranking-table {
    min-width: 940px;
}

.row-highlight td {
    background: #eefbf4;
}

.row-highlight-soft td {
    background: #f5fbf7;
}

.row-muted td {
    background: #fafbfc;
    color: var(--muted);
}

.row-error td {
    background: #fff5f5;
}

.error-text {
    color: var(--danger);
    margin: 8px 0 0;
}

.rank-badge {
    align-items: center;
    background: var(--steel);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 12px;
    font-weight: 750;
    height: 28px;
    justify-content: center;
    min-width: 42px;
    padding: 0 9px;
}

.tag {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    margin: 2px 4px 2px 0;
    padding: 4px 8px;
    white-space: nowrap;
}

.tag-success {
    background: #dff8e9;
    color: var(--success);
}

.tag-info {
    background: #e7f0ff;
    color: #1f6feb;
}

.result-panel {
    border-color: #bfe8cf;
}

.result-grid {
    border-top: 1px solid var(--line-soft);
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    padding-top: 14px;
}

.result-grid article {
    border-left: 3px solid #bfe8cf;
    padding: 4px 0 4px 12px;
}

.result-grid span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.result-grid strong {
    color: var(--text);
    font-size: 16px;
}

.score-cell {
    align-items: center;
    display: grid;
    gap: 6px;
    grid-template-columns: 36px 110px;
}

.score-cell span {
    font-weight: 750;
}

.score-cell meter {
    height: 12px;
    width: 110px;
}

.edit-table input,
.edit-table select,
.edit-table textarea {
    min-width: 120px;
}

.import-edit-table {
    min-width: 1040px;
}

.logistics-edit-table {
    min-width: 1480px;
}

.errorlist {
    color: var(--danger);
    font-size: 12px;
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
}

@media (max-width: 820px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 14px 18px;
    }

    .nav {
        flex-wrap: wrap;
        gap: 12px;
    }

    .page {
        padding: 22px 14px 44px;
    }

    .page-head,
    .panel-head,
    .notice-panel,
    .list-row {
        align-items: stretch;
        flex-direction: column;
    }

    .metrics-grid,
    .lot-overview,
    .workspace-grid,
    .profile-grid,
    .auth-layout,
    .form-grid,
    .excel-response-form {
        grid-template-columns: 1fr;
    }

    .detail-list div {
        grid-template-columns: 1fr;
    }

    .auth-intro {
        min-height: auto;
        padding: 24px;
    }

    .button {
        width: 100%;
    }

    .compact-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .row-side {
        align-items: stretch;
        flex-direction: column;
    }

    .row-meta {
        display: grid;
        gap: 4px;
    }

    .row-meta span + span::before {
        content: "";
        margin: 0;
    }
}
