@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700;800&family=The+Nautigal:wght@400;700&display=swap');

:root {
    --bg: #111112;
    --panel: #181617;
    --panel-soft: #20191a;
    --line: rgba(255, 214, 190, 0.12);
    --line-strong: rgba(255, 174, 117, 0.24);
    --text: #f6f0ec;
    --muted: #aa9d98;
    --soft: #d7b0a5;
    --accent: #ff9d45;
    --accent-red: #7b1d18;
    --accent-red-2: #4a0d10;
    --green: #8fc9a4;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 88% 8%, rgba(127, 28, 22, 0.24), transparent 34%),
        radial-gradient(circle at 18% 94%, rgba(255, 135, 45, 0.10), transparent 30%),
        var(--bg);
    font-family: 'Noto Sans', Arial, sans-serif;
}

body:not(.is-authenticated) {
    overflow: hidden;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

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

body:not(.is-authenticated) .admin-shell {
    filter: blur(10px);
    pointer-events: none;
    user-select: none;
}

.login-screen {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 18% 24%, rgba(129, 27, 21, 0.38), transparent 34%),
        radial-gradient(circle at 82% 82%, rgba(255, 141, 47, 0.14), transparent 32%),
        rgba(9, 8, 9, 0.88);
}

body.is-authenticated .login-screen {
    display: none;
}

.login-card {
    width: min(460px, 100%);
    padding: 34px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(28, 21, 22, 0.98), rgba(13, 12, 13, 0.98));
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.login-brand {
    margin-bottom: 30px;
}

.login-card h1 {
    margin-bottom: 22px;
}

.login-card .primary-btn {
    width: 100%;
    margin-top: 4px;
}

.login-error {
    min-height: 18px;
    margin: -4px 0 12px;
    color: #ffb68e;
    font-size: 12px;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 30px 22px;
    border-right: 1px solid var(--line);
    background: rgba(14, 13, 14, 0.82);
    backdrop-filter: blur(14px);
}

.brand {
    display: block;
    margin-bottom: 34px;
    color: var(--text);
    text-decoration: none;
    overflow: visible;
}

.brand span {
    display: block;
    width: 100%;
    padding-left: 3px;
    font-family: 'The Nautigal', cursive;
    font-size: 58px;
    line-height: 44px;
    font-weight: 400;
    background: linear-gradient(105deg, #fff, #ffe2bd 30%, #ff9b32 48%, #e94018 62%, #fff);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

.side-nav {
    display: grid;
    gap: 7px;
}

.side-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    transition: 180ms ease;
}

.side-nav a:hover,
.side-nav a.is-active {
    color: #fff;
    border-color: var(--line-strong);
    background: linear-gradient(135deg, rgba(72, 15, 15, 0.60), rgba(32, 25, 26, 0.86));
    box-shadow: 0 0 22px rgba(255, 118, 38, 0.08);
}

.sidebar-footer {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 24px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 16px rgba(143, 201, 164, 0.48);
}

.main {
    min-width: 0;
    padding: 30px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

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

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(30px, 4vw, 54px);
    line-height: 1;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 0;
    font-size: 18px;
}

h3 {
    margin-bottom: 12px;
    font-size: 15px;
}

.topbar-actions,
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-user {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.notification-pill {
    padding: 9px 12px;
    border: 1px solid rgba(255, 157, 69, 0.42);
    border-radius: 999px;
    color: var(--soft);
    background: rgba(255, 157, 69, 0.08);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.primary-btn,
.ghost-btn,
.soft-btn,
.icon-btn {
    min-height: 42px;
    border-radius: 6px;
    border: 1px solid var(--line);
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    transition: 180ms ease;
}

.primary-btn,
.ghost-btn,
.soft-btn {
    padding: 0 18px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-red-2), var(--accent-red), #a83b1e);
    border-color: rgba(255, 151, 67, 0.18);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.primary-btn:hover,
.soft-btn:hover,
.ghost-btn:hover,
.icon-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 169, 95, 0.28);
    box-shadow: 0 0 28px rgba(255, 112, 33, 0.10);
}

.view {
    display: none;
}

.view.is-active {
    display: block;
}

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

.metric-card,
.panel {
    border: 1px solid rgba(255, 157, 69, 0.24);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(29, 24, 25, 0.94), rgba(17, 16, 17, 0.94));
    box-shadow: var(--shadow);
}

