/* iris studio dashboard — builds on /css/style.css tokens. Flat colours only. */
body.admin { background: var(--ink); }

/* auth */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-box { width: min(400px, 100%); display: grid; gap: 16px; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.auth-box img { height: 44px; width: auto; margin-bottom: 8px; }
.auth-box h1 { font-size: 26px; font-weight: 900; text-transform: uppercase; }
.auth-box p { margin: 0; color: var(--muted); font-size: 15px; }

/* shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 20px; padding: 20px 14px; background: var(--band); border-right: 1px solid var(--line); }
.side-brand img { height: 40px; width: auto; margin: 4px 8px 8px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); text-decoration: none; font-weight: 700; font-size: 15px; color: var(--muted); }
.side-nav a:hover { background: var(--raised); color: var(--white); }
.side-nav a[aria-current="page"] { background: var(--violet); color: #fff; }
.side-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pill { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--white); color: var(--violet-deep); font-size: 12px; font-weight: 900; text-align: center; }
.side-foot { margin-top: auto; display: grid; gap: 4px; padding: 0 4px; }
.side-foot a, .side-foot button { all: unset; cursor: pointer; padding: 8px; border-radius: var(--r-sm); color: var(--muted); font-weight: 700; font-size: 14px; }
.side-foot a:hover, .side-foot button:hover { color: var(--white); background: var(--raised); }

.main { padding: 32px 36px 64px; min-width: 0; outline: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 24px; }
.page-head h1 { font-size: 30px; font-weight: 900; text-transform: uppercase; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; gap: 8px; }
  .side-brand img { height: 32px; margin: 0 8px 0 0; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side-nav a { padding: 8px 10px; font-size: 14px; }
  .side-nav svg { display: none; }
  .side-foot { margin: 0 0 0 auto; display: flex; }
  .main { padding: 24px 16px 56px; }
}

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.stat span { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat b { display: block; margin-top: 6px; font-size: 30px; font-weight: 900; }
.stat.hl { border-color: var(--violet); }

/* panels & tables */
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: 24px; }
.box-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.box-head h2 { font-size: 16px; font-weight: 900; text-transform: uppercase; }
.box-body { padding: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--raised); }
td .muted, .muted { color: var(--muted); }
td .mono { font-size: 13px; color: var(--dim); }
.thumb { width: 72px; aspect-ratio: 16 / 9; border-radius: 6px; object-fit: cover; background: var(--violet-deep); display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 900; text-transform: uppercase; overflow: hidden; }
.cell-main { display: flex; align-items: center; gap: 14px; }
.cell-main b { display: block; font-weight: 800; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.link-btn { all: unset; cursor: pointer; padding: 6px 10px; border-radius: 6px; font-weight: 700; font-size: 13px; color: var(--violet-soft); }
.link-btn:hover { background: var(--ink); }
.link-btn.danger { color: var(--danger); }
.link-btn:focus-visible { outline: 2px solid var(--violet-soft); }
.empty-row { padding: 36px 20px; text-align: center; color: var(--muted); }

.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; text-transform: capitalize; background: var(--raised); color: var(--muted); }
.status.pending, .status.new { background: var(--white); color: var(--ink); }
.status.paid, .status.quoted, .status.in-progress { background: var(--violet); color: #fff; }
.status.delivered, .status.done { background: #1F3B30; color: var(--ok); }
.status.cancelled, .status.declined, .status.hidden, .status.off { background: #3A1E24; color: var(--danger); }
.status.live { background: #1F3B30; color: var(--ok); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

/* editor */
dialog.wide { width: min(860px, calc(100% - 32px)); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .form-grid, .form-grid.three { grid-template-columns: 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ink-deep); cursor: pointer; font-size: 14px; font-weight: 600; }
.check input { accent-color: var(--violet); width: 16px; height: 16px; margin: 0; }
.check:has(input:checked) { border-color: var(--violet); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); position: relative; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: left .15s; }
.switch input:checked { background: var(--violet); border-color: var(--violet); }
.switch input:checked::after { left: 20px; background: #fff; }
.switch input:focus-visible { outline: 2px solid var(--violet-soft); outline-offset: 2px; }
.section-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--violet); margin: 8px 0 -4px; }

/* image upload */
.drop { display: grid; place-items: center; gap: 6px; padding: 18px; border: 1.5px dashed var(--line); border-radius: var(--r-md); background: var(--ink-deep); text-align: center; color: var(--muted); cursor: pointer; font-size: 14px; }
.drop:hover, .drop.over { border-color: var(--violet); color: var(--white); }
.drop input { display: none; }
.cover { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: var(--ink-deep); border: 1px solid var(--line); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.img-item { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item button { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--ink); color: var(--white); cursor: pointer; font-weight: 900; }
.img-item button:hover { background: var(--danger); color: var(--ink); }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.form-err { color: var(--danger); font-weight: 700; font-size: 14px; }

/* confirm dialog */
dialog.confirm { width: min(420px, calc(100% - 32px)); }
.confirm-body { padding: 28px 28px 8px; display: grid; justify-items: start; gap: 10px; }
.confirm-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: #3A1E24; color: var(--danger); margin-bottom: 4px; }
.confirm-icon svg { width: 22px; height: 22px; }
.confirm-body h2 { font-size: 22px; font-weight: 900; text-transform: uppercase; }
.confirm-body p { margin: 0; color: var(--muted); font-size: 15px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 28px 26px; }
.btn-danger { background: var(--danger); color: var(--ink); }
.btn-danger:hover { background: #FFA3B0; }
dialog.confirm[data-tone="neutral"] .confirm-icon { background: var(--raised); color: var(--violet-soft); }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; margin: 0; font-size: 15px; }
.kv dt { color: var(--dim); font-weight: 700; }
.kv dd { margin: 0; }
