:root {
    --bg: #f3f5f8;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --sidebar: #101828;
    --sidebar-soft: #1d2939;
    --text: #1d2939;
    --muted: #667085;
    --border: #e4e7ec;
    --primary: #175cd3;
    --primary-hover: #1849a9;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --success: #067647;
    --success-bg: #ecfdf3;
    --radius: 14px;
    --shadow: 0 8px 30px rgba(16, 24, 40, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 24px 18px;
    color: #f2f4f7;
    background: var(--sidebar);
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0 8px 24px;
}

.brand span:last-child {
    display: grid;
    gap: 2px;
}

.brand small,
.user-summary small {
    color: #98a2b3;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 800;
    background: linear-gradient(145deg, #2e90fa, #175cd3);
    box-shadow: 0 8px 20px rgba(46, 144, 250, 0.3);
}

.brand-mark-large {
    width: 52px;
    height: 52px;
    border-radius: 16px;
}

.nav-list {
    display: grid;
    gap: 6px;
    overflow-y: auto;
}

.nav-link {
    padding: 11px 14px;
    border-radius: 9px;
    color: #d0d5dd;
}

.nav-link:hover,
.nav-link.is-active {
    color: #ffffff;
    background: var(--sidebar-soft);
}

.sidebar-footer {
    display: grid;
    gap: 14px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #344054;
}

.user-summary {
    display: grid;
    gap: 3px;
}

.main-content {
    min-width: 0;
    padding: 36px clamp(20px, 4vw, 54px) 60px;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1,
.login-heading h1,
.notice-card h2 {
    margin: 4px 0 0;
    line-height: 1.2;
}

.eyebrow {
    margin: 0;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.notice-card,
.panel,
.metric-card,
.login-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.notice-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
}

.notice-card p:last-child {
    max-width: 720px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.65;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.metric-card {
    display: grid;
    gap: 8px;
    padding: 22px;
}

.metric-card strong {
    font-size: 22px;
}

.metric-card small,
.metric-label,
.login-note,
.table-summary {
    color: var(--muted);
}

.panel {
    overflow: hidden;
}

.filter-bar {
    display: flex;
    align-items: end;
    gap: 14px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
}

.field {
    display: grid;
    gap: 7px;
    min-width: 180px;
}

.field-grow {
    flex: 1;
}

.field span {
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.field input,
.field select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    color: var(--text);
    background: #ffffff;
    outline: none;
}

.field input:focus,
.field select:focus {
    border-color: #84adff;
    box-shadow: 0 0 0 3px #d1e0ff;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 700;
    cursor: pointer;
}

.button-primary {
    color: #ffffff;
    background: var(--primary);
}

.button-primary:hover {
    background: var(--primary-hover);
}

.button-danger {
    color: #ffffff;
    background: var(--danger);
}

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

.button-ghost {
    border-color: #d0d5dd;
    color: #344054;
    background: transparent;
}

.sidebar .button-ghost {
    border-color: #475467;
    color: #ffffff;
}

.button-block {
    width: 100%;
}

.table-summary {
    display: flex;
    justify-content: space-between;
    padding: 14px 20px;
    font-size: 14px;
}

.admin-notice {
    padding: 14px 20px;
    border-bottom: 1px solid #fedf89;
    color: #93370d;
    background: #fffaeb;
}

.admin-action-bar {
    display: flex;
    align-items: end;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: #f9fafb;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 16px;
    border-top: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

th {
    color: #475467;
    font-size: 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: #fcfcfd;
}

td {
    font-size: 14px;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-right {
    text-align: right;
}

.mono {
    font-family: "SFMono-Regular", Consolas, monospace;
}

.image-cell {
    width: 56px;
    text-align: center;
}

.catalog-thumbnail {
    display: block;
    max-width: 64px;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 5px;
    background: #f2f4f7;
}

.item-gallery {
    display: flex;
    flex-wrap: wrap;
    min-width: 180px;
    gap: 5px;
}

.badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    color: var(--success);
    background: var(--success-bg);
}

.badge-muted {
    color: #475467;
    background: #f2f4f7;
}

.empty-state {
    padding: 40px;
    color: var(--muted);
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: space-between;
    padding: 18px 20px;
    border-top: 1px solid var(--border);
}

.guest-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(46, 144, 250, 0.18), transparent 32%),
        radial-gradient(circle at 80% 80%, rgba(23, 92, 211, 0.14), transparent 30%),
        var(--bg);
}

.guest-shell {
    width: min(440px, 100%);
}

.login-card {
    padding: 30px;
}

.login-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 26px;
}

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

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 9px;
}

.alert-error {
    border: 1px solid #fecdca;
    color: var(--danger);
    background: var(--danger-bg);
}

.login-note {
    margin: 20px 0 0;
    font-size: 13px;
    text-align: center;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .nav-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar-footer {
        margin-top: 20px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 24px 14px 40px;
    }

    .notice-card,
    .filter-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-submit {
        width: 100%;
    }

    .login-card {
        padding: 22px;
    }
}