.metric-card {
    padding: 18px;
}

.metric-card span,
.panel-head span,
.helper,
.upload-card p {
    color: var(--muted);
    font-size: 12px;
}

.metric-card strong {
    display: block;
    margin-top: 14px;
    font-size: 34px;
    line-height: 1;
}

.dashboard-grid,
.editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 18px;
}

.mailbox-panel {
    max-height: 520px;
    overflow: hidden;
    border-color: rgba(255, 157, 69, 0.42);
}

.mailbox-panel .message-list {
    max-height: 382px;
    overflow: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 157, 69, 0.78) rgba(255, 255, 255, 0.08);
}

.mailbox-panel .message-list::-webkit-scrollbar {
    width: 10px;
}

.mailbox-panel .message-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 157, 69, 0.78);
}

.panel {
    padding: 20px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.quick-preview,
.upload-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.preview-frame,
.upload-card img,
.upload-card video {
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #0d0d0e;
}

.preview-frame {
    aspect-ratio: 4 / 5;
}

.preview-frame img,
.upload-card img,
.upload-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upload-card img,
.upload-card video {
    aspect-ratio: 1 / 1;
}

.media-edit-card {
    grid-template-columns: 150px minmax(0, 1fr);
    margin-bottom: 16px;
}

.check-list {
    display: grid;
    gap: 13px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.check-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--soft);
    font-size: 14px;
}

.check-list span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 157, 69, 0.42);
    background: radial-gradient(circle, rgba(255, 157, 69, 0.8) 0 35%, transparent 38%);
}

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

.message-item {
    position: relative;
    display: grid;
    gap: 8px;
    padding: 16px;
    padding-right: 44px;
    border: 1px solid rgba(255, 157, 69, 0.2);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
}

.message-item.is-unread {
    border-color: rgba(255, 157, 69, 0.62);
    background: linear-gradient(145deg, rgba(255, 157, 69, 0.16), rgba(255, 255, 255, 0.035));
    box-shadow: 0 0 24px rgba(255, 157, 69, 0.08);
}

.message-item.is-replied {
    border-color: rgba(143, 201, 164, 0.28);
    background: linear-gradient(145deg, rgba(143, 201, 164, 0.08), rgba(255, 255, 255, 0.025));
}

.message-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 214, 190, 0.14);
    border-radius: 50%;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font-size: 18px;
    line-height: 1;
    transition: 160ms ease;
}

.message-delete:hover {
    color: #fff;
    border-color: rgba(255, 157, 69, 0.56);
    background: rgba(255, 157, 69, 0.14);
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.message-meta strong {
    font-size: 13px;
}

.message-meta time,
.message-item a,
.message-item p {
    color: var(--muted);
    font-size: 12px;
}

.message-item a {
    width: fit-content;
}

.message-item p {
    margin: 0;
    line-height: 1.5;
    color: var(--soft);
}

.message-actions {
    display: flex;
    justify-content: flex-end;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(143, 201, 164, 0.36);
    border-radius: var(--radius);
    color: #c5f2d4;
    background: rgba(143, 201, 164, 0.08);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-side-panel {
    min-height: 360px;
}

.today-overview {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.today-overview div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 157, 69, 0.2);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.035);
}

.today-overview span {
    color: var(--muted);
    font-size: 12px;
}

.today-overview strong {
    font-size: 26px;
}

.full-btn {
    width: 100%;
}

.mail-template-box {
    margin-bottom: 16px;
}

.reply-card {
    width: min(720px, 100%);
}

.confirm-card {
    width: min(520px, 100%);
}

.analytics-summary {
    display: grid;
    gap: 12px;
}

.analytics-summary div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 157, 69, 0.2);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.035);
}

.analytics-summary span {
    color: var(--muted);
    font-size: 12px;
}

.analytics-summary strong {
    font-size: 24px;
}

.analytics-chart {
    min-height: 360px;
    padding: 12px;
    border: 1px solid rgba(255, 157, 69, 0.18);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 157, 69, 0.06), transparent 42%),
        rgba(255, 255, 255, 0.024);
}

.xy-chart {
    width: 100%;
    height: auto;
    min-height: 330px;
    overflow: visible;
}

.axis,
.chart-guide {
    stroke: rgba(255, 255, 255, 0.18);
    stroke-width: 1;
}

.axis {
    stroke: rgba(255, 226, 189, 0.54);
    stroke-width: 1.4;
}

