/* PetroDoctor Client app — dark, tool-like, thumb-first. Same palette as the website. */
:root {
  --bg: #071425; --bg2: #0B1D33; --card: #102844; --card2: #14304F; --line: rgba(255, 255, 255, .08);
  --tx: #E9EEF6; --mu: #93A3BA; --gold: #C9A13B; --gold2: #E2C36A; --ok: #4FB38A; --warn: #E0A23A; --bad: #D9675C;
  --r: 16px; --sa-b: env(safe-area-inset-bottom); --sa-t: env(safe-area-inset-top);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font-family: var(--sans); font-size: 16px; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--gold2); }
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; background: radial-gradient(120% 60% at 50% -10%, #12345A 0%, var(--bg) 60%); }
.splash { display: grid; place-items: center; height: 100vh; }
.splash img { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.94); } }
.ic { width: 22px; height: 22px; flex: none; }
.ic.big { width: 34px; height: 34px; }
.muted { color: var(--mu); } .center { text-align: center; } .fine { color: var(--mu); font-size: .78rem; line-height: 1.5; }

/* top bar + bottom tabs */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(12px + var(--sa-t)) 18px 12px; background: rgba(7, 20, 37, .82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.bar-t { font-size: 1.06rem; font-weight: 600; margin: 0; }
.bar-back { color: var(--tx); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--card); }
[dir="rtl"] .bar-back svg { transform: scaleX(-1); }
.view { padding: 18px 18px calc(110px + var(--sa-b)); }
.tabs { position: fixed; z-index: 30; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 10px calc(8px + var(--sa-b)); background: rgba(9, 24, 43, .94); backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--mu); text-decoration: none; font-size: .7rem; font-weight: 500; border-radius: 12px; }
.tab.on { color: var(--gold2); }
.tab-new .ic { background: var(--gold); color: #0B1D33; border-radius: 12px; padding: 4px; width: 32px; height: 32px; margin-top: -4px; box-shadow: 0 6px 18px -6px rgba(201, 161, 59, .7); }

/* cards and lists */
.card { display: block; background: linear-gradient(180deg, var(--card), var(--bg2)); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; color: var(--tx); text-decoration: none; }
.sec { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--mu); margin: 26px 2px 10px; font-weight: 600; }
.hello h2 { margin: 2px 0 2px; font-size: 1.6rem; }
.eyebrow { color: var(--gold2); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; margin: 4px 0 0; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 14px; }
.kpis div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.kpis b { display: block; font-size: 1.6rem; color: var(--tx); }
.kpis span { font-size: .74rem; color: var(--mu); }
.kpis .hot b { color: var(--gold2); }
.hero-cta { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); text-decoration: none; color: #0B1D33; background: linear-gradient(120deg, var(--gold2), var(--gold)); box-shadow: 0 14px 30px -16px rgba(201, 161, 59, .8); }
.hero-cta div { flex: 1; } .hero-cta b { display: block; font-size: 1.02rem; } .hero-cta span { font-size: .82rem; opacity: .8; }
.req-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.req-id { font-size: .8rem; color: var(--mu); font-weight: 500; }
.req p { margin: 10px 0; line-height: 1.5; font-size: .94rem; }
.req-foot { display: flex; justify-content: space-between; align-items: center; color: var(--mu); font-size: .78rem; }
.dot { background: var(--gold); color: #0B1D33; border-radius: 999px; padding: 1px 8px; font-weight: 700; }
.chip { font-size: .7rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--tx); white-space: nowrap; }
.chip-new { background: rgba(147, 163, 186, .18); } .chip-replied, .chip-qualified { background: rgba(226, 195, 106, .18); color: var(--gold2); }
.chip-proposal { background: rgba(224, 162, 58, .2); color: var(--warn); } .chip-won { background: rgba(79, 179, 138, .2); color: var(--ok); }
.chip-lost, .chip-closed { background: rgba(217, 103, 92, .16); color: var(--bad); }
.empty { text-align: center; color: var(--mu); padding: 30px 10px; border: 1px dashed var(--line); border-radius: var(--r); }
.how { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.how li { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; color: var(--mu); }
.how b { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--card2); color: var(--gold2); font-size: .78rem; }
.links { display: flex; gap: 18px; margin-top: 22px; font-size: .88rem; }
.skeleton { height: 220px; border-radius: var(--r); background: linear-gradient(90deg, var(--card) 0%, var(--card2) 50%, var(--card) 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* request detail */
.stepper { list-style: none; padding: 0; margin: 16px 0 6px; display: grid; grid-template-columns: repeat(5, 1fr); font-size: .64rem; color: var(--mu); text-align: center; }
.stepper li { position: relative; padding-top: 16px; }
.stepper li span { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 10px; height: 10px; border-radius: 50%; background: var(--card2); border: 2px solid var(--mu); }
.stepper li::before { content: ""; position: absolute; top: 5px; left: -50%; width: 100%; height: 2px; background: var(--card2); }
.stepper li:first-child::before { display: none; }
.stepper li.done span { background: var(--gold); border-color: var(--gold); } .stepper li.done::before { background: var(--gold); }
.stepper li.cur { color: var(--gold2); font-weight: 600; }
.stepper.is-closed { opacity: .5; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 10px; }
.facts dt { font-size: .7rem; color: var(--mu); text-transform: uppercase; letter-spacing: .08em; } .facts dd { margin: 2px 0 0; font-size: .9rem; }
.orig { white-space: pre-wrap; font-size: .92rem; line-height: 1.55; border-top: 1px solid var(--line); padding-top: 12px; margin: 0; color: #D3DCE8; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg-b { max-width: 86%; padding: 10px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.msg-b p { margin: 0 0 4px; white-space: pre-wrap; line-height: 1.5; font-size: .93rem; }
.msg-b span { font-size: .68rem; color: var(--mu); }
.msg-b.me { align-self: flex-end; background: linear-gradient(120deg, #3A3016, #2A2410); border-color: rgba(201, 161, 59, .3); }
.composer { position: fixed; z-index: 25; left: 50%; transform: translateX(-50%); bottom: calc(66px + var(--sa-b)); width: 100%; max-width: 560px; display: flex; gap: 8px; padding: 10px 14px; background: rgba(7, 20, 37, .94); border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; border-radius: 20px; padding: 10px 14px; }
.composer button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--gold); color: #0B1D33; display: grid; place-items: center; cursor: pointer; }

/* forms */
.form label { display: block; font-size: .82rem; color: var(--mu); margin-bottom: 14px; font-weight: 500; }
input, select, textarea { width: 100%; margin-top: 6px; font: inherit; font-size: 16px; color: var(--tx); background: #0A1A2E; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; padding: 12px 14px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 161, 59, .18); }
.form small { display: block; margin-top: 6px; font-weight: 400; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); color: var(--tx); font-size: .86rem; }
.pill input:checked + span { background: var(--gold); border-color: var(--gold); color: #0B1D33; font-weight: 600; }
.pill input:focus-visible + span { box-shadow: 0 0 0 3px rgba(201, 161, 59, .35); }
.form label.chk { display: flex; gap: 10px; align-items: flex-start; color: var(--tx); font-weight: 400; }
.chk input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--gold); }
.msg { min-height: 1.2em; font-size: .85rem; color: var(--gold2); margin: 0 0 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px 20px; border-radius: 14px; border: 0; background: var(--gold); color: #0B1D33; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .6; }
.btn-s { width: auto; margin-top: 14px; padding: 10px 18px; }
.btn-ghost { background: transparent; color: var(--bad); border: 1px solid rgba(217, 103, 92, .4); margin-top: 6px; }

/* auth */
.auth { padding: calc(40px + var(--sa-t)) 22px 40px; }
.auth-top { text-align: center; margin-bottom: 26px; }
.auth-top h1 { margin: 10px 0 4px; font-size: 1.7rem; letter-spacing: .01em; }
.auth-top p { color: var(--mu); margin: 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.seg a { text-align: center; padding: 10px; border-radius: 10px; color: var(--mu); text-decoration: none; font-weight: 600; font-size: .9rem; }
.seg a.on { background: var(--card2); color: var(--tx); }
.auth-foot { display: flex; justify-content: center; align-items: center; gap: 8px; color: var(--mu); font-size: .85rem; }
.auth-foot select { width: auto; margin: 0; padding: 6px 10px; }

/* profile */
.profile { display: flex; gap: 14px; align-items: center; }
.profile b, .profile span { display: block; } .profile span { color: var(--mu); font-size: .86rem; }
.avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; background: linear-gradient(135deg, var(--gold2), var(--gold)); color: #0B1D33; }
.list { padding: 4px 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 16px; color: var(--tx); text-decoration: none; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; } .li span { flex: 1; } .li i { color: var(--mu); font-style: normal; }
.li select { width: auto; margin: 0; padding: 6px 10px; }

@media (min-width: 561px) { .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
