/* Eteily look: deep indigo background, purple-to-pink gradient buttons, white bold headings, pink accents. */
@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
:root {
    --bg-1: #2b1b63; --bg-2: #1e1a72; --bg-3: #171563;
    --surface: rgba(255, 255, 255, .06); --surface-strong: rgba(255, 255, 255, .1);
    --border: rgba(255, 255, 255, .16); --border-strong: rgba(255, 255, 255, .32);
    --text: #fff; --muted: #b9b4e0; --accent: #f08ab4; --accent-2: #e0679a;
    --grad: linear-gradient(90deg, #5b2d9a 0%, #c2406b 100%);
    --danger: #ff9a9a; --radius: 10px;
}
* { box-sizing: border-box; }
html { background: var(--bg-3); }
body {
    margin: 0; min-height: 100vh; color: var(--text);
    font: 16px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 56px 56px,
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 56px 56px,
        linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
    background-attachment: fixed;
}
a { color: var(--accent); }
h1 { font-size: 1.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; line-height: 1.15; margin: 0 0 16px; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 28px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.req { color: var(--accent); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; }
.eyebrow { display: flex; align-items: center; gap: 12px; color: var(--accent); font-size: .78rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 10px; }
.eyebrow::before { content: ""; width: 36px; height: 2px; background: var(--accent-2); }

input, select, textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius);
    background: rgba(8, 6, 50, .45); color: var(--text); font: inherit; min-height: 46px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
select option { background: #1e1a72; color: #fff; }
input[type=checkbox] { width: 20px; min-height: 20px; height: 20px; accent-color: #c2406b; }
input[type=file] { padding: 8px 10px; }
input[type=file]::file-selector-button { margin-right: 10px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
label.checkbox { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 18px;
    border: 1px solid var(--border-strong); border-radius: var(--radius); background: transparent; color: var(--text);
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s; }
button:hover, .button:hover { background: var(--surface-strong); }
button.primary, .button.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 22px rgba(194, 64, 107, .35); }
button.primary:hover, .button.primary:hover { background: var(--grad); filter: brightness(1.08); }
button.danger { color: var(--danger); border-color: rgba(255, 154, 154, .45); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; min-height: auto; font-weight: 500; }
button.link:hover { background: none; text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.guest { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px; flex-direction: column; gap: 16px; }
.auth-card { width: 100%; max-width: 440px; background: rgba(12, 9, 60, .6); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.auth-card .logo-box { background: #fff; border-radius: 12px; padding: 10px 14px; margin-bottom: 22px; display: flex; justify-content: center; }
.auth-card .logo-box img { height: 44px; width: auto; display: block; }
.stack { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.qr { background: #fff; padding: 12px; border-radius: var(--radius); width: max-content; margin: 8px auto 12px; }
.qr svg { display: block; width: 220px; height: 220px; }
.secret { word-break: break-all; color: var(--text); }
.steps { padding-left: 20px; }
.recovery { margin-top: 12px; }
.recovery summary { cursor: pointer; color: var(--accent); margin-bottom: 12px; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; list-style: none; padding: 0; }
.codes code { display: block; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-align: center; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 8px 20px;
    background: #fff; color: #1b1550; border-bottom: 1px solid #e4e1f2; min-height: 64px; box-shadow: 0 2px 14px rgba(20, 12, 70, .25); }
.topbar .brand { display: flex; align-items: center; text-decoration: none; }
.topbar .brand img { height: 44px; width: auto; display: block; }
.topbar .company-name { font-weight: 600; color: #3b2a85; }
.topbar .user { margin-left: auto; display: flex; align-items: center; gap: 14px; color: #1b1550; font-weight: 500; }
.topbar button.link { color: #b0345f; font-weight: 600; }
.company-switch select { min-height: 38px; padding: 4px 10px; width: auto; background: #f4f2ff; color: #1b1550; border-color: #d8d3f0; }
.company-switch select option { background: #fff; color: #1b1550; }
.menu-toggle { display: none; min-height: 42px; padding: 4px 12px; color: #1b1550; border-color: #d8d3f0; }
.menu-toggle:hover { background: #f4f2ff; }
.shell { display: flex; min-height: calc(100vh - 64px); }
.sidebar { width: 240px; flex-shrink: 0; padding: 18px 10px; border-right: 1px solid var(--border); background: rgba(10, 7, 50, .5); display: flex; flex-direction: column; gap: 2px; }
.sidebar a { padding: 10px 14px; border-radius: var(--radius); text-decoration: none; color: #e7e4ff; font-weight: 500; }
.sidebar a:hover { background: var(--surface-strong); }
.sidebar a.active { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(194, 64, 107, .3); }
.nav-group { margin: 18px 14px 6px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .16em; color: var(--accent); }
.sidebar .install-app { margin-top: 16px; }
.content { flex: 1; min-width: 0; padding: 28px; max-width: 1240px; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.alert ul { margin: 8px 0 0; padding-left: 20px; }
.alert a { color: inherit; font-weight: 600; }
.alert.success { background: rgba(46, 160, 100, .18); color: #9ff0c0; border-color: rgba(46, 160, 100, .45); }
.alert.warning { background: rgba(240, 180, 60, .15); color: #ffd98a; border-color: rgba(240, 180, 60, .45); }
.alert.error { background: rgba(255, 90, 90, .15); color: #ffb3b3; border-color: rgba(255, 90, 90, .45); }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.search { display: flex; gap: 8px; margin: 8px 0 16px; max-width: 520px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, .09); text-align: left; vertical-align: top; }
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .03); }
.table .changes { font-size: .85rem; max-width: 420px; word-break: break-word; }
.pagination { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 16px 0; }
.pagination .disabled { color: var(--muted); }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
.tabs a.active { color: #fff; border-color: var(--accent-2); }
form.inline { display: inline-flex; gap: 6px; align-items: center; }
.small-input { width: 160px; min-height: 42px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.form-grid legend { color: var(--accent); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; padding: 0 6px; }
.form-actions { display: flex; gap: 8px; }
.field-error { color: var(--danger); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.tile-value { font-size: 2.1rem; font-weight: 800; line-height: 1.1; }
.tile-label { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; }
.card h2 { margin-top: 0; }
.inline-upload { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-upload input { flex: 1; min-width: 180px; }
[hidden] { display: none !important; }

@media (max-width: 900px) {
    .menu-toggle { display: inline-flex; }
    .sidebar { position: fixed; top: 64px; bottom: 0; left: 0; z-index: 20; background: #15105a; transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility .2s; }
    .sidebar.open { transform: none; visibility: visible; box-shadow: 0 0 30px rgba(0, 0, 0, .5); }
    .content { padding: 18px; }
    .form-grid { grid-template-columns: 1fr; }
    .topbar { padding: 8px 12px; gap: 10px; }
    .topbar .brand img { height: 36px; }
    .topbar .user span, .topbar .company-name { display: none; }
    h1 { font-size: 1.4rem; }
}
@media print {
    html, body { background: #fff !important; color: #000 !important; }
    .topbar, .sidebar, button, .button { display: none !important; }
    .codes code { color: #000; border-color: #999; background: #fff; }
}

/* Stock, approvals and tasks */
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form input { width: 180px; min-height: 38px; padding: 6px 10px; }
.inline-form button { min-height: 38px; padding: 6px 14px; }
.overdue { color: #ff9a9a; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.tag { display: inline-block; padding: 4px 12px; margin: 0 6px 6px 0; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }

.sidebar .nav-group small { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .7; font-size: .75em; }
.sidebar .nav-soon { display: block; padding: .3rem 1rem; font-size: .8rem; opacity: .55; font-style: italic; }

.nav-section { display: block; }
.nav-section > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.nav-section > summary::-webkit-details-marker { display: none; }
.nav-section > summary::after { content: '▸'; font-size: .8rem; opacity: .7; transition: transform .15s; }
.nav-section[open] > summary::after { transform: rotate(90deg); }
.nav-section > summary small { flex: 1; }
.nav-section > summary:focus-visible { outline: 2px solid var(--accent-2); border-radius: 6px; }
