:root {
    --ink: #17221f;
    --muted: #6d7774;
    --paper: #fff;
    --bg: #f3f6f4;
    --line: #dce3df;
    --teal: #0d5c59;
    --teal-dark: #073f3d;
    --lime: #d9f068;
    --red: #b94f32;
    --font: "DM Sans", Arial, sans-serif;
    --display: "Manrope", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: var(--font); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; stroke-width: 1.8; }
h1, h2 { margin: 0; font-family: var(--display); line-height: 1.1; letter-spacing: 0; }
p { color: var(--muted); }
.eyebrow { color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 245px; padding: 24px 16px; display: flex; flex-direction: column; color: #d8e2df; background: #101917; }
.admin-brand { padding: 0 10px 30px; display: flex; align-items: center; gap: 10px; color: white; }
.admin-brand > span { width: 45px; height: 39px; display: grid; place-items: center; color: var(--teal-dark); background: var(--lime); font: 800 15px/1 var(--display); }
.admin-brand div { display: grid; }
.admin-brand strong { font: 800 14px/1.2 var(--display); }
.admin-brand small { color: #7d8985; font-size: 9px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.admin-sidebar nav { display: grid; gap: 4px; }
.admin-sidebar nav a, .sidebar-bottom a, .sidebar-bottom button { width: 100%; min-height: 45px; padding: 0 12px; display: flex; align-items: center; gap: 11px; border: 0; color: #9eaaa6; background: transparent; font-size: 13px; font-weight: 700; text-align: left; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active, .sidebar-bottom a:hover, .sidebar-bottom button:hover { color: white; background: #21302c; }
.admin-sidebar nav a.active { box-shadow: inset 3px 0 var(--lime); }
.admin-sidebar nav b { min-width: 21px; height: 21px; margin-left: auto; display: grid; place-items: center; color: var(--teal-dark); background: var(--lime); border-radius: 50%; font-size: 10px; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid #293531; }
.sidebar-bottom form { margin: 0; }
.admin-main { min-height: 100vh; margin-left: 245px; }
.admin-topbar { height: 92px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; background: white; border-bottom: 1px solid var(--line); }
.admin-topbar > div:first-of-type { display: grid; }
.admin-topbar > div:first-of-type span { color: var(--muted); font-size: 11px; }
.admin-topbar h1 { margin-top: 4px; font-size: 24px; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user > span { width: 37px; height: 37px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 50%; font-weight: 800; }
.admin-user div { display: grid; font-size: 12px; }
.admin-user small { color: var(--muted); }
.mobile-nav { display: none; }
.admin-content { max-width: 1480px; margin: auto; padding: 34px; }
.admin-actions { min-height: 54px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-actions p { margin: 4px 0 0; font-size: 13px; }
.admin-button { min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: white; font-size: 12px; font-weight: 800; }
.admin-button.primary { border-color: var(--teal); color: white; background: var(--teal); }
.admin-button.full { width: 100%; margin-top: 10px; }
.stat-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { min-height: 125px; padding: 22px; display: flex; align-items: center; justify-content: space-between; background: white; border: 1px solid var(--line); }
.stat-card div { display: grid; }
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card strong { margin-top: 8px; font: 800 28px/1 var(--display); }
.stat-card > svg { width: 36px; height: 36px; padding: 8px; color: var(--teal); background: #e9f4f1; }
.dashboard-grid { display: grid; grid-template-columns: 1.45fr .75fr; gap: 22px; }
.panel { background: white; border: 1px solid var(--line); }
.panel-heading { min-height: 78px; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 17px; }
.panel-heading p { margin: 4px 0 0; font-size: 11px; }
.panel-heading a { color: var(--teal); font-size: 11px; font-weight: 800; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 11px 16px; color: var(--muted); background: #f8faf9; font-size: 10px; letter-spacing: .7px; text-align: left; text-transform: uppercase; }
td { padding: 15px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
td small { display: block; margin-top: 3px; color: var(--muted); }
.strong-link { font-weight: 800; }
.strong-link:hover { color: var(--teal); }
.status { display: inline-flex; padding: 5px 8px; border-radius: 20px; font-size: 9px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.status-new { color: #8a4a13; background: #fff0dc; }
.status-confirmed { color: #2253a5; background: #e9f0ff; }
.status-ready { color: #684aa8; background: #f0eaff; }
.status-completed { color: #0a6550; background: #e3f5ee; }
.status-cancelled { color: #9b3427; background: #ffebe7; }
.stock-list { padding: 8px 20px; }
.stock-list a { padding: 12px 0; display: grid; grid-template-columns: 48px 1fr 34px; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.stock-list img { width: 48px; height: 48px; object-fit: cover; }
.stock-list span { display: grid; font-size: 11px; }
.stock-list small { color: var(--muted); }
.stock-list b, .stock-pill { display: inline-grid; place-items: center; min-width: 30px; height: 25px; padding: 0 6px; color: var(--teal); background: #e3f5ee; border-radius: 3px; }
.stock-list b.out, .stock-pill.low { color: var(--red); background: #ffebe7; }
.admin-search { position: relative; width: min(420px, 100%); }
.admin-search svg { position: absolute; top: 12px; left: 13px; color: var(--muted); }
.admin-search input { padding-left: 42px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: white; outline: none; }
input, select { height: 43px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,92,89,.1); }
.product-cell { min-width: 260px; display: flex; align-items: center; gap: 12px; }
.product-cell img { width: 54px; height: 54px; object-fit: cover; background: var(--bg); }
.product-cell span { display: grid; }
.icon-action { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); }
.icon-action:hover { color: white; background: var(--teal); border-color: var(--teal); }
.table-empty { padding: 40px !important; color: var(--muted); text-align: center; }
.editor-layout { display: grid; grid-template-columns: 1fr 330px; align-items: start; gap: 22px; }
.editor-main, .editor-side { display: grid; gap: 18px; }
.form-panel { padding-bottom: 22px; }
.form-panel > label, .form-panel > .form-grid { margin: 18px 22px 0; }
.form-panel label { display: grid; gap: 7px; color: var(--ink); font-size: 11px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.switch-row { padding: 4px 0 14px; display: grid !important; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--line); }
.switch-row span { display: grid; }
.switch-row small { color: var(--muted); font-weight: 400; }
.switch-row input { width: 18px; height: 18px; }
.image-preview { width: calc(100% - 44px); height: 210px; margin: 18px 22px 0; object-fit: cover; background: var(--bg); }
.file-input { min-height: 90px; padding: 17px; grid-template-columns: auto 1fr; align-items: center; border: 1px dashed #aeb9b5; cursor: pointer; }
.file-input span { display: grid; }
.file-input small { color: var(--muted); font-weight: 400; }
.file-input input { display: none; }
.danger-zone { margin-top: 22px; padding: 20px; display: flex; justify-content: end; border: 1px solid #edcbc4; background: #fff7f5; }
.danger-zone button { display: inline-flex; align-items: center; gap: 7px; border: 0; color: var(--red); background: transparent; font-weight: 800; }
.filter-tabs { display: flex; align-items: center; gap: 6px; overflow-x: auto; }
.filter-tabs a { padding: 8px 12px; border: 1px solid var(--line); background: white; font-size: 11px; font-weight: 800; white-space: nowrap; }
.filter-tabs a.active { color: white; background: var(--teal); border-color: var(--teal); }
.detail-header { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; }
.detail-header > a { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.order-detail-grid { display: grid; grid-template-columns: 1fr 340px; align-items: start; gap: 22px; }
.order-detail-grid > div { display: grid; gap: 18px; }
.order-lines, .totals { padding: 5px 22px 20px; }
.order-lines > div, .totals > div { padding: 15px 0; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.order-lines span { display: grid; font-size: 12px; }
.order-lines small { color: var(--muted); }
.totals > div:last-child { border: 0; font-size: 18px; }
.info-grid { padding: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.info-grid div { display: grid; }
.info-grid span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.info-grid strong, .info-grid a { margin-top: 4px; font-size: 13px; }
.info-grid .wide { grid-column: 1 / -1; }
.inquiry-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.inquiry-card { padding: 24px; }
.inquiry-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.inquiry-card h2 { margin-top: 20px; font-size: 20px; }
.inquiry-card > span { color: var(--muted); font-size: 12px; }
.inquiry-card p { min-height: 75px; white-space: normal; }
.inquiry-links { display: flex; flex-wrap: wrap; gap: 14px; }
.inquiry-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font-size: 11px; font-weight: 700; }
.inquiry-card form { margin-top: 20px; padding-top: 18px; display: grid; grid-template-columns: 1fr auto; gap: 8px; border-top: 1px solid var(--line); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 22px; }
.alert { margin-bottom: 16px; padding: 12px 15px; color: white; font-size: 12px; font-weight: 700; }
.alert-success { background: var(--teal); }
.alert-error { background: var(--red); }

.login-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0d5c59 0 36%, #101917 36% 100%); }
.login-shell { width: min(460px, calc(100% - 30px)); }
.login-brand { margin-bottom: 18px; display: flex; align-items: center; gap: 10px; color: white; }
.login-brand > span { width: 48px; height: 42px; display: grid; place-items: center; color: var(--teal-dark); background: var(--lime); font: 800 15px/1 var(--display); }
.login-brand div { display: grid; }
.login-brand strong { font: 800 15px/1.2 var(--display); }
.login-brand small { color: #a7b2ae; font-size: 9px; text-transform: uppercase; }
.login-card { padding: 42px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.login-card h1 { margin: 8px 0 0; font-size: 36px; }
.login-card > p { margin-bottom: 26px; font-size: 13px; }
.login-card form { display: grid; gap: 17px; }
.login-card label { display: grid; gap: 6px; font-size: 11px; font-weight: 800; }
.login-card button { height: 48px; border: 0; color: white; background: var(--teal); font-weight: 800; }
.login-note { display: block; margin-top: 20px; color: var(--muted); }
.back-link { display: inline-block; margin-top: 18px; color: white; font-size: 12px; }

@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .admin-sidebar { left: -245px; transition: left .2s; }
    .admin-menu-open .admin-sidebar { left: 0; }
    .admin-main { margin-left: 0; }
    .admin-topbar { height: 78px; padding: 0 17px; justify-content: flex-start; gap: 14px; }
    .mobile-nav { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); background: white; }
    .admin-user { margin-left: auto; }
    .admin-user div { display: none; }
    .admin-content { padding: 20px 14px; }
    .admin-actions { align-items: stretch; flex-direction: column; }
    .admin-actions .admin-button { align-self: flex-start; }
    .stat-grid, .editor-layout, .order-detail-grid, .inquiry-grid, .settings-grid { grid-template-columns: 1fr; }
    .form-grid, .form-grid.three { grid-template-columns: 1fr; }
    .login-card { padding: 30px 22px; }
}

.product-order-status {
    margin-left: auto;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}
.product-order-status.is-saved { color: var(--teal); }
.product-order-status.is-error { color: var(--red); }
.category-filter-bar {
    margin-bottom: 18px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.category-filter-bar a {
    min-height: 40px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.category-filter-bar a:hover { color: var(--ink); border-color: #b8b8b8; }
.category-filter-bar a.active { color: white; border-color: #303030; background: #303030; }
.category-filter-bar b {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    border-radius: 20px;
    background: #ededed;
    color: var(--ink);
    font-size: 10px;
}
.category-filter-bar a.active b { background: #565656; color: white; }
.category-link { color: var(--ink); text-decoration: underline; text-decoration-color: #bbb; text-underline-offset: 3px; }
.category-link:hover { color: var(--teal); text-decoration-color: var(--teal); }
.order-buttons { display: inline-flex; gap: 4px; }
.order-buttons form { margin: 0; }
.order-buttons button {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: white;
}
.order-buttons button:hover:not(:disabled) { color: white; border-color: var(--teal); background: var(--teal); }
.order-buttons button:disabled { cursor: default; opacity: .3; }
.category-cell { min-width: 260px; display: flex; align-items: center; gap: 12px; }
.category-cell img, .category-image-placeholder {
    width: 62px;
    height: 48px;
    flex: 0 0 auto;
    border-radius: 5px;
    object-fit: cover;
    background: var(--bg);
}
.category-image-placeholder { display: grid; place-items: center; color: var(--muted); }
.category-cell > span:last-child { display: grid; }
.category-cell small { margin-top: 4px; color: var(--muted); }
.category-product-count { color: var(--teal); font-size: 12px; font-weight: 800; }
.category-product-count:hover { text-decoration: underline; }
.category-editor { grid-template-columns: minmax(0, 1fr) 300px; }
.category-image-preview {
    width: calc(100% - 40px);
    max-height: 380px;
    margin: 18px 20px 0;
    border-radius: 8px;
    object-fit: cover;
}
.category-summary { padding: 24px; text-align: center; }
.category-summary > strong { display: block; color: var(--teal); font: 800 38px/1 var(--display); }
.category-summary > span { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.category-summary .admin-button { margin-top: 20px; }
.drag-column { width: 46px; padding-left: 12px; padding-right: 4px; text-align: center; }
.drag-handle {
    width: 32px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    color: #767676;
    background: transparent;
    cursor: grab;
    touch-action: none;
}
.drag-handle:hover { color: var(--ink); background: #ededed; }
.drag-handle:active { cursor: grabbing; }
.drag-handle:disabled { cursor: default; opacity: .3; }
.products-table tbody tr[draggable="true"] { transition: background .15s, box-shadow .15s, opacity .15s; }
.products-table tbody tr.drag-ready { background: #fafafa; }
.products-table tbody tr.is-dragging {
    opacity: .45;
    background: #e9f5ee;
    box-shadow: inset 3px 0 var(--teal);
}
.products-table tbody tr.is-dragging td { border-color: transparent; }

@media (max-width: 760px) {
    .product-order-status { margin-left: 0; }
    .category-editor { grid-template-columns: 1fr; }
}

/* Shopify-inspired operations UI: neutral canvas, compact navigation, dense commerce forms. */
:root {
    --ink: #303030;
    --muted: #616161;
    --bg: #f1f1f1;
    --line: #dedede;
    --teal: #29845a;
    --teal-dark: #1f6a48;
    --lime: #c9f0d8;
}
.admin-sidebar { width: 236px; padding: 14px 12px; color: var(--ink); background: #ebebeb; border-right: 1px solid #d4d4d4; }
.admin-brand { padding: 6px 8px 18px; color: var(--ink); }
.admin-brand > span { color: white; background: #202223; border-radius: 7px; }
.admin-brand small { color: var(--muted); }
.admin-sidebar nav a, .sidebar-bottom a, .sidebar-bottom button { min-height: 38px; border-radius: 7px; color: #4a4a4a; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active, .sidebar-bottom a:hover, .sidebar-bottom button:hover { color: var(--ink); background: #dcdcdc; }
.admin-sidebar nav a.active { box-shadow: none; font-weight: 800; }
.admin-sidebar nav b { color: white; background: var(--teal); }
.sidebar-bottom { border-color: #d4d4d4; }
.admin-main { margin-left: 236px; }
.admin-topbar { height: 64px; padding: 0 28px; background: #1a1a1a; border: 0; color: white; }
.admin-topbar > div:first-of-type span { display: none; }
.admin-topbar h1 { margin: 0; font-size: 18px; }
.admin-user > span { color: var(--ink); background: #c9f0d8; }
.admin-user small { color: #aaa; }
.admin-content { max-width: 1240px; padding: 28px; }
.admin-actions { min-height: 44px; margin-bottom: 14px; }
.admin-button { min-height: 36px; padding: 0 13px; border-color: #bdbdbd; border-radius: 8px; box-shadow: 0 1px 0 rgba(0,0,0,.05); }
.admin-button.primary { border-color: #202223; background: #303030; }
.panel, .stat-card { border-color: #dedede; border-radius: 12px; box-shadow: 0 1px 0 rgba(0,0,0,.04); overflow: hidden; }
.stat-grid { gap: 12px; }
.stat-card { min-height: 112px; }
.stat-card > svg { border-radius: 7px; color: #286f4c; background: #e2f4e9; }
.panel-heading { min-height: 66px; padding: 16px 20px; }
.panel-heading h2 { font-size: 15px; }
th { background: #f7f7f7; }
input, select, textarea { border-radius: 8px; }
.editor-layout { grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; }
.editor-main, .editor-side { gap: 16px; }
.form-panel { padding-bottom: 18px; }
.form-panel > label, .form-panel > .form-grid { margin: 16px 20px 0; }
.settings-grid .form-panel > .admin-button { margin: 16px 20px 0; }
.media-grid { padding: 18px 20px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.media-item { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #f6f6f6; }
.media-item.primary { box-shadow: 0 0 0 2px var(--teal); }
.media-item img { width: 100%; height: 100%; object-fit: cover; }
.media-item > span { position: absolute; top: 7px; left: 7px; padding: 3px 7px; border-radius: 20px; color: white; background: rgba(32,34,35,.78); font-size: 9px; font-weight: 800; }
.remove-media { position: absolute; right: 6px; bottom: 6px; padding: 4px 7px; display: flex !important; grid-template-columns: auto auto; align-items: center; gap: 4px !important; border-radius: 6px; background: rgba(255,255,255,.94); }
.remove-media input { width: 14px; height: 14px; }
.media-primary-button { position: absolute; left: 6px; bottom: 6px; padding: 5px 7px; border: 0; border-radius: 6px; background: rgba(255,255,255,.94); font-size: 9px; font-weight: 800; }
.multi-upload { min-height: 78px; border-radius: 8px; background: #fafafa; }
.file-input { border-radius: 8px; }
.filter-tabs a { border-radius: 8px; }
.status { border-radius: 20px; }
.login-body { background: #ebebeb; }
.login-brand { color: var(--ink); }
.login-brand > span { color: white; background: #202223; border-radius: 7px; }
.login-brand small { color: var(--muted); }
.login-card { border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.login-card button { border-radius: 8px; background: #303030; }
.back-link { color: var(--ink); }

@media (max-width: 900px) {
    .media-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
    .admin-main { margin-left: 0; }
    .admin-topbar { background: #1a1a1a; }
    .media-grid { grid-template-columns: repeat(2, 1fr); }
}
