:root {
    --gold: #c8a415;
    --gold-dark: #9a7c06;
    --gold-soft: #fdf3cf;
    --gold-line: #e6d18f;
    --gold-bar: rgb(253, 212, 100);
    --ink: #1f1c14;
    --ink-2: #57513f;
    --ink-3: #857f6c;
    --line: #dfdbd1;
    --line-2: #c8c2b4;
    --bg: #f1eee6;
    --sheet: #ffffff;
    --hover: #faf6e8;
    --sel: #fbefc4;
    --blue: #1f5fa9;
    --green: #1e7a45;
    --red: #b3261e;
    --amber: #9a6300;
    --font: "Plus Jakarta Sans", "Segoe UI", "Selawik", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --titlebar-h: 46px;
    --ribbon-h: 90px;
    --rail-w: 216px;
}

body.has-page-tabs { --ribbon-h: 118px; }
body.is-home { --ribbon-h: 0px; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
}

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0 0 8px; }
small { font-size: 11.5px; }
.muted { color: var(--ink-3); }
.right { margin-left: auto; }

/* ============ Title bar ============ */
.titlebar {
    height: var(--titlebar-h);
    background: var(--gold-bar);
    color: #241f10;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 0 0;
    position: sticky;
    top: 0;
    z-index: 40;
    view-transition-name: titlebar;
}
.tb-lockup {
    display: flex;
    align-items: stretch;
    align-self: stretch;
    background: transparent;
    flex: 0 0 auto;
}
.tb-lockup .rail-toggle {
    color: #241f10;
    align-self: center;
    margin: 0 2px 0 6px;
}
.tb-lockup .rail-toggle:hover {
    background: rgba(36, 31, 16, .08);
    border-color: transparent;
    color: #241f10;
}
.tb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 0 14px 0 10px;
    color: #fff;
}
.tb-logo {
    display: block;
    height: 34px;
    width: auto;
    mix-blend-mode: screen;
    filter: grayscale(1) brightness(12) contrast(1.05);
}
.tb-product {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #fff;
    border-left: 1px solid rgba(255, 255, 255, .45);
    padding: 4px 0 4px 10px;
    line-height: 1;
}
.tb-search {
    flex: 0 1 460px;
    margin: 0 auto;
    position: relative;
}
.tb-search input {
    width: 100%;
    height: 26px;
    border: 1px solid rgba(0,0,0,.18);
    background: rgba(255,255,255,.85);
    border-radius: 3px;
    padding: 0 10px 0 28px;
    outline: none;
}
.tb-search input:focus { background: #fff; border-color: #6d5a08; }
.tb-search svg { position: absolute; left: 7px; top: 5px; opacity: .6; }
.tb-actions { display: flex; align-items: center; gap: 2px; }
.tb-btn {
    height: 28px;
    min-width: 30px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}
.tb-btn:hover { background: rgba(255,255,255,.45); border-color: rgba(0,0,0,.12); }
.tb-btn.is-open { background: #fff; border-color: rgba(0,0,0,.18); }
.tb-count {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 8px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    line-height: 15px;
    text-align: center;
    font-weight: 700;
}
.tb-user {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 500;
}
.tb-user .ava {
    width: 22px; height: 22px; border-radius: 50%;
    background: #241f10; color: var(--gold);
    font-size: 10px; font-weight: 700;
    display: grid; place-items: center;
}

/* ============ Ribbon ============ */
.ribbon {
    background: var(--sheet);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: var(--titlebar-h);
    z-index: 35;
    view-transition-name: ribbon;
}
.rb-mods {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0 8px;
    background: var(--bg);
    min-height: 34px;
    border-bottom: 1px solid var(--line);
}
.rb-mods a {
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-2);
    border-bottom: 2px solid transparent;
}
.rb-mods a:hover { color: var(--ink); }
.rb-mods a.is-on {
    color: var(--ink);
    border-bottom-color: var(--gold-bar);
}
.rb-tabs {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 0 8px;
    border-bottom: 1px solid var(--line);
    background: #fbf9f3;
}
.rb-tabs a {
    padding: 6px 12px 5px;
    font-size: 13px;
    color: var(--ink-2);
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 3px 3px 0 0;
    position: relative;
    top: 1px;
}
.rb-tabs a:hover { background: var(--hover); }
.rb-tabs a.is-on {
    background: var(--sheet);
    border-color: var(--line);
    color: var(--ink);
    font-weight: 600;
}
.rb-tabs a.is-on::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: var(--sheet);
}
.rb-bar {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 6px 8px 4px;
    overflow-x: auto;
}
.rb-group {
    display: flex;
    flex-direction: column;
    padding: 0 10px;
    border-right: 1px solid var(--line);
}
.rb-group:last-child { border-right: 0; }
.rb-row { display: flex; align-items: flex-start; gap: 2px; min-height: 42px; }
.rb-label {
    text-align: center;
    font-size: 10.5px;
    color: var(--ink-3);
    padding-top: 2px;
}
.cmd {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 54px;
    max-width: 92px;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    color: var(--ink);
}
.cmd svg { display: block; }
.cmd:hover { background: var(--hover); border-color: var(--gold-line); }
.cmd:active { background: var(--sel); }
.cmd[disabled] { opacity: .45; cursor: default; }
.cmd.is-on { background: var(--sel); border-color: var(--gold-line); font-weight: 600; }
.cmd-sm {
    flex-direction: row;
    min-width: 0;
    padding: 4px 9px;
    height: 24px;
    align-items: center;
}
.cmd-primary { background: var(--gold-bar); border-color: #e0b83a; font-weight: 600; }
.cmd form { display: contents; }

/* ============ Shell ============ */
.shell {
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - var(--titlebar-h) - var(--ribbon-h));
}
.rail {
    width: var(--rail-w);
    flex: 0 0 var(--rail-w);
    background: #faf8f2;
    border-right: 1px solid var(--line);
    padding: 8px 0 0;
    position: sticky;
    top: calc(var(--titlebar-h) + var(--ribbon-h));
    align-self: stretch;
    min-height: calc(100vh - var(--titlebar-h) - var(--ribbon-h));
    max-height: calc(100vh - var(--titlebar-h) - var(--ribbon-h));
    overflow: auto;
    view-transition-name: rail;
    display: flex;
    flex-direction: column;
}
.rail-head {
    padding: 10px 14px 8px;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-3);
    font-weight: 700;
}
.rail a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    color: var(--ink-2);
    border-left: 3px solid transparent;
    font-size: 13.5px;
}
.rail a:hover { background: var(--hover); color: var(--ink); }
.rail a.is-on {
    background: var(--sel);
    border-left-color: var(--gold);
    color: var(--ink);
    font-weight: 600;
}
.rail a svg { flex: 0 0 16px; opacity: .75; }
.rail .n {
    margin-left: auto;
    min-width: 18px;
    height: 16px;
    padding: 0 5px;
    border-radius: 8px;
    background: #e6e1d4;
    color: var(--ink-2);
    font-size: 10.5px;
    line-height: 16px;
    text-align: center;
    font-weight: 700;
}
.rail a.is-on .n, .rail .n.hot { background: var(--red); color: #fff; }
.rail-home {
    margin-top: auto;
    border-top: 1px solid var(--line);
    color: var(--ink-3);
    font-weight: 500;
    font-size: 13px;
}
.rail a.rail-home.is-on,
.rail a.rail-home {
    border-left-color: transparent;
    background: transparent;
    font-weight: 500;
}
.rail a.rail-home:hover { background: var(--hover); color: var(--ink); }

.work {
    flex: 1;
    min-width: 0;
    padding: 12px 14px 40px;
    view-transition-name: work;
}
.crumb {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-3);
    font-size: 11.5px;
    margin-bottom: 8px;
}
.crumb a:hover { text-decoration: underline; }
.list-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}
.list-pills-gap {
    width: 1px;
    align-self: stretch;
    min-height: 22px;
    background: var(--line);
    margin: 2px 4px;
}
.list-pills .pill { text-decoration: none; }
.list-pills .pill .muted { font-weight: 500; margin-left: 4px; }
.page-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============ Panes ============ */
.pane {
    background: var(--sheet);
    border: 1px solid var(--line);
    border-radius: 3px;
}
.pane + .pane { margin-top: 10px; }
.cols > .pane + .pane { margin-top: 0; }
.cols > .pane {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.cols > .pane > .pane-body { flex: 1; }
.pane-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--line);
    background: #fcfaf4;
    font-weight: 600;
    font-size: 13.5px;
}
.pane-head .right { font-weight: 400; font-size: 11.5px; }
.pane-body { padding: 10px; }
.pane-body.tight { padding: 0; }

