:root { --ink: #0b0b10; --panel: #15151c; --line: rgba(247, 244, 237, 0.1); --cream: #f7f4ed; --muted: rgba(247, 244, 237, 0.55); --caramel: #cd9a70; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--ink); color: var(--cream); font-family: "Outfit", system-ui, sans-serif; font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
h1 span { color: var(--caramel); font-weight: 500; }
button, .ghost { cursor: pointer; border-radius: 12px; border: 0; padding: 10px 16px; background: var(--caramel); color: var(--ink); font-weight: 700; text-decoration: none; display: inline-block; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--cream); font-weight: 500; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--caramel); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login__box { width: min(360px, 100%); display: grid; gap: 16px; background: var(--panel); padding: 32px; border-radius: 22px; border: 1px solid var(--line); }
.login__box label { display: grid; gap: 6px; color: var(--muted); }
.err { color: #f07a6c; min-height: 1.2em; }
.login__box .check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.login__box .check input { width: 18px; height: 18px; accent-color: var(--caramel); }
.remembered { color: var(--muted); font-size: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.link { background: none; border: 0; padding: 0; color: var(--caramel); font-weight: 500; text-decoration: underline; cursor: pointer; }

.app { padding: 20px clamp(14px, 3vw, 36px) 40px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.top__actions { display: flex; gap: 10px; align-items: center; }
.q { width: 280px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 22px 0 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.stat small { color: var(--muted); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { background: transparent; border: 1px solid var(--line); color: var(--cream); font-weight: 500; padding: 8px 14px; }
.tab[aria-pressed="true"] { background: var(--cream); color: var(--ink); }

.layout { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 16px; align-items: start; }
.list { list-style: none; display: grid; gap: 8px; max-height: calc(100vh - 260px); overflow: auto; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; display: grid; gap: 4px; }
.item:hover, .item[aria-current="true"] { border-color: var(--caramel); }
.item__top { display: flex; justify-content: space-between; gap: 10px; }
.item__top b { font-weight: 700; }
.item small { color: var(--muted); }
.badge { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; white-space: nowrap; align-self: start; }
.b-yeni { background: #cd9a70; color: #0b0b10; }
.b-arandi { background: #3a4a6b; }
.b-teklif { background: #6b5a2e; }
.b-kazanildi { background: #2e7d4f; }
.b-kaybedildi { background: #5a2c2c; }

.detail { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; position: sticky; top: 20px; }
.empty { color: var(--muted); }
.detail h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.detail .sub { color: var(--muted); margin-top: 2px; }
.appt { margin: 18px 0; padding: 14px 16px; border-radius: 14px; background: rgba(205, 154, 112, 0.12); border: 1px solid rgba(205, 154, 112, 0.4); font-weight: 700; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 16px 0; }
.kv dt { color: var(--muted); }
.kv dd { word-break: break-word; }
.kv a { color: var(--caramel); }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.detail label { display: grid; gap: 6px; color: var(--muted); margin-top: 14px; }
.danger { background: transparent; border: 1px solid #5a2c2c; color: #f07a6c; font-weight: 500; }
.saved { color: #7fd4a0; align-self: center; }
.top__actions .ghost { white-space: nowrap; }
.tab--due { border-color: rgba(205, 154, 112, 0.5); }
.item__deal { color: var(--caramel) !important; font-weight: 500; }
.item__deal.is-due { color: #f0b37a !important; font-weight: 700; }
.deal { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; }
.detail h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.detail .note { margin-top: 12px; }
input[type="date"] { color-scheme: dark; }
.timeline { list-style: none; margin-top: 18px; display: grid; gap: 0; max-height: 360px; overflow: auto; }
.tl { position: relative; padding: 0 0 16px 20px; border-left: 1px solid var(--line); margin-left: 5px; }
.tl::before { content: ""; position: absolute; left: -5px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.tl--note::before { background: var(--caramel); }
.tl--status::before { background: var(--cream); }
.tl time { font-size: 12px; color: var(--muted); }
.tl p { margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.tl--field p, .tl--created p { color: var(--muted); }
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } .list { max-height: none; } .q { width: 100%; } .top__actions { width: 100%; } }
