:root {
    color-scheme: light;
    font-family: "DM Sans", "Inter", "Segoe UI", Arial, Helvetica, sans-serif;
    --ink: #1c1510;
    --muted: #746b63;
    --paper: #fffaf3;
    --line: #ded2c3;
    --surface: #f1ece6;
    --night: #2a2520;
    --night-soft: #312b26;
    --accent: #8c6a3f;
    --accent-strong: #7b5d37;
    --accent-soft: #eadfce;
    --accent-rgb: 140, 106, 63;
    --blue-mark: #172d44;
    --danger: #b42318;
    --success: #16794c;
    background: var(--surface);
    color: var(--ink);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--surface);
}

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

a:hover {
    text-decoration: underline;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), transparent 42%),
        var(--surface);
}

.login-box {
    width: min(420px, 100%);
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 22px 58px rgba(28, 21, 16, 0.13);
}

.login-logo {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin: 0 auto 18px;
}

.login-box h1 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 24px;
    line-height: 1.15;
    text-align: center;
}

.login-kicker {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

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

.sidebar {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    padding: 24px 18px;
    color: #f2ede6;
    background:
        linear-gradient(180deg, rgba(var(--accent-rgb), 0.18), transparent 190px),
        var(--night);
    box-shadow: 10px 0 34px rgba(28, 21, 16, 0.22);
}

.brand {
    display: grid;
    gap: 8px;
    padding: 0 8px 24px;
    border-bottom: 1px solid rgba(242, 237, 230, 0.14);
    text-align: center;
}

.brand-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin: 0 auto 8px;
    padding: 10px;
    border: 1px solid rgba(var(--accent-rgb), 0.34);
    border-radius: 8px;
    background: #f1ece6;
}

.brand strong {
    color: #f2ede6;
    font-size: 15px;
}

.brand span {
    color: rgba(242, 237, 230, 0.68);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.side-nav {
    display: grid;
    align-content: start;
    gap: 10px;
    padding-top: 20px;
}

.side-nav a {
    display: block;
    padding: 12px;
    border-radius: 6px;
    color: rgba(242, 237, 230, 0.84);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.side-nav .dashboard-link {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 14px 12px;
    color: var(--accent);
    text-align: center;
}

.dashboard-link img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: invert(45%) sepia(19%) saturate(814%) hue-rotate(357deg) brightness(91%) contrast(86%);
    opacity: 1;
}

.dashboard-link span {
    display: block;
}

.nav-group {
    display: grid;
    gap: 3px;
}

.nav-heading {
    padding: 10px 12px 4px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-heading-visual {
    display: flex;
    align-items: center;
    gap: 9px;
}

.nav-heading-visual img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: invert(1) brightness(1.15);
    opacity: 0.9;
}

.nav-group a {
    position: relative;
    margin-left: 10px;
    padding: 8px 12px 8px 30px;
    border-radius: 6px;
    color: rgba(242, 237, 230, 0.72);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.nav-group a::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    width: 7px;
    height: 7px;
    border: 1px solid rgba(242, 237, 230, 0.42);
    border-radius: 999px;
    transform: translateY(-50%);
}

.side-nav a:hover,
.side-nav a.active {
    color: #f2ede6;
    background: rgba(var(--accent-rgb), 0.18);
    text-decoration: none;
}

.side-nav .dashboard-link:hover,
.side-nav .dashboard-link.active {
    color: var(--accent);
}

.nav-group a.active::before {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18);
}

.sidebar-user {
    display: grid;
    gap: 8px;
    padding: 16px 8px 0;
    border-top: 1px solid rgba(242, 237, 230, 0.14);
    font-size: 14px;
}

.sidebar-user span {
    font-weight: 800;
}

.sidebar-user a {
    color: rgba(242, 237, 230, 0.76);
}

.content {
    min-width: 0;
    padding: 30px 36px 56px;
}

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

.content-head h1 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 28px;
    line-height: 1.15;
}

