/* Back office */
:root { --brand: #0077c0; --accent: #f8971c; --ink: #0b2540; --text: #1f2a37; --muted: #64748b; --line: #e2e8f0; --bg: #f4f6f9; --ok: #1e8e4f; --err: #c0392b; }
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; color: var(--text); background: var(--bg); line-height: 1.5; }
a { color: var(--brand); }
h1, h2, h3 { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; color: var(--ink); margin: 0 0 .5em; line-height: 1.15; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.15rem; }
.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #b9cbe0; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { background: #fff; border-radius: 10px; padding: 8px 10px; display: block; margin-bottom: 18px; }
.side .logo img { width: 100%; display: block; }
.side h6 { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: #7f98b3; margin: 18px 10px 6px; }
.side a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 7px; color: #dbe7f3; text-decoration: none; font-weight: 500; }
.side a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side a.on { background: var(--brand); color: #fff; }
.side .pill { background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.main { min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 26px; display: flex; justify-content: flex-end; gap: 16px; align-items: center; font-size: .9rem; }
.topbar form { margin: 0; }
.content { padding: 24px 26px 60px; }
.page-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title h1 { margin: 0; }
.page-title .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.topbar .menu-btn { display: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .topbar .menu-btn { display: inline-flex; margin-right: auto; }
  .content { padding: 18px 16px 50px; }
  .topbar { padding: 10px 16px; }
}

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 7px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { background: #fff; color: var(--brand); border-color: #c8d6e5; }
.btn.ghost:hover { border-color: var(--brand); background: #f0f7fd; color: var(--brand); }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.danger { background: #fff; color: var(--err); border-color: #efc4be; }
.btn.danger:hover { background: var(--err); color: #fff; }
.btn.sm { padding: 4px 10px; font-size: .85rem; }
.linkish { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .cols, .cols.even { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1000px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.stat .k { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.stat .v { font-family: 'Barlow Condensed', sans-serif; font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.stat .d { font-size: .85rem; color: var(--muted); }
.stat .d.up { color: var(--ok); } .stat .d.down { color: var(--err); }

table.t { width: 100%; border-collapse: collapse; background: #fff; }
table.t th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:hover td { background: #fafcff; }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.thumb { width: 44px; height: 44px; background: #f2f5f8; border-radius: 6px; padding: 3px; display: grid; place-items: center; }
.thumb svg, .thumb img { width: 100%; height: 100%; object-fit: contain; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.dots i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0, 0, 0, .15); margin-right: 2px; }

label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 4px; color: var(--ink); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], input[type=url], select, textarea {
  width: 100%; font: inherit; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: var(--text); }
input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(0, 119, 192, .25); border-color: var(--brand); }
textarea { min-height: 90px; resize: vertical; }
.f { margin-bottom: 14px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.chk { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 6px 0; }
.chk input { width: 16px; height: 16px; accent-color: var(--brand); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 150px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash.success { background: #e9f7ef; border-color: #b6e2c7; color: #145c33; }
.flash.error { background: #fdecea; border-color: #f3c0b9; color: #8c2116; }

.status { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.status.blue { background: #e3f1fb; color: #075a92; } .status.amber { background: #fff1db; color: #8f5200; }
.status.purple { background: #efe8fb; color: #5a2fa0; } .status.green { background: #e2f5ea; color: #17673a; }
.status.grey { background: #eceff2; color: #4b5866; } .status.red { background: #fde6e3; color: #9b2a1c; }
.prio { background: #fde6e3; color: #9b2a1c; font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; }

/* kanban queue */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: #e9eef4; border-radius: 10px; padding: 10px; min-height: 200px; }
.col h3 { display: flex; justify-content: space-between; font-size: 1rem; margin: 2px 4px 10px; }
.col h3 span { background: #fff; border-radius: 99px; padding: 0 9px; font-size: .85rem; color: var(--muted); }
.ticket { background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; border-left: 4px solid var(--brand); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.ticket.high { border-left-color: var(--err); }
.ticket.custom { border-left-color: var(--accent); }
.ticket a.ref { font-weight: 700; text-decoration: none; color: var(--ink); }
.ticket .who { font-size: .9rem; }
.ticket .meta { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.ticket form { margin-top: 8px; display: flex; gap: 6px; }
.ticket select { font-size: .8rem; padding: 3px 6px; }
.flag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: #fff1db; color: #8f5200; margin-top: 4px; }
.flag.red { background: #fde6e3; color: #9b2a1c; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 7px; text-decoration: none; color: var(--text); background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: .9rem; }
.tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.item { display: grid; grid-template-columns: 110px 1fr auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .pic { background: #f2f5f8; border-radius: 8px; padding: 6px; }
.size-chips span { display: inline-block; background: #f1f5f9; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; margin: 2px 4px 2px 0; font-size: .85rem; }
.deco { background: #fff7ec; border: 1px solid #f9d6a5; border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: .9rem; }
.art { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.art img { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 12px 12px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 10px; }
.timeline li::before { content: ''; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; }
.timeline li.internal::before { background: #94a3b8; }
.timeline .when { font-size: .78rem; color: var(--muted); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 10px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 6px; }
.chart div { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.chart div:hover { background: var(--accent); }
.checklist li { margin: 4px 0; } .checklist .done { color: var(--muted); text-decoration: line-through; }
.colour-row { display: grid; grid-template-columns: 44px 1fr 110px auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, var(--ink), var(--brand)); }
.login-box { background: #fff; border-radius: 14px; padding: 30px; width: 100%; max-width: 400px; }
.login-box img { max-width: 220px; display: block; margin: 0 auto 18px; }
.note-kind { font-size: .72rem; text-transform: uppercase; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