.axis + path,
marker path {
    fill: rgba(255, 226, 189, 0.72);
}

.chart-guide {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-dasharray: 3 8;
}

.chart-grid {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
}

.chart-area {
    fill: url(#visitArea);
}

.chart-line {
    fill: none;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 8px rgba(255, 157, 69, 0.22));
    stroke-dasharray: 760;
    stroke-dashoffset: 760;
    animation: chartDraw 1.2s ease forwards;
}

.chart-line-visits {
    stroke: rgba(255, 157, 69, 0.96);
}

.chart-line-visitors {
    stroke: rgba(255, 226, 189, 0.62);
    stroke-width: 2;
    animation-delay: 120ms;
}

.chart-point {
    fill: #ff9d45;
    stroke: rgba(255, 237, 213, 0.95);
    stroke-width: 2;
}

.chart-point-secondary {
    fill: #ffe2bd;
    stroke: rgba(255, 157, 69, 0.64);
}

.chart-value {
    fill: #fff;
    font-size: 13px;
    font-weight: 800;
}

.chart-label,
.chart-axis-label,
.chart-legend text {
    fill: var(--muted);
    font-size: 10px;
}

.chart-legend text {
    font-size: 11px;
    font-weight: 700;
}

@keyframes chartDraw {
    to {
        stroke-dashoffset: 0;
    }
}

label {
    display: grid;
    gap: 8px;
    margin-bottom: 15px;
    color: var(--soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: none;
    padding: 13px 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.045);
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(255, 157, 69, 0.45);
    box-shadow: 0 0 0 3px rgba(255, 157, 69, 0.08);
}

input[type="file"] {
    padding: 11px;
    color: var(--muted);
}

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

.media-list {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.media-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 42px;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.035);
}

.media-row img {
    width: 72px;
    height: 54px;
    border-radius: 5px;
    object-fit: cover;
}

.media-row strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.media-row span {
    color: var(--muted);
    font-size: 11px;
}

.row-fields,
.card-fields {
    display: grid;
    gap: 8px;
}

.inline-field {
    gap: 5px;
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.7px;
}

.inline-field input {
    min-height: 34px;
    padding: 8px 9px;
    font-size: 12px;
}

.inline-field select {
    min-height: 34px;
    padding: 8px 9px;
    font-size: 12px;
}

.icon-btn {
    width: 38px;
    min-height: 38px;
    padding: 0;
}

.category-bar {
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid rgba(255, 157, 69, 0.2);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.028);
}

.category-bar-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.category-bar-label {
    color: var(--soft);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.category-bar-hint {
    color: var(--muted);
    font-size: 11px;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 34px;
    margin-bottom: 12px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255, 157, 69, 0.28);
    border-radius: 999px;
    color: var(--soft);
    background: rgba(255, 157, 69, 0.08);
    font-size: 12px;
    font-weight: 700;
}

.category-chip.is-system {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
}

.category-chip small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.category-chip-remove {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-left: 2px;
    padding: 0;
    border: 1px solid rgba(255, 214, 190, 0.18);
    border-radius: 50%;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    font-size: 14px;
    line-height: 1;
    transition: 160ms ease;
}

.category-chip-remove:hover {
    color: #fff;
    border-color: rgba(255, 157, 69, 0.56);
    background: rgba(255, 157, 69, 0.16);
}

.category-add {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-add input {
    flex: 1;
    min-width: 0;
    max-width: 320px;
    min-height: 42px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.045);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.category-add input::placeholder {
    color: var(--muted);
}

.category-add .soft-btn {
    flex-shrink: 0;
}

.toolbar {
    justify-content: space-between;
    margin-bottom: 16px;
}

.toolbar input {
    max-width: 360px;
}

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

.art-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.035);
}

.art-card img,
.media-card img,
.media-card video {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.art-card .art-card-body {
    padding: 13px;
}

.art-card strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.art-card span {
    color: var(--muted);
    font-size: 12px;
}

.art-card .card-fields {
    padding: 0 13px 13px;
}

.art-card .icon-btn {
    margin: 0 13px 13px;
    width: calc(100% - 26px);
}

.note {
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 157, 69, 0.18);
    background: rgba(98, 30, 20, 0.18);
}

.note p {
    margin-bottom: 0;
    color: var(--soft);
    line-height: 1.7;
}