.page-title-with-icon {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title-with-icon img {
    width: 66px;
    height: 66px;
    object-fit: contain;
    flex: 0 0 auto;
}

.content-head p {
    margin: 0;
    color: var(--muted);
}

.panel,
.stat,
.login-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.panel {
    padding: 22px;
    box-shadow: 0 14px 34px rgba(28, 21, 16, 0.07);
}

.compact-panel {
    padding: 14px 16px;
}

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

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

.stat {
    padding: 18px;
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stat strong {
    display: block;
    margin-top: 8px;
    color: var(--ink);
    font-size: 30px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

form {
    display: grid;
    gap: 14px;
}

.filter-bar {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-bar label {
    min-width: min(360px, 100%);
}

.inline-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

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

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d8cab9;
    border-radius: 6px;
    background: #fffdf8;
    color: var(--ink);
    font: inherit;
}

input,
select {
    min-height: 42px;
}

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

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(140, 106, 63, 0.22);
    border-color: var(--accent);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
}

.check-row input {
    width: 18px;
    min-height: 18px;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--night);
    color: #f2ede6;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.button.secondary,
button.secondary {
    background: var(--accent-soft);
    color: #4f3b22;
}

button:hover,
.button:hover {
    text-decoration: none;
    filter: brightness(1.05);
}

.alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 6px;
    font-weight: 700;
}

.alert.error {
    background: #ffe9e7;
    color: var(--danger);
}

.alert.success {
    background: #e8f7ef;
    color: var(--success);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

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

th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #efe5d5;
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 800;
}

.badge.off {
    background: #f3e1df;
    color: var(--danger);
}

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

.logo-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px dashed #d8cab9;
    border-radius: 8px;
    background: #fffdf8;
}

.logo-preview img,
.table-logo {
    display: block;
    width: 58px;
    height: 58px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}

.garment-image-col {
    width: 150px;
}

.garment-name-col {
    width: 260px;
}

.garment-actions-col {
    width: 160px;
}

.garment-thumb {
    width: 128px;
    height: 128px;
    background: #fffdf8;
}

.garment-summary {
    max-width: 260px;
}

.garment-summary p {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.45;
}

.table-actions {
    display: grid;
    gap: 8px;
    align-items: start;
}

.table-button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
}

.pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.pagination span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.button.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.logo-preview span {
    color: var(--muted);
    font-size: 13px;
}

.theme-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.authenticity-preview {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
}

.authenticity-preview img,
.authenticity-placeholder {
    width: 96px;
    height: 96px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}

.authenticity-placeholder {
    display: grid;
    place-items: center;
    padding: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-align: center;
    text-transform: uppercase;
}

.authenticity-preview strong {
    display: block;
    color: var(--ink);
    font-size: 18px;
}

.authenticity-preview p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.badge-thumb {
    display: block;
    width: 86px;
    height: 86px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}