.cols { display: grid; gap: 10px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-main { grid-template-columns: minmax(0, 1fr) 320px; }
.cols-form { grid-template-columns: minmax(0, 1fr) 300px; }
.cols-profile {
    grid-template-columns: minmax(0, 1fr) 240px;
    align-items: start;
}
.cols-profile > .pane { height: auto; }
.pane-perm .pane-body { padding: 8px 10px; }
.perm-list {
    display: grid;
    gap: 3px 0;
}
.perm-list .chk {
    font-size: 12px;
    line-height: 1.25;
    padding: 1px 0;
}

.tile {
    background: var(--sheet);
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    border-radius: 3px;
    padding: 8px 12px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.tile b { font-size: 22px; font-weight: 600; line-height: 1.1; }
.tile span { color: var(--ink-2); }
.tile:hover { background: var(--hover); }

/* ============ Tables ============ */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-3);
    font-weight: 600;
    padding: 6px 10px;
    border-bottom: 1px solid var(--line);
    background: #fcfaf4;
    position: sticky;
    top: 0;
    white-space: nowrap;
}
.tbl td {
    padding: 6px 10px;
    border-bottom: 1px solid #efece4;
    vertical-align: middle;
}
.tbl tbody tr:hover { background: var(--hover); }
.tbl tbody tr.is-sel { background: var(--sel); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .nowrap { white-space: nowrap; }
.tbl a.link { font-weight: 600; }
.tbl a.link:hover { color: var(--gold-dark); text-decoration: underline; }
.tbl .sub { color: var(--ink-3); font-size: 11.5px; }
.tbl-wrap { overflow: auto; }
.tbl .inp { width: 100%; height: 28px; }

/* ============ Small parts ============ */
.pill {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}
.pill-open { background: #f1eee4; color: var(--ink-2); border-color: #e0dacb; }
.pill-in_progress { background: #e7f0fb; color: var(--blue); border-color: #cbdff5; }
.pill-waiting { background: #f4f2ee; color: var(--ink-3); border-color: #e5e1d8; }
.pill-waiting_approval { background: #fdf0d6; color: var(--amber); border-color: #f0dca8; }
.pill-completed { background: #e3f4e9; color: var(--green); border-color: #c6e7d3; }
.pill-cancelled { background: #f7e6e5; color: var(--red); border-color: #eccecb; }
.pill-role { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-dark); }
.pill-plain { background: #f2efe7; border-color: var(--line); color: var(--ink-2); }

.who {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px 1px 2px;
    border: 1px solid color-mix(in srgb, var(--accent, var(--line)) 28%, var(--line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent, #fbfaf6) 8%, #fbfaf6);
    font-size: 11.5px;
    margin: 1px 2px 1px 0;
}
.who i {
    width: 16px; height: 16px; border-radius: 50%;
    background: color-mix(in srgb, var(--accent, var(--gold)) 18%, #fff);
    border: 1px solid color-mix(in srgb, var(--accent, var(--gold)) 42%, #fff);
    color: var(--accent, var(--gold-dark));
    font-style: normal; font-size: 9px; font-weight: 700;
    display: grid; place-items: center;
}
.who.grp i { background: #e9e5f7; border-color: #cfc7ea; color: #4b3f8f; }

.bar {
    height: 6px;
    background: #ece8dd;
    border-radius: 2px;
    overflow: hidden;
    min-width: 70px;
}
.bar > i { display: block; height: 100%; background: var(--gold); }
.bar.done > i { background: var(--green); }
.barline { display: flex; align-items: center; gap: 7px; }
.barline b { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 32px; text-align: right; }

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 26px;
    padding: 0 11px;
    border: 1px solid var(--line-2);
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12.5px;
    white-space: nowrap;
}
.btn:hover { background: var(--hover); border-color: var(--gold-line); }
.btn:active { background: var(--sel); }
.btn-primary { background: var(--gold-bar); border-color: #e0b83a; font-weight: 600; color: #241f10; }
.btn-primary:hover { background: #f0c64a; }
.btn-ok { background: #e3f4e9; border-color: #a9d6bc; color: var(--green); font-weight: 600; }
.btn-ok:hover { background: #d3eddd; }
.btn-warn { background: #fdf0d6; border-color: #e8cf95; color: var(--amber); font-weight: 600; }
.btn-danger { background: #fff; border-color: #e0b3b0; color: var(--red); }
.btn-danger:hover { background: #fbeceb; }
.btn-xs { height: 22px; padding: 0 8px; font-size: 11.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }

/* ============ Forms ============ */
.frm { display: block; }
.fld { display: block; margin-bottom: 9px; }
.fld > span {
    display: block;
    font-size: 11.5px;
    color: var(--ink-2);
    font-weight: 600;
    margin-bottom: 3px;
}
.inp, .fld input[type=text], .fld input[type=password], .fld input[type=email],
.fld input[type=date], .fld select, .fld textarea, select.inp, textarea.inp {
    width: 100%;
    height: 28px;
    border: 1px solid var(--line-2);
    background: #fff;
    border-radius: 2px;
    padding: 0 8px;
    outline: none;
}
.fld textarea, textarea.inp { height: auto; min-height: 58px; padding: 6px 8px; resize: vertical; }
.inp:focus, .fld input:focus, .fld select:focus, .fld textarea:focus {
    border-color: var(--gold-dark);
    box-shadow: inset 0 0 0 1px var(--gold-line);
}
.fld-row { display: flex; gap: 8px; }
.fld-row > * { flex: 1; }
.hint { font-size: 12.5px; color: var(--ink-3); }

.picker {
    border: 1px solid var(--line-2);
    border-radius: 2px;
    background: #fff;
}
.picker-search { border-bottom: 1px solid var(--line); }
.picker-search input { border: 0; height: 26px; width: 100%; padding: 0 8px; outline: none; }
.picker-list { max-height: 168px; overflow: auto; padding: 2px; }
.opt {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 7px;
    border-radius: 2px;
    cursor: pointer;
}
.opt:hover { background: var(--hover); }
.opt input { margin: 0; accent-color: var(--gold-dark); }
.opt .u { color: var(--ink-3); font-size: 11.5px; }
.opt.is-checked { background: var(--sel); }

.check-list { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chk input { accent-color: var(--gold-dark); margin: 0; }

.range { display: flex; align-items: center; gap: 10px; }
.range input[type=range] { flex: 1; accent-color: var(--gold-dark); }
.range b { font-size: 15px; min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

/* ============ Steps ============ */
.steps { display: block; }
.stp {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 9px;
    padding: 8px 10px;
    border-bottom: 1px solid #efece4;
    position: relative;
}
.stp:last-child { border-bottom: 0; }
.stp::before {
    content: "";
    position: absolute;
    left: 22px; top: 32px; bottom: -1px;
    width: 1px;
    background: var(--line);
}
.stp:last-child::before { display: none; }
.stp-n {
    width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid var(--line-2);
    background: #fff;
    display: grid; place-items: center;
    font-size: 11px; font-weight: 700; color: var(--ink-2);
    z-index: 1;
}
.stp.on .stp-n { background: var(--gold-bar); border-color: #e0b83a; color: #241f10; }
.stp.done .stp-n { background: var(--green); border-color: var(--green); color: #fff; }
.stp.on { background: #fffdf5; }
.stp-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stp-title b { font-weight: 600; }
.stp-meta { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.stp-actions { margin-top: 7px; }

/* ============ Feed / notifications ============ */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
    display: flex;
    gap: 9px;
    padding: 8px 10px;
    border-bottom: 1px solid #efece4;
}
.feed li:last-child { border-bottom: 0; }
.feed li:hover { background: var(--hover); }
.feed li.unread { background: #fffbe9; }
.feed .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--gold); margin-top: 6px; flex: 0 0 8px;
}
.feed .dot.read { background: #ddd8cc; }
.feed .t { font-weight: 600; }
.feed time { color: var(--ink-3); font-size: 11px; white-space: nowrap; }
.feed .body { min-width: 0; flex: 1; }
.feed .line { display: flex; gap: 8px; align-items: baseline; }

.log { list-style: none; margin: 0; padding: 0; }
.log li { padding: 6px 10px; border-bottom: 1px solid #efece4; }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--ink-3); font-size: 11px; }
.log .what { font-weight: 600; }
.log .note { color: var(--ink-2); }

.act { list-style: none; margin: 0; padding: 0; }
.act li {
    padding: 8px 10px;
    border-bottom: 1px solid #efece4;
}
.act li:last-child { border-bottom: 0; }
.act-line { color: var(--ink); line-height: 1.4; }
.act time { display: block; color: var(--ink-3); font-size: 11px; margin-top: 2px; }
.act a.link { font-weight: 400; }

.step-work {
    margin: 8px 0;
    padding: 0;
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 3px;
    overflow: hidden;
    transition: padding .22s ease, background .22s ease, border-color .22s ease;
}
.step-work .mention-wrap { width: 100%; }
.step-work textarea.inp {
    min-height: 34px;
    height: 34px;
    max-height: 34px;
    margin: 0;
    padding: 7px 10px;
    border: 0;
    box-shadow: none;
    resize: none;
    overflow: hidden;
    transition: min-height .22s ease, max-height .22s ease, height .22s ease, padding .22s ease;
}
.step-work.is-open {
    padding: 8px;
    background: #fcfaf4;
    border-color: var(--line);
    overflow: visible;
}
.step-work.is-open textarea.inp {
    min-height: 88px;
    height: auto;
    max-height: none;
    padding: 6px 8px;
    border: 1px solid var(--line-2);
    resize: vertical;
    overflow: auto;
}
.step-work.is-open textarea.inp:focus {
    border-color: var(--gold-dark);
    box-shadow: inset 0 0 0 1px var(--gold-line);
}
.step-work-more {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows .22s ease, opacity .18s ease, margin-top .22s ease;
}
.step-work.is-open .step-work-more {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 8px;
}
.step-work-more-inner { overflow: hidden; min-height: 0; }
.file-pick {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    cursor: pointer;
}
.file-pick input[type=file] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.file-pick-name {
    font-size: 12.5px;
    color: var(--ink-3);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-pick.has-files .file-pick-name { color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
    .step-work,
    .step-work textarea.inp,
    .step-work-more { transition: none; }
}
.job-desc { white-space: pre-wrap; line-height: 1.45; }
.work-block { margin: 10px 0 4px; }
.work-thread { margin: 10px 0 14px; }
.work-note {
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent, var(--gold));
    background: #fff;
}
.work-note-meta { font-size: 11.5px; color: var(--ink-3); }
.work-note p, .work-comment p { margin: 4px 0 0; white-space: pre-wrap; line-height: 1.4; }
.work-replies { margin: 6px 0 0 22px; }
.work-comment {
    margin-top: 6px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent, var(--gold));
    background: #faf8f2;
}
.work-note-foot {
    display: flex;
    justify-content: flex-start;
    margin-top: 2px;
}
.work-comment-icon {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
    display: grid;
    place-items: center;
}
.work-comment-icon:hover,
.work-comment-icon.is-open {
    color: var(--gold-dark);
    background: var(--hover);
}
.work-comment-panel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    margin: 0 0 0 22px;
    pointer-events: none;
    transition: grid-template-rows .22s ease, opacity .18s ease, margin-top .22s ease;
}
.work-comment-panel.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 6px;
    pointer-events: auto;
}
.work-comment-panel-inner { overflow: hidden; min-height: 0; }
.work-comment-form {
    display: grid;
    gap: 6px;
    justify-items: start;
    padding-top: 2px;
}
.work-comment-form .mention-wrap { width: 100%; }
.work-comment-form textarea { min-height: 52px; }
@media (prefers-reduced-motion: reduce) {
    .work-comment-panel { transition: none; }
}
.mention { color: var(--gold-dark); font-weight: 650; }
.mention-wrap { position: relative; }
.mention-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 30;
    max-height: 180px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line-2);
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.mention-list button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: #fff;
    padding: 6px 10px;
    cursor: pointer;
    font: inherit;
}
.mention-list button:hover,
.mention-list button.is-on { background: var(--sel); }
.file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 12px;
    color: var(--ink);
    text-decoration: none;
}
.file-chip:hover { background: var(--hover); border-color: var(--gold-line); }
.step-log { margin-top: 8px; font-size: 12px; }
.step-log summary {
    cursor: pointer;
    color: var(--ink-2);
    font-weight: 600;
    padding: 2px 0;
}
.step-log .act { border-top: 1px solid #efece4; margin-top: 6px; }

.empty {
    padding: 26px 12px;
    text-align: center;
    color: var(--ink-3);
}
.flash {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    background: var(--gold-soft);
    border-radius: 2px;
    margin-bottom: 10px;
}
.flash-error { background: #fbeceb; border-left-color: var(--red); color: #8a1f19; }
.flash-success { background: #e9f6ee; border-left-color: var(--green); color: #17603a; }

/* ============ Menus / drawers / modals ============ */
.menu {
    position: absolute;
    top: calc(var(--titlebar-h) - 4px);
    right: 8px;
    width: 340px;
    max-height: 70vh;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line-2);
    box-shadow: 0 8px 20px rgba(0,0,0,.16);
    border-radius: 3px;
    z-index: 45;
}
.menu-head {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    background: #fcfaf4;
    position: sticky; top: 0;
}
.menu-item {
    display: block;
    padding: 7px 10px;
    border-bottom: 1px solid #f1eee6;
}
.menu-item:hover { background: var(--hover); }
.menu-narrow { width: 200px; }

.scrim {
    position: fixed;
    inset: 0;
    background: rgba(12, 10, 6, .52);
    backdrop-filter: blur(5px);
    z-index: 60;
    animation: fade-scrim .18s ease-out;
}
.drawer {
    position: fixed;
    left: 50%;
    top: 50%;
    width: min(520px, calc(100vw - 28px));
    max-height: min(88vh, 780px);
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    box-shadow: 0 28px 80px rgba(12, 10, 6, .38);
    z-index: 70;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: sheet-in .22s cubic-bezier(.22, 1, .36, 1);
}
.drawer.sheet-lg { width: min(740px, calc(100vw - 28px)); }
.sheet-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 14px 12px 16px;
    background: #000;
    color: #f3e7b8;
    flex: 0 0 auto;
}
.sheet-brand { flex: 0 0 auto; }
.sheet-logo {
    display: block;
    height: 42px;
    width: auto;
}
.sheet-head-text { min-width: 0; flex: 1; }
.sheet-head h3 {
    font-size: 16px;
    color: #fff;
    font-weight: 600;
    letter-spacing: .01em;
}
.sheet-head p {
    margin: 3px 0 0;
    font-size: 12px;
    color: rgba(243, 231, 184, .72);
    line-height: 1.35;
}
.sheet-head .x-btn {
    color: #f3e7b8;
    margin-left: auto;
    margin-top: 4px;
    width: 30px;
    height: 30px;
    font-size: 16px;
}
.sheet-head .x-btn:hover {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.18);
}
.sheet-body {
    padding: 16px 18px 8px;
    overflow: auto;
    flex: 1;
    background: #fff;
}
.sheet-grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 18px 22px;
    align-items: start;
}
.sheet-kicker {
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold-dark);
    font-weight: 700;
    margin-bottom: 10px;
}
.sheet-callout {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    background: var(--gold-soft);
    border: 1px solid var(--gold-line);
    border-left: 3px solid var(--gold);
    border-radius: 3px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--ink-2);
}
.sheet-callout strong { color: #241f10; }
.sheet-callout a {
    color: var(--blue);
    font-weight: 600;
    margin-top: 2px;
}
.sheet-callout a:hover { text-decoration: underline; }
.sheet-foot {
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 8px;
    align-items: center;
    background: #fcfaf4;
    flex: 0 0 auto;
}
.sheet-foot-spacer { margin-left: auto; }
.drawer .fld input[type=text],
.drawer .fld input[type=password],
.drawer .fld input[type=email],
.drawer .fld input[type=date],
.drawer .fld select {
    height: 32px;
    border-radius: 3px;
}
.drawer .fld textarea {
    min-height: 88px;
    border-radius: 3px;
}
.picker-tall .picker-list { max-height: 280px; }
.drawer .opt { padding: 6px 8px; }
.x-btn {
    border: 1px solid transparent;
    background: transparent;
    width: 26px; height: 26px;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1;
}
.x-btn:hover { background: #f0ece1; border-color: var(--line); }

.modal-root, .ok-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(31,28,20,.35);
    place-items: center;
    padding: 20px;
}
.modal-root.is-open, .ok-overlay.is-open { display: grid; }
body.modal-open { overflow: hidden; }
.modal-card {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 4px;
    box-shadow: 0 12px 32px rgba(0,0,0,.22);
    overflow: hidden;
    animation: pop .12s ease-out;
}
.modal-card h3 {
    font-size: 13px;
    padding: 8px 12px;
    background: var(--gold-bar);
    color: #241f10;
}
.modal-card p { padding: 14px 14px 4px; margin: 0; }
.modal-actions {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 14px 14px;
}

.ok-overlay { background: rgba(31,28,20,.28); }
.ok-box {
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 4px;
    box-shadow: 0 12px 32px rgba(0,0,0,.2);
    padding: 20px 26px;
    text-align: center;
    animation: pop .14s ease-out;
}
.ok-box p { margin: 8px 0 0; font-weight: 600; }
.ok-check { width: 52px; height: 52px; }
.ok-circle {
    stroke: var(--green); stroke-width: 2; fill: none;
    stroke-dasharray: 166; stroke-dashoffset: 166;
    animation: stroke .4s cubic-bezier(.65,0,.45,1) forwards;
}
.ok-path {
    stroke: var(--green); stroke-width: 3.4; fill: none;
    stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 48; stroke-dashoffset: 48;
    animation: stroke .28s cubic-bezier(.65,0,.45,1) .3s forwards;
}
@keyframes stroke { to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-scrim { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(.985); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ============ Home ============ */
body.is-home .ribbon,
body.is-home .rail { display: none; }
body.is-home .rail-toggle { display: none !important; }
body.is-home .shell {
    min-height: calc(100vh - var(--titlebar-h));
}
body.is-home .work {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--titlebar-h));
    padding: 32px 20px 56px;
}
body.is-home .work .flash { width: min(960px, 100%); }

.welcome {
    width: min(960px, 100%);
    text-align: center;
}
.welcome-hello {
    font-family: var(--font);
    font-size: clamp(34px, 4.2vw, 46px);
    font-weight: 700;
    letter-spacing: -0.038em;
    line-height: 1.08;
    color: var(--ink);
}
.welcome-name {
    font-family: var(--font);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink-2);
    margin: 8px 0 40px;
}
.welcome-cards {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: 204px 118px;
    gap: 14px;
    text-align: left;
}
.welcome-cards.welcome-more {
    grid-template-columns: 1.55fr 1.05fr .88fr;
    grid-template-rows: 208px 114px;
}
.welcome-cards.welcome-more .wcard-lg {
    grid-row: 1 / 3;
    grid-column: 1;
}
.welcome-cards.welcome-more .wcard-wide {
    grid-column: 2 / 4;
}
.welcome-cards.welcome-with-mail {
    grid-template-columns: 1.55fr 1fr 1fr;
    grid-template-rows: 208px 114px;
}
.welcome-cards.welcome-with-mail .wcard-lg {
    grid-row: 1 / 3;
    grid-column: 1;
}
.welcome-cards.welcome-with-mail .wcard-span {
    grid-column: 2 / 4;
}
.wcard {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 20px 18px;
    background: var(--sheet);
    border: 1px solid var(--line-2);
    overflow: hidden;
    appearance: none;
    font: inherit;
    font-family: var(--font);
    color: inherit;
    cursor: pointer;
    width: 100%;
    text-align: left;
}
.wcard-lg { grid-row: 1 / 3; padding: 26px 24px 22px; }
.wcard-sm { padding: 16px 16px 14px; }
.wcard-icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: var(--gold-bar);
}
.wcard-lg .wcard-icon {
    width: 52px;
    height: 52px;
}
.wcard-sm .wcard-icon {
    width: 32px;
    height: 32px;
}
.wcard-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    stroke-width: 1.6;
}
.wcard strong {
    position: relative;
    z-index: 1;
    font-family: var(--font);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.12;
    color: var(--ink);
    font-synthesis: none;
}
.wcard-lg strong { font-size: 32px; letter-spacing: -0.036em; }
.wcard-sm strong { font-size: 20px; letter-spacing: -0.028em; }

.welcome-trio {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 108px;
    max-width: 640px;
    gap: 12px;
    margin: 0 0 18px;
}
.welcome-trio.welcome-trio-one {
    grid-template-columns: 1fr;
    max-width: 210px;
}
.welcome-trio .wcard,
.welcome-trio .wcard-lg,
.welcome-trio .wcard-sm {
    grid-row: auto;
    grid-column: auto;
    min-height: 0;
    padding: 14px 14px 12px;
}
.welcome-trio .wcard-icon,
.welcome-trio .wcard-lg .wcard-icon,
.welcome-trio .wcard-sm .wcard-icon {
    width: 28px;
    height: 28px;
}
.welcome-trio .wcard strong,
.welcome-trio .wcard-lg strong,
.welcome-trio .wcard-sm strong {
    font-size: 16px;
    letter-spacing: -0.02em;
    font-weight: 700;
}
.welcome-trio .wcard-badge {
    top: 10px;
    right: 10px;
}
.wcard-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    min-width: 24px;
    height: 20px;
    padding: 0 7px;
    background: var(--red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: grid;
    place-items: center;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.wcard-frame {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}
.wcard-frame .l {
    position: absolute;
    background: var(--gold-bar);
    box-shadow: 0 0 0 0.5px var(--gold-bar);
}
.wcard-frame .l-r {
    top: 0; right: 0; width: 2px; height: 100%;
    transform: scaleY(0);
    transform-origin: top right;
    transition: transform .16s ease .48s;
}
.wcard-frame .l-b {
    right: 0; bottom: 0; height: 2px; width: 100%;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform .16s ease .32s;
}
.wcard-frame .l-l {
    left: 0; bottom: 0; width: 2px; height: 100%;
    transform: scaleY(0);
    transform-origin: bottom left;
    transition: transform .16s ease .16s;
}
.wcard-frame .l-t {
    left: 0; top: 0; height: 2px; width: 100%;
    transform: scaleX(0);
    transform-origin: top left;
    transition: transform .16s ease 0s;
}
.wcard:hover .l-r {
    transform: scaleY(1);
    transition: transform .18s ease 0s;
}
.wcard:hover .l-b {
    transform: scaleX(1);
    transition: transform .18s ease .16s;
}
.wcard:hover .l-l {
    transform: scaleY(1);
    transition: transform .18s ease .32s;
}
.wcard:hover .l-t {
    transform: scaleX(1);
    transition: transform .18s ease .48s;
}

/* ============ Login ============ */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #efeadd;
    background-image:
        repeating-linear-gradient(0deg, transparent 0 31px, rgba(0,0,0,.035) 31px 32px),
        repeating-linear-gradient(90deg, transparent 0 31px, rgba(0,0,0,.035) 31px 32px);
    padding: 20px;
}
.login-box {
    width: min(360px, 100%);
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 4px;
    box-shadow: 0 14px 40px rgba(60,48,10,.14);
    overflow: hidden;
    view-transition-name: login;
}
.login-top {
    background: #000;
    color: var(--gold);
    padding: 22px 16px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-logo {
    display: block;
    height: 58px;
    width: auto;
}
.login-body { padding: 20px 18px 18px; }
.login-body h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 4px; }
.login-body .sub { color: var(--ink-3); margin-bottom: 14px; }
.login-box-wide { width: min(400px, 100%); }
.login-note {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid var(--line-2);
    background: #f7f2e4;
    color: var(--ink-2);
    font-size: 13px;
    line-height: 1.45;
}
.login-foot {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-3);
}
.login-foot a { color: var(--ink-2); }

/* ============ Kullanıcı profilleri ============ */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
    gap: 12px;
}
.pcard {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 18px 16px 14px;
    min-height: 188px;
    background: var(--sheet);
    border: 1px solid var(--line-2);
    border-left: 3px solid var(--accent, var(--gold));
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}
.pcard:hover { background: var(--hover); }
.pcard.is-off { opacity: .58; }
.user-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    background: var(--accent, var(--gold));
    border: 1px solid color-mix(in srgb, var(--accent, var(--gold)) 70%, #000);
    vertical-align: middle;
}
.pcard-ava {
    position: relative;
    z-index: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent, var(--gold)) 16%, #fff);
    border: 1px solid color-mix(in srgb, var(--accent, var(--gold)) 42%, #fff);
    color: var(--accent, var(--gold-dark));
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.02em;
}
.pcard strong {
    position: relative;
    z-index: 1;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.pcard .sub,
.pcard .pill,
.pcard-today { position: relative; z-index: 1; }
.pcard-today {
    margin-top: auto;
    font-size: 12px;
    color: var(--ink-2);
    line-height: 1.35;
}

/* ============ Ders programı ============ */
.tt {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}
.tt-day {
    border: 1px solid var(--line);
    background: #fff;
    min-height: 240px;
    display: flex;
    flex-direction: column;
}
.tt-day.is-today {
    border-color: var(--gold-line);
    background: #fffdf6;
}
.tt-day-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    font-size: 12.5px;
    background: #fcfaf4;
}
.tt-day.is-today .tt-day-h { background: var(--gold-soft); }
.tt-empty {
    padding: 16px 10px;
    color: var(--ink-3);
    font-size: 12px;
}
.tt-les {
    margin: 8px;
    padding: 8px 10px;
    border-left: 3px solid var(--gold);
    background: #fcfaf4;
}
.tt-day.is-today .tt-les { background: #fff; }
.tt-les time {
    display: block;
    font-size: 11.5px;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}
.tt-les b {
    display: block;
    margin: 3px 0 2px;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
}
.tt-les span {
    display: block;
    font-size: 11.5px;
    color: var(--ink-2);
}
.tt-day-h .btn { margin-left: auto; }
.tt-les-act {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}
.today-lessons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

/* ============ Responsive ============ */
.rail-toggle { display: none; }
@media (max-width: 1100px) {
    .cols-main, .cols-form, .cols-profile { grid-template-columns: 1fr; }
    .cols-4 { grid-template-columns: repeat(2, 1fr); }
    .sheet-grid { grid-template-columns: 1fr; }
    .tt { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tt-day { min-height: 160px; }
}
@media (max-width: 860px) {
    .cols-2, .cols-3 { grid-template-columns: 1fr; }
    .tb-search { display: none; }
    .welcome-cards {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        gap: 12px;
    }
    .welcome-cards.welcome-more {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: none;
    }
    .wcard-lg,
    .welcome-cards.welcome-more .wcard-lg {
        grid-row: auto;
        grid-column: 1 / -1;
        min-height: 148px;
    }
    .welcome-cards.welcome-more .wcard-wide {
        grid-column: 1 / -1;
        min-height: 112px;
    }
    .welcome-cards.welcome-with-mail {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: none;
    }
    .welcome-cards.welcome-with-mail .wcard-lg {
        grid-row: auto;
        grid-column: 1 / -1;
        min-height: 148px;
    }
    .welcome-cards.welcome-with-mail .wcard-span {
        grid-column: 1 / -1;
    }
    .wcard { min-height: 108px; }
    .wcard-sm { min-height: 96px; }
    .welcome-trio {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: 96px;
        max-width: none;
    }
    .welcome-trio.welcome-trio-one {
        grid-template-columns: 1fr;
        max-width: 210px;
    }
    .welcome-trio .wcard { min-height: 0; }
    .tt { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rail {
        position: fixed;
        top: var(--titlebar-h);
        bottom: 0;
        left: 0;
        z-index: 50;
        max-height: none;
        transform: translateX(-102%);
        transition: transform .15s ease-out;
        box-shadow: 4px 0 18px rgba(0,0,0,.14);
    }
    body.rail-open .rail { transform: none; }
    .rail-toggle { display: inline-flex; }
    .rb-group { padding: 0 6px; }
    .rail { view-transition-name: none; }
    .tb-product { display: none; }
    .drawer, .drawer.sheet-lg { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
}
@media (max-width: 560px) {
    .welcome-trio,
    .welcome-trio.welcome-trio-one {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        max-width: none;
    }
    .welcome-trio .wcard { min-height: 84px; }
    .tt { grid-template-columns: 1fr; }
    .tt-day { min-height: 0; }
}

/* ============ Soft page transitions ============ */
@view-transition {
    navigation: none;
}

html.soft-nav .work,
html.soft-nav .login-box {
    opacity: 0;
    transform: translateY(8px);
}
html.soft-nav.is-ready .work,
html.soft-nav.is-ready .login-box {
    opacity: 1;
    transform: none;
    transition: opacity 220ms ease, transform 220ms ease;
}
html.soft-nav.is-leaving .work,
html.soft-nav.is-leaving .login-box {
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    html.soft-nav .work,
    html.soft-nav .login-box,
    html.soft-nav.is-leaving .work,
    html.soft-nav.is-leaving .login-box {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .drawer, .scrim { animation: none; }
    .wcard-frame .l {
        transition: none !important;
    }
}

/* ============ Teklif formu ============ */
.q-err {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #e2b4b4;
    background: #fff6f6;
}
.q-err strong { display: block; margin-bottom: 6px; color: #8a1f1f; }
.q-err ul { margin: 0; padding-left: 18px; }
.q-err li { margin: 3px 0; color: #6d2020; font-size: 13px; }
.q-table { min-width: 980px; }
.q-table th, .q-table td { vertical-align: top; }
.q-table .q-no { width: 36px; color: var(--ink-3); font-variant-numeric: tabular-nums; padding-top: 10px; }
.q-table input[type=text], .q-table input[type=number], .q-table select, .q-table textarea {
    width: 100%; min-width: 0;
    height: 28px; border: 1px solid var(--line); background: #fff;
    padding: 0 6px; font: inherit;
}
.q-table textarea { height: 46px; padding: 4px 6px; resize: vertical; }
.q-table input:focus, .q-table select:focus, .q-table textarea:focus {
    outline: none; border-color: var(--gold);
}
.q-table tr.is-head td { background: #f6f3ea; }
.q-table tr.is-note td { background: #faf9f6; }
.q-table tr.is-dragging { opacity: .45; }
.q-table tr.is-over { outline: 1px dashed var(--gold); }
.q-table .q-money { width: 92px; text-align: right; }
.q-table .q-qty { width: 72px; text-align: right; }
.q-table .q-type { width: 92px; }
.q-table .q-unit { width: 78px; }
.q-table .q-act { width: 78px; white-space: nowrap; }
.q-table .q-opt { width: 28px; text-align: center; padding-top: 8px; }
.q-drag {
    cursor: grab; color: var(--ink-3); user-select: none;
    display: inline-block; width: 14px; text-align: center;
}
.q-line {
    display: flex; gap: 6px; align-items: flex-start; margin-bottom: 6px;
}
.q-line input { flex: 1; }
.q-tot {
    position: sticky; top: calc(var(--titlebar-h) + 70px);
}
.q-tot-row {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 5px 0; font-size: 13px;
}
.q-tot-row b { font-variant-numeric: tabular-nums; }
.q-tot-grand {
    margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line);
    font-size: 16px;
}
.q-words { margin-top: 8px; font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.q-pay-warn {
    margin: 8px 0 0; padding: 7px 9px;
    background: #fff4f4; border: 1px solid #e8b4b4; color: #8a1f1f; font-size: 12.5px;
}
.q-client-btn {
    display: block; width: 100%; text-align: left;
    padding: 6px 8px; border: 0; background: transparent;
    border-bottom: 1px solid var(--line); cursor: pointer; font: inherit;
}
.q-client-btn:hover, .q-client-btn.is-on { background: var(--sel); }
.q-layer {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(20,16,8,.35);
    display: none; place-items: center; padding: 20px;
}
.q-layer.is-open { display: grid; }
.q-layer-card {
    width: min(640px, 100%); max-height: min(80vh, 720px);
    background: var(--sheet); border: 1px solid var(--line-2);
    display: flex; flex-direction: column;
}
.q-layer-card h3 { margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 15px; }
.q-layer-body { padding: 12px 14px; overflow: auto; flex: 1; }
.q-layer-foot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.q-cat-h { font-size: 11.5px; font-weight: 700; color: var(--ink-3); margin: 10px 0 4px; letter-spacing: .04em; }
.pdf-page { max-width: 860px; margin: 24px auto; background: #fff; padding: 28px 32px; }
.pdf-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.pdf-meta td { padding: 2px 10px 2px 0; font-size: 13px; }
.pdf-h { font-size: 13px; font-weight: 700; margin: 18px 0 8px; letter-spacing: .04em; }
.pdf-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pdf-tbl th, .pdf-tbl td { border-bottom: 1px solid #e6e1d4; padding: 6px 5px; }
.pdf-tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.pdf-row-h td { font-weight: 700; background: #f6f3ea; border-bottom-color: #d8d0bc; }
.pdf-row-n td { color: #444; font-style: italic; }
.pdf-opt { margin-top: 16px; }
.pdf-actions { margin: 16px auto 40px; max-width: 860px; display: flex; gap: 8px; }
@media print {
    .pdf-actions, .titlebar, .ribbon, .rail { display: none !important; }
    .pdf-page { margin: 0; padding: 0; }
}

/* ============ Mail workspace ============ */
body.mod-mail .work:has(.mail-split) {
    position: relative;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--titlebar-h) - var(--ribbon-h));
    min-height: calc(100vh - var(--titlebar-h) - var(--ribbon-h));
    overflow: hidden;
}
body.mod-mail .work:has(.mail-split) > .flash {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 8;
    width: min(480px, calc(100% - 24px));
    margin: 0;
    box-shadow: 0 8px 24px rgba(60, 48, 10, .12);
}
.mail-split {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
}
.mail-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 40%) minmax(0, 1fr);
    flex: 0 0 38px;
    height: 38px;
    background: #fcfaf4;
    border-bottom: 1px solid var(--line);
}
.mail-toolbar .pane-head {
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    padding: 0 12px;
    border-bottom: 0;
    background: transparent;
    box-sizing: border-box;
    align-items: center;
    line-height: 1;
    overflow: hidden;
}
.mail-toolbar .pane-head svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}
.mail-toolbar-list {
    border-right: 1px solid var(--line);
}
.mail-cols {
    display: grid;
    grid-template-columns: minmax(280px, 40%) minmax(0, 1fr);
    flex: 1;
    min-height: 0;
    align-items: stretch;
}
.mail-cols > .pane {
    height: auto;
    min-height: 0;
    margin: 0;
    border-radius: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    background: var(--sheet);
}
.mail-list {
    border-right: 1px solid var(--line);
}
.mail-list-body,
.mail-preview-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
}
.mail-row {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #efece4;
    color: inherit;
    align-items: flex-start;
}
.mail-row:hover { background: var(--hover); }
.mail-row.is-on { background: var(--sel); }
.mail-row.is-unread .mail-subj,
.mail-row.is-unread strong { font-weight: 700; }
.mail-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    margin-top: 7px;
    flex: 0 0 8px;
}
.mail-row.is-unread .mail-dot { background: var(--gold); }
.mail-row-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mail-row-top {
    display: flex;
    gap: 8px;
    align-items: baseline;
}
.mail-row-top strong {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mail-row-top time {
    margin-left: auto;
    color: var(--ink-3);
    font-size: 11.5px;
    white-space: nowrap;
}
.mail-subj {
    font-size: 13.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mail-snip {
    color: var(--ink-3);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mail-preview-title {
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.mail-meta {
    display: grid;
    grid-template-columns: 1.2fr 1fr auto;
    gap: 12px 16px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.mail-meta-subj {
    grid-column: 1 / -1;
}
.mail-meta .muted {
    display: block;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.mail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.mail-body {
    font-size: 14px;
    line-height: 1.55;
}
.mail-body p { margin: 0 0 10px; }
@media (max-width: 860px) {
    .mail-toolbar,
    .mail-cols { grid-template-columns: 1fr; }
    .mail-toolbar { height: auto; flex-basis: auto; }
    .mail-toolbar-list { border-right: 0; border-bottom: 1px solid var(--line); }
    .mail-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 42vh; }
    .mail-meta { grid-template-columns: 1fr; }
}

.qst-taslak { background: #ececec; border-color: #cfcfcf; color: #555; }
.qst-gonderildi { background: #e3eef9; border-color: #9bb8d9; color: #1f5fa9; }
.qst-revize { background: #fff1e0; border-color: #e0b07a; color: #b25d12; }
.qst-kabul { background: #e5f4ea; border-color: #8fc9a0; color: #1e7a45; }
.qst-red { background: #fde8e6; border-color: #e3a39d; color: #b3261e; }
.qst-doldu { background: #d8d8d8; border-color: #9a9a9a; color: #333; }
.qst-follow { background: #fff7d6; border-color: #e0c86a; color: #7a5b00; }
.q-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.q-stat { min-width: 140px; padding: 10px 12px; border: 1px solid var(--line); background: var(--sheet); }
.q-stat span { display: block; font-size: 11.5px; color: var(--ink-3); }
.q-stat b { font-size: 16px; }
.q-warn-dot {
    display: inline-grid; place-items: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #c45c26; color: #fff; font-size: 11px; font-weight: 700;
    margin-left: 4px;
}
.q-follow { color: #7a5b00; font-weight: 600; }
.q-acts form { display: inline; }
.q-row-old td { background: #faf8f2; }
.q-tl { list-style: none; margin: 0; padding: 0; }
.q-tl li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.q-tl-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.q-diff { list-style: none; margin: 10px 0 0; padding: 0; }
.q-diff li { padding: 4px 0; }
.q-diff-add { color: #1e7a45; }
.q-diff-del { color: #b3261e; text-decoration: line-through; }
.q-diff-change { color: #9a6300; }

.q-lead { margin: -4px 0 14px; }
.q-create { max-width: 1180px; }
.q-meta {
    display: flex; flex-wrap: wrap; gap: 14px 22px;
    align-items: flex-end;
    margin: 0 0 12px;
    padding: 10px 12px;
    background: var(--sheet);
    border: 1px solid var(--line);
}
.q-meta > div, .q-meta > label {
    display: flex; flex-direction: column; gap: 3px;
    font-size: 12px;
}
.q-meta span { color: var(--ink-3); font-size: 11px; font-weight: 600; }
.q-meta b { font-size: 13px; }
.q-meta input[type=date], .q-meta input[type=number] {
    height: 28px; border: 1px solid var(--line-2); padding: 0 8px; width: 140px;
}
.q-meta label { color: var(--ink-2); font-weight: 600; font-size: 11px; }
.q-combo { position: relative; }
.q-suggest {
    position: absolute; left: 0; right: 0; top: calc(100% - 4px);
    z-index: 30; background: #fff;
    border: 1px solid var(--line-2);
    max-height: 260px; overflow: auto;
}
.q-suggest-item {
    display: block; width: 100%; text-align: left;
    padding: 8px 10px; border: 0; background: transparent;
    border-bottom: 1px solid var(--line); cursor: pointer; font: inherit;
}
.q-suggest-item b { display: block; font-weight: 600; }
.q-suggest-item .sub { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.q-suggest-item:hover, .q-suggest-item.is-active { background: var(--sel); }
.q-suggest-empty { padding: 8px 10px; font-size: 12px; color: var(--ink-3); }
.q-fold { margin-top: 4px; }
.q-fold > summary {
    cursor: pointer; font-size: 12px; color: var(--ink-2); font-weight: 600;
    padding: 4px 0;
}
.q-fold[open] > summary { margin-bottom: 8px; }
.q-inline { display: flex; gap: 6px; }
.q-inline input { flex: 1; min-width: 0; }
.q-intro { width: 100%; min-height: 64px; }
.q-item-stack { display: grid; gap: 3px; }
.q-item-note { font-size: 12px; color: var(--ink-2); }
.q-table { min-width: 760px; }
.q-addbar {
    display: flex; gap: 6px; flex-wrap: wrap;
    padding: 8px 10px; border-top: 1px solid var(--line);
}
.q-opt-lab {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; color: var(--ink-3); margin-right: 4px;
    white-space: nowrap;
}
.q-tabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--line);
    padding: 0 8px;
}
.q-tabs button {
    height: 36px; padding: 0 12px; border: 0; background: transparent;
    font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2);
    cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.q-tabs button.is-on { color: var(--ink); border-bottom-color: var(--gold-dark); }
.q-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.q-chip {
    height: 26px; padding: 0 9px; max-width: 100%;
    border: 1px solid var(--line); background: #fff;
    font: inherit; font-size: 12px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.q-chip:hover { border-color: var(--gold-dark); }
@media (max-width: 900px) {
    .q-meta { flex-direction: column; align-items: stretch; }
    .q-meta input[type=date], .q-meta input[type=number] { width: 100%; }
}