.dropzone {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 150px;
    margin-bottom: 18px;
    border: 1px dashed rgba(255, 174, 117, 0.32);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.035);
    text-align: center;
}

.dropzone input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.dropzone span {
    color: var(--muted);
    font-size: 12px;
}

.media-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.modal-backdrop {
    position: fixed;
    z-index: 60;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 7, 8, 0.74);
    backdrop-filter: blur(14px);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(1040px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
    scrollbar-gutter: stable;
    scrollbar-width: auto;
    scrollbar-color: rgba(255, 157, 69, 0.92) rgba(255, 255, 255, 0.12);
    padding: 22px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(31, 24, 25, 0.98), rgba(13, 12, 13, 0.98));
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.modal-card::-webkit-scrollbar {
    width: 14px;
}

.modal-card::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
}

.modal-card::-webkit-scrollbar-thumb {
    background: rgba(255, 157, 69, 0.88);
    border-radius: 20px;
    border: 3px solid rgba(22, 18, 19, 0.98);
}

.modal-card .panel-head {
    margin-bottom: 18px;
}

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

.modal-fields label:has(textarea) {
    grid-column: 1 / -1;
}

.modal-preview {
    margin: 0 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #0d0d0e;
}

.crop-frame {
    position: relative;
    width: 100%;
    height: min(58vh, 520px);
    min-height: 360px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 6px;
    background:
        linear-gradient(45deg, rgba(255,255,255,0.04) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.04) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.04) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.04) 75%),
        #080808;
    background-size: 22px 22px;
    background-position: 0 0, 0 11px, 11px -11px, -11px 0;
    cursor: grab;
    touch-action: none;
}

.crop-frame.is-dragging {
    cursor: grabbing;
}

.crop-frame img {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: min(92%, 760px);
    max-height: calc(100% - 34px);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transform-origin: center;
    user-select: none;
    pointer-events: none;
}

.crop-window {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(82%, 760px);
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.56), inset 0 0 0 1px rgba(0, 0, 0, 0.26);
    pointer-events: none;
}

.crop-handle {
    position: absolute;
    z-index: 2;
    width: 18px;
    min-height: 18px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.42);
}

.crop-handle-nw,
.crop-handle-se {
    cursor: nwse-resize;
}

.crop-handle-ne,
.crop-handle-sw {
    cursor: nesw-resize;
}

.crop-handle-n,
.crop-handle-s {
    cursor: ns-resize;
}

.crop-handle-e,
.crop-handle-w {
    cursor: ew-resize;
}

.crop-window::before,
.crop-window::after {
    content: "";
    position: absolute;
    inset: 33.333% 0 auto;
    border-top: 1px solid rgba(255, 255, 255, 0.32);
    border-bottom: 1px solid rgba(255, 255, 255, 0.32);
    height: 33.333%;
}

.crop-window::after {
    inset: 0 33.333% 0 auto;
    width: 33.333%;
    height: auto;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.32);
    border-right: 1px solid rgba(255, 255, 255, 0.32);
}

.crop-controls {
    display: grid;
    grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-top: 1px solid var(--line);
}

.crop-controls[hidden] {
    display: none;
}

.crop-controls label {
    margin: 0;
}

.crop-controls input[type="range"] {
    padding: 0;
    accent-color: var(--accent);
}

.crop-helper {
    color: var(--muted);
    font-size: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.toast {
    position: fixed;
    right: 28px;
    bottom: 28px;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    padding: 13px 16px;
    border-radius: 6px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-red), #b84a22);
    box-shadow: var(--shadow);
    transition: 220ms ease;
}

.toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

[data-json-output] {
    min-height: 330px;
    color: #e7cec6;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

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

    .sidebar {
        position: relative;
        height: auto;
        padding-bottom: 20px;
    }

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

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

    .metric-grid,
    .artwork-grid,
    .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .main {
        padding: 20px;
    }

    .topbar,
    .topbar-actions,
    .toolbar-actions,
    .dashboard-grid,
    .editor-grid,
    .widget-columns,
    .modal-fields,
    .quick-preview,
    .upload-card {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .metric-grid,
    .artwork-grid,
    .media-grid,
    .side-nav {
        grid-template-columns: 1fr;
    }

    .category-bar-head,
    .category-add {
        flex-direction: column;
        align-items: stretch;
    }

    .category-add input {
        max-width: none;
    }
}