.badge-choice-field {
    display: grid;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.badge-choice-field legend {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.badge-choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.badge-choice-card {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
    cursor: pointer;
}

.badge-choice-card input {
    position: absolute;
    top: 8px;
    left: 8px;
    width: auto;
}

.badge-choice-card img {
    width: 92px;
    height: 92px;
    object-fit: contain;
}

.badge-choice-card span {
    color: var(--ink);
    font-size: 12px;
    font-weight: 850;
    text-align: center;
}

.badge-choice-card:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.pricing-card {
    display: grid;
    gap: 12px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 14px 34px rgba(28, 21, 16, 0.07);
}

.pricing-card > span {
    color: var(--accent);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pricing-card h2 {
    margin: 0;
    font-size: 22px;
}

.pricing-card > strong {
    color: var(--ink);
    font-size: 26px;
}

.pricing-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.pricing-card dl {
    gap: 8px;
    margin: 4px 0 0;
}

.pricing-card dl div {
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

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

.color-field {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.color-field input[type="color"] {
    width: 54px;
    height: 42px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.theme-preview {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.theme-preview-sidebar {
    padding: 18px;
    color: #f2ede6;
    background:
        linear-gradient(180deg, rgba(var(--accent-rgb), 0.22), transparent 160px),
        var(--night);
}

.theme-preview-card {
    padding: 18px;
    background: var(--surface);
}

.theme-preview-card-inner {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.swatch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.swatch {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.product-card-preview {
    display: grid;
    gap: 12px;
    max-width: 360px;
    margin: 0 auto;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
}

.pcp-top {
    display: flex;
    justify-content: center;
    min-height: 44px;
}

.pcp-top img {
    max-width: 142px;
    max-height: 44px;
    object-fit: contain;
}

.pcp-hero {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 210px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(var(--accent-rgb), 0.22), transparent 55%),
        var(--paper);
    color: var(--accent-strong);
    font-weight: 900;
}

.pcp-verified {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 20px);
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--night);
    color: var(--paper);
}

.pcp-verified img {
    width: 30px;
    height: 30px;
    padding: 4px;
    border-radius: 6px;
    background: var(--paper);
    object-fit: contain;
}

.pcp-verified span,
.pcp-meta span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.pcp-verified span {
    color: var(--accent-soft);
}

.pcp-verified strong {
    display: block;
    margin-top: 2px;
    font-size: 11px;
}

.pcp-passport,
.pcp-club {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.pcp-passport h3,
.pcp-club h3 {
    margin: 6px 0 12px;
    font-size: 18px;
    line-height: 1.2;
}

.pcp-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.pcp-meta div {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.pcp-meta strong {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

.pcp-club {
    background: var(--night);
    color: var(--paper);
    border-color: var(--accent);
}

.pcp-club .kicker {
    color: var(--accent-soft);
}

.pcp-club button {
    min-height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--paper);
    color: var(--night);
    font: inherit;
    font-weight: 900;
}

.order-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.calendar-weekday {
    min-height: 34px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.calendar-weekday.weekend {
    background: #f3e1df;
    color: var(--danger);
}

.order-day {
    min-height: 178px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.order-day.weekend {
    background: #fff6f5;
}

.order-day.today {
    outline: 3px solid rgba(var(--accent-rgb), 0.22);
    outline-offset: 2px;
}

.order-day-blank {
    min-height: 178px;
    border-style: dashed;
    background: transparent;
    opacity: 0.45;
}

.order-day.has-orders {
    border-color: var(--accent);
    box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.12);
}

.order-day header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    color: #f2ede6;
    background: var(--night);
}

.order-day.weekend header {
    background: var(--danger);
}

.order-day-total {
    padding: 10px 12px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    font-weight: 900;
}

.order-calendar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
}

.order-calendar-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-calendar-row small {
    grid-column: 1 / -1;
    width: fit-content;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 900;
}

.order-day-empty {
    margin: 0;
    padding: 14px 12px;
    color: var(--muted);
    font-size: 13px;
}

.subsection-head {
    display: grid;
    gap: 4px;
    padding-top: 8px;
}

.subsection-head h3 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
}

.subsection-head p {
    margin: 0;
    color: var(--muted);
}

.contact-list {
    display: grid;
    gap: 12px;
}

.contact-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.1fr 0.9fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
}

.artisan-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 210px;
}

.domain-input {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 260px;
}

.domain-input span {
    color: var(--muted);
    font-weight: 800;
}

code {
    padding: 3px 6px;
    border-radius: 5px;
    background: #efe5d5;
    color: var(--accent-strong);
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.image-card {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
}

.image-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    object-fit: cover;
}

.image-card strong,
.image-card span {
    display: block;
}

.image-card span,
.image-card p {
    color: var(--muted);
    font-size: 13px;
}

.image-card p {
    margin: 8px 0 0;
}

.image-archive-table {
    min-width: 980px;
}

.image-row-title {
    width: 230px;
}

.image-row-title strong,
.image-row-title span {
    display: block;
}

.image-row-title span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.image-strip {
    display: flex;
    gap: 12px;
    max-width: calc(100vw - 620px);
    overflow-x: auto;
    padding: 2px 0 8px;
}

.strip-image-card {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 8px;
    flex: 0 0 150px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
}

.strip-image-card img {
    width: 132px;
    height: 100px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    object-fit: cover;
}

.strip-image-card strong {
    display: block;
    min-height: 34px;
    font-size: 12px;
    line-height: 1.35;
}

.strip-image-card .badge {
    margin: 4px 0 8px;
}

.strip-image-card .table-button {
    width: 100%;
}

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

    .sidebar {
        position: relative;
        min-height: auto;
    }

    .content {
        padding: 24px 18px 42px;
    }

    .grid,
    .form-grid,
    .contact-row,
    .domain-input,
    .settings-layout,
    .pricing-grid {
        grid-template-columns: 1fr;
    }

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

    .order-calendar {
        grid-template-columns: repeat(7, minmax(130px, 1fr));
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .image-strip {
        max-width: 100%;
    }
}
