:root {
  --ink: #24211f;
  --ink-2: #332f2c;
  --muted: #77706a;
  --line: #e6dfd8;
  --surface: #ffffff;
  --canvas: #f6f3ef;
  --amber: #f7ac38;
  --amber-dark: #d98716;
  --coral: #e75b4f;
  --green: #298f61;
  --orange: #dd8b20;
  --red: #c5473d;
  --blue: #4978aa;
  --brand-black: #000000;
  --shadow: 0 18px 60px rgba(45, 34, 25, .08);
  --shadow-sm: 0 8px 30px rgba(45, 34, 25, .08);
  --radius: 22px;
  --radius-sm: 14px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--canvas); -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: var(--amber-dark); font-size: .7rem; font-weight: 850; letter-spacing: .16em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.loading-screen {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; align-content: center; gap: 28px;
  background: var(--brand-black);
}
.loading-screen img { width: 260px; }
.loader { width: 30px; height: 30px; border: 3px solid rgba(247,172,56,.22); border-top-color: var(--amber); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-screen {
  position: relative; isolation: isolate; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; overflow-x: hidden; overflow-y: auto; padding: 32px;
  background: #080706;
}
.auth-screen::before {
  content: ''; position: absolute; z-index: -2; inset: -4%;
  background: url('/assets/login-fireplace.webp') center 57% / cover no-repeat;
  animation: authScene 18s ease-in-out infinite alternate; will-change: transform;
}
.auth-screen::after {
  content: ''; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(115deg, rgba(0,0,0,.82), rgba(0,0,0,.28) 43%, rgba(0,0,0,.64)), linear-gradient(0deg, rgba(0,0,0,.38), transparent 48%);
}
@keyframes authScene { from { transform: scale(1.025) translate3d(-.5%, 0, 0); } to { transform: scale(1.075) translate3d(.7%, -.7%, 0); } }
.auth-card {
  position: relative; z-index: 2; width: min(478px, 100%); margin: 0; padding: clamp(29px, 3.5vw, 42px); overflow: hidden;
  border: 1px solid rgba(255,255,255,.15); border-radius: 30px; color: #fff;
  background: linear-gradient(145deg, rgba(12,11,10,.91), rgba(3,3,3,.82));
  box-shadow: 0 35px 100px rgba(0,0,0,.55), inset 0 1px rgba(255,255,255,.08);
  backdrop-filter: blur(24px) saturate(120%); -webkit-backdrop-filter: blur(24px) saturate(120%);
  animation: authCardIn .72s cubic-bezier(.2,.8,.2,1) both;
}
.auth-card::before { content: ''; position: absolute; inset: 0 12% auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(247,172,56,.9), transparent); }
.auth-card::after { content: ''; position: absolute; right: -100px; bottom: -120px; width: 270px; height: 270px; border-radius: 50%; background: radial-gradient(circle, rgba(247,172,56,.16), transparent 68%); pointer-events: none; }
.auth-card > * { position: relative; z-index: 1; }
@keyframes authCardIn { from { opacity: 0; transform: translateY(24px) scale(.975); } to { opacity: 1; transform: translateY(0) scale(1); } }
.auth-brand { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 34px; padding-bottom: 23px; border-bottom: 1px solid rgba(255,255,255,.11); }
.auth-brand img { width: 185px; flex: none; }
.auth-access-badge { display: inline-flex; align-items: center; gap: 7px; color: rgba(255,255,255,.58); font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.auth-access-badge i, .auth-secure i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px rgba(247,172,56,.1), 0 0 18px rgba(247,172,56,.65); animation: authPulse 2.4s ease-in-out infinite; }
@keyframes authPulse { 50% { opacity: .55; transform: scale(.78); box-shadow: 0 0 0 8px rgba(247,172,56,0); } }
.auth-card .eyebrow { margin-bottom: 10px; color: var(--amber); }
.auth-card h1 { margin: 0; color: #fff; font-size: clamp(2.65rem, 5vw, 3.55rem); line-height: .94; letter-spacing: -.06em; }
.auth-card h1 span { color: var(--amber); }
.auth-card h1 + p, .auth-card #invite-email { margin: 17px 0 29px; }
.auth-card .muted { color: rgba(255,255,255,.55); }
.auth-intro { max-width: 330px; font-size: .84rem; line-height: 1.55; }
.auth-card .stack-form { gap: 16px; }
.auth-card label { gap: 8px; color: rgba(255,255,255,.66); font-size: .69rem; letter-spacing: .025em; }
.auth-input { display: flex; align-items: center; min-height: 55px; overflow: hidden; border: 1px solid rgba(255,255,255,.13); border-radius: 14px; background: rgba(255,255,255,.065); transition: border-color .2s, background .2s, box-shadow .2s, transform .2s; }
.auth-input:focus-within { border-color: rgba(247,172,56,.78); background: rgba(255,255,255,.09); box-shadow: 0 0 0 4px rgba(247,172,56,.1); transform: translateY(-1px); }
.auth-input i { width: 48px; flex: none; display: grid; place-items: center; color: var(--amber); font-size: .78rem; font-style: normal; font-weight: 900; }
.auth-input input { min-height: 53px; padding: 0 15px 0 0; border: 0; border-radius: 0; color: #fff; background: transparent; box-shadow: none; }
.auth-input input:focus { border: 0; box-shadow: none; }
.auth-input input::placeholder { color: rgba(255,255,255,.3); }
.auth-submit { position: relative; justify-content: space-between; min-height: 56px; margin-top: 7px; padding: 10px 12px 10px 21px; overflow: hidden; font-size: .86rem; box-shadow: 0 14px 35px rgba(247,172,56,.2); }
.auth-submit::before { content: ''; position: absolute; top: -100%; left: -35%; width: 28%; height: 300%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent); transform: rotate(20deg); transition: left .55s ease; }
.auth-submit:hover::before { left: 115%; }
.auth-button-arrow { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: #1c1710; font-size: 1.08rem; transition: transform .2s; }
.auth-submit:hover .auth-button-arrow { transform: translateX(3px); }
.auth-card .form-error { margin-top: 16px; color: #ffc9c4; background: rgba(197,71,61,.2); border-color: rgba(255,130,120,.28); }
.auth-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 25px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.09); color: rgba(255,255,255,.38); font-size: .61rem; font-weight: 700; letter-spacing: .04em; }
.auth-secure { display: inline-flex; align-items: center; gap: 9px; }
.auth-secure i { width: 5px; height: 5px; }
.auth-version { color: rgba(255,255,255,.38); font-weight: 750; letter-spacing: .08em; }
.auth-visual { position: absolute; z-index: 1; inset: 0; pointer-events: none; }
.auth-visual::after { content: ''; position: absolute; left: 50%; bottom: 4%; width: 340px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(247,172,56,.24), transparent 68%); filter: blur(28px); transform: translateX(-50%); animation: fireGlow 3.2s ease-in-out infinite alternate; }
@keyframes fireGlow { to { opacity: .62; transform: translateX(-50%) scale(1.12); } }
.auth-visual-copy { position: absolute; left: clamp(28px, 5vw, 80px); bottom: clamp(28px, 5vw, 72px); color: #fff; text-shadow: 0 3px 25px rgba(0,0,0,.5); }
.visual-line { display: block; width: 52px; height: 4px; margin-bottom: 17px; border-radius: 4px; background: var(--amber); box-shadow: 0 0 22px rgba(247,172,56,.45); }
.auth-visual-copy p { margin: 0; font-size: clamp(1.45rem, 2.35vw, 2.65rem); font-weight: 760; line-height: 1.02; letter-spacing: -.045em; }
.auth-visual-copy small { display: block; margin-top: 13px; color: rgba(255,255,255,.54); font-size: .65rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }

.stack-form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; color: var(--ink-2); font-size: .78rem; font-weight: 750; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; outline: none;
  color: var(--ink); background: #fff; transition: border-color .18s, box-shadow .18s;
}
textarea { min-height: 112px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(247,172,56,.14); }
input[type="checkbox"] { width: 20px; min-height: 20px; accent-color: var(--amber-dark); }
.form-error { padding: 12px 14px; color: var(--red); background: #fff0ee; border: 1px solid #f3c3be; border-radius: 12px; font-size: .84rem; }

.btn {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 17px;
  border: 0; border-radius: 12px; font-weight: 780; transition: transform .15s, background .15s, opacity .15s; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: not-allowed; opacity: .56; transform: none; }
.btn-primary { color: #241a0a; background: var(--amber); box-shadow: 0 8px 20px rgba(247,172,56,.22); }
.btn-primary:hover { background: #ffb84a; }
.btn-dark { color: #fff; background: var(--ink); }
.btn-ghost { color: var(--ink); background: #f1ede8; }
.btn-danger { color: #fff; background: var(--red); }
.btn-outline { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.btn-small { min-height: 36px; padding: 8px 12px; border-radius: 10px; font-size: .78rem; }
.btn-block { width: 100%; min-height: 52px; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 11px; background: transparent; color: inherit; font-size: 1.25rem; }
.icon-button:hover { background: rgba(127,110,95,.1); }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; z-index: 30; inset: 0 auto 0 0; width: 252px; display: flex; flex-direction: column; padding: 30px 20px 20px;
  color: rgba(255,255,255,.8); background: var(--brand-black); overflow-x: hidden; overflow-y: auto;
}
.sidebar::before { content: ''; position: absolute; inset: 0 0 auto; width: 100%; height: 180px; background: radial-gradient(circle at 105% 0, rgba(247,172,56,.13), transparent 68%); pointer-events: none; }
.sidebar-brand { position: relative; display: flex; align-items: flex-end; gap: 8px; width: 100%; height: 58px; margin: 0 0 36px; text-decoration: none; }
.sidebar-brand img { width: 150px; flex: 0 1 auto; }
.sidebar-brand span { padding-bottom: 7px; color: var(--amber); font-size: .55rem; letter-spacing: .14em; font-weight: 900; }
.main-nav { display: grid; gap: 7px; }
.nav-item {
  display: flex; align-items: center; gap: 13px; min-height: 47px; padding: 10px 12px; border: 0; border-radius: 12px;
  color: rgba(255,255,255,.65); background: transparent; text-decoration: none; font-size: .88rem; font-weight: 700; text-align: left;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #231b0e; background: var(--amber); }
.nav-symbol { width: 24px; display: inline-grid; place-items: center; font-size: 1rem; font-weight: 900; }
.sidebar-footer { display: grid; gap: 13px; margin-top: auto; padding-top: 26px; }
.sidebar-version { justify-self: end; padding-right: 3px; color: rgba(255,255,255,.5); font-size: .64rem; font-weight: 750; letter-spacing: .08em; }
.install-button { width: 100%; min-height: 43px; display: flex; align-items: center; gap: 10px; padding: 8px 11px; border: 1px solid rgba(247,172,56,.3); border-radius: 12px; color: var(--amber); background: rgba(247,172,56,.08); font-weight: 730; }
.user-card { display: grid; grid-template-columns: 39px 1fr 35px; gap: 10px; align-items: center; padding: 11px; border-radius: 14px; background: rgba(255,255,255,.055); }
.user-card strong, .user-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card strong { color: #fff; font-size: .78rem; }
.user-card span { margin-top: 3px; color: rgba(255,255,255,.48); font-size: .66rem; }
.user-details { min-width: 0; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.avatar { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: #241a0a; background: var(--amber); font-size: .72rem; font-weight: 900; }

.content-area { min-height: 100vh; margin-left: 252px; padding: 42px clamp(28px, 4.4vw, 72px) 70px; }
.mobile-app-version { display: none; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.page-header h1 { margin: 0; font-size: clamp(2rem, 3.2vw, 3.15rem); letter-spacing: -.055em; line-height: 1; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.page-content { max-width: 1500px; margin: 0 auto; }
.mobile-header, .mobile-nav { display: none; }

.page-loader { min-height: 300px; display: grid; place-items: center; align-content: center; gap: 16px; color: var(--muted); }
.surface { background: var(--surface); border: 1px solid rgba(220,210,201,.74); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.surface-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 23px; border-bottom: 1px solid var(--line); }
.surface-header h2, .surface-header h3 { margin: 0; font-size: 1.05rem; }
.surface-body { padding: 22px; }
.section-title { margin: 0; font-size: 1.2rem; letter-spacing: -.025em; }
.section-copy { margin: 7px 0 0; color: var(--muted); font-size: .84rem; }
.dashboard-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.clock-card {
  position: relative; min-height: 275px; padding: 27px; overflow: hidden; color: #fff;
  background: linear-gradient(140deg, #2c2926, #151413); border-radius: var(--radius); box-shadow: var(--shadow);
}
.clock-card::after { content: ''; position: absolute; right: -55px; bottom: -75px; width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(circle, rgba(247,172,56,.42), transparent 68%); }
.clock-card > * { position: relative; z-index: 1; }
.clock-card .eyebrow { color: var(--amber); }
.clock-card h2 { margin: 0 0 9px; font-size: 1.65rem; letter-spacing: -.035em; }
.live-duration { margin: 24px 0 6px; font-size: clamp(2.4rem, 5vw, 4.15rem); font-weight: 780; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.clock-subline { color: rgba(255,255,255,.58); font-size: .83rem; }
.clock-actions { display: flex; gap: 10px; margin-top: 25px; }
.clock-actions .btn-primary { flex: 1; }
.location-message { display: flex; align-items: center; gap: 8px; margin-top: 13px; color: rgba(255,255,255,.65); font-size: .75rem; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card { padding: 19px; }
.stat-card span { display: block; color: var(--muted); font-size: .75rem; font-weight: 700; }
.stat-card strong { display: block; margin-top: 8px; font-size: 1.75rem; letter-spacing: -.04em; }

.worker-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; }
.worker-card { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.worker-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.worker-name { display: flex; align-items: center; gap: 10px; font-size: .86rem; font-weight: 780; }
.worker-dot { width: 9px; height: 9px; border-radius: 50%; background: #bcb5ae; box-shadow: 0 0 0 5px rgba(188,181,174,.13); }
.worker-card.working .worker-dot { background: var(--green); box-shadow: 0 0 0 5px rgba(41,143,97,.12); }
.worker-meta { display: grid; gap: 5px; margin-top: 14px; color: var(--muted); font-size: .72rem; }
.worker-duration { color: var(--ink); font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.badge { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 5px 9px; border-radius: 999px; font-size: .67rem; font-weight: 850; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { color: var(--green); background: #eaf7f0; }
.badge-orange { color: var(--orange); background: #fff4df; }
.badge-red { color: var(--red); background: #fff0ee; }
.badge-gray { color: #77716c; background: #f1eeeb; }
.badge-blue { color: var(--blue); background: #edf4fb; }

.filter-bar { display: grid; grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(125px, .7fr)) auto; gap: 10px; align-items: end; }
.filter-bar label { font-size: .69rem; }
.filter-bar input, .filter-bar select { min-height: 42px; padding: 9px 11px; }
.filters-wrap { padding: 16px; margin-bottom: 18px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: .78rem; vertical-align: middle; }
th { color: var(--muted); background: #fbfaf8; font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fffcf7; }
.table-main { display: grid; gap: 3px; }
.table-main strong { font-size: .82rem; }
.table-main span { color: var(--muted); font-size: .69rem; }
.empty-state { min-height: 230px; display: grid; place-items: center; align-content: center; padding: 35px; text-align: center; color: var(--muted); }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 18px; color: var(--amber-dark); background: #fff3df; font-size: 1.5rem; }
.empty-state h3 { margin: 0 0 8px; color: var(--ink); }
.empty-state p { max-width: 390px; margin: 0; font-size: .83rem; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.item-card { overflow: hidden; }
.item-image { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #eee8e2; }
.item-card-body { padding: 17px; }
.item-card-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.item-card h3 { margin: 0; font-size: 1rem; }
.item-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 13px; color: var(--muted); font-size: .72rem; }
.item-actions { display: flex; gap: 8px; margin-top: 16px; }

.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.stock-card { position: relative; padding: 20px; overflow: hidden; }
.stock-card::after { content: ''; position: absolute; right: -25px; bottom: -25px; width: 85px; height: 85px; border: 14px solid rgba(247,172,56,.08); border-radius: 50%; }
.stock-card h3 { min-height: 42px; margin: 0; font-size: .96rem; }
.stock-units { margin: 17px 0 12px; font-size: 2.2rem; font-weight: 850; letter-spacing: -.05em; }
.stock-units small { margin-left: 4px; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: 0; }
.stock-actions { position: relative; z-index: 1; display: flex; gap: 7px; margin-top: 16px; }

.maintenance-groups { display: grid; gap: 14px; }
.client-group { overflow: hidden; }
.client-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 18px 21px; background: #fff; }
.client-head h3 { margin: 0; font-size: .98rem; }
.client-head p { margin: 4px 0 0; color: var(--muted); font-size: .72rem; }
.maintenance-line { display: grid; grid-template-columns: 1.2fr .75fr .75fr 1fr 2fr; gap: 15px; padding: 15px 21px; border-top: 1px solid var(--line); background: #fcfbf9; font-size: .75rem; }
.maintenance-line strong, .maintenance-line span { display: block; }
.maintenance-line span { margin-top: 4px; color: var(--muted); font-size: .68rem; }
.next-date { color: var(--amber-dark); font-weight: 800; }

.operator-list { display: grid; gap: 12px; }
.operator-row { display: grid; grid-template-columns: 46px minmax(160px, 1fr) minmax(170px, .9fr) auto auto; gap: 15px; align-items: center; padding: 15px 18px; }
.operator-row .avatar { color: #fff; background: var(--ink); }
.operator-info strong, .operator-info span { display: block; }
.operator-info span { margin-top: 4px; color: var(--muted); font-size: .72rem; }
.toggle-label { display: flex; align-items: center; gap: 9px; font-size: .74rem; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { position: absolute; inset: 0; border-radius: 30px; background: #d4cec8; transition: .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }

.settings-account { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center; }
.settings-avatar { width: 64px; height: 64px; border-radius: 18px; color: #fff; background: var(--ink); font-size: 1rem; }
.settings-account-copy strong, .settings-account-copy span { display: block; }
.settings-account-copy strong { font-size: 1.05rem; }
.settings-account-copy span { margin-top: 4px; color: var(--muted); font-size: .75rem; }
.settings-account .btn { grid-column: 1 / -1; }
.settings-shortcuts { display: grid; gap: 10px; }
.settings-shortcut { width: 100%; display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fcfaf7; text-align: left; }
.settings-shortcut:hover { border-color: #e8c88e; background: #fff8ec; }
.settings-shortcut strong, .settings-shortcut small { display: block; }
.settings-shortcut small { margin-top: 3px; color: var(--muted); font-size: .7rem; font-weight: 500; }
.settings-shortcut b { color: var(--amber-dark); font-size: 1.3rem; }
.settings-symbol { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #34240d; background: #fff0d3; font-weight: 900; }
.settings-install { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.settings-install p { max-width: 680px; margin: 7px 0 0; font-size: .8rem; }
.settings-install .settings-version { margin-top: 13px; color: var(--ink); font-size: .7rem; }
.settings-install .btn { flex: none; }

.upload-zone { display: grid; place-items: center; min-height: 240px; padding: 28px; border: 2px dashed #d8cfc5; border-radius: 18px; color: var(--muted); background: #fdfbf8; text-align: center; transition: .2s; }
.upload-zone:hover, .upload-zone.dragging { border-color: var(--amber); background: #fff9ee; }
.upload-zone input { display: none; }
.upload-zone-icon { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 20px; color: #2b2113; background: var(--amber); font-size: 1.7rem; }
.upload-zone strong { display: block; color: var(--ink); }
.upload-zone span { display: block; margin-top: 7px; font-size: .76rem; }
.invoice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 14px; }
.invoice-card { overflow: hidden; }
.invoice-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: #eee; }
.invoice-card-body { padding: 13px; }
.invoice-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 11px; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(20,18,16,.68); backdrop-filter: blur(5px); }
.modal { width: min(680px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; background: #fff; box-shadow: 0 30px 100px rgba(0,0,0,.25); animation: modalIn .18s ease-out; }
.modal.modal-wide { width: min(1020px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 23px; border-bottom: 1px solid var(--line); }
.modal > header h2 { margin: 0; font-size: 1.3rem; letter-spacing: -.03em; }
.modal-body { overflow-y: auto; padding: 23px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.info-callout { padding: 15px 17px; border-left: 4px solid var(--amber); border-radius: 0 12px 12px 0; color: #6f542a; background: #fff7e9; font-size: .8rem; line-height: 1.5; }
.danger-callout { border-left-color: var(--red); color: #873b34; background: #fff0ee; }
.invite-result { display: grid; gap: 12px; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.copy-row input { min-width: 0; }

.budget-detail-cover { width: 100%; max-height: 330px; object-fit: cover; border-radius: 16px; }
.detail-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin: 16px 0; }
.detail-stat { padding: 14px; border-radius: 13px; background: #f7f3ef; }
.detail-stat span, .detail-stat strong { display: block; }
.detail-stat span { color: var(--muted); font-size: .67rem; }
.detail-stat strong { margin-top: 5px; font-size: .83rem; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 9px; }
.photo-strip a { overflow: hidden; border-radius: 12px; background: #eee; }
.photo-strip img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.detail-block { padding: 18px; border: 1px solid var(--line); border-radius: 16px; }
.detail-block h3 { margin: 0 0 14px; font-size: .95rem; }
.material-history { display: grid; gap: 7px; margin-top: 14px; }
.material-history > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; border-radius: 9px; background: #f7f4f1; font-size: .72rem; }

.toast-region { position: fixed; z-index: 200; right: 22px; bottom: 22px; display: grid; gap: 9px; pointer-events: none; }
.toast { max-width: 390px; display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border-radius: 13px; color: #fff; background: var(--ink); box-shadow: 0 15px 45px rgba(0,0,0,.2); font-size: .8rem; animation: toastIn .2s ease-out; }
.toast.success { background: #237b54; }
.toast.error { background: #a63f37; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid > [class*="span-"] { grid-column: auto; }
  .dashboard-grid .span-12 { grid-column: 1 / -1; }
  .filter-bar { grid-template-columns: 1fr 1fr 1fr; }
  .filter-bar > :first-child { grid-column: span 2; }
  .maintenance-line { grid-template-columns: 1fr 1fr 1fr; }
  .maintenance-line > :last-child { grid-column: span 3; }
}

@media (max-width: 820px) {
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  body.auth-active { padding-bottom: 0; }
  .auth-screen { display: grid; min-height: 100dvh; padding: 18px; }
  .auth-screen::before { background-position: center 54%; }
  .auth-card { width: min(470px, 100%); }
  .auth-visual-copy { display: none; }
  .auth-visual::after { bottom: 0; width: 250px; height: 180px; }
  .sidebar { display: none; }
  .mobile-header { position: sticky; z-index: 28; top: 0; height: calc(64px + env(safe-area-inset-top)); display: grid; grid-template-columns: 1fr 38px 38px; gap: 7px; align-items: end; padding: env(safe-area-inset-top) 16px 10px; color: #fff; background: var(--brand-black); }
  .mobile-header img { width: 154px; align-self: center; }
  .content-area { min-height: auto; margin: 0; padding: 25px 16px 30px; }
  .page-header { align-items: start; margin-bottom: 24px; }
  .page-header h1 { font-size: 2.15rem; }
  .page-actions .btn span.optional { display: none; }
  .mobile-nav { position: fixed; z-index: 40; inset: auto 0 0 0; height: calc(68px + env(safe-area-inset-bottom)); display: flex; align-items: start; gap: 2px; padding: 7px 7px env(safe-area-inset-bottom); overflow-x: auto; color: rgba(255,255,255,.58); background: var(--brand-black); box-shadow: 0 -8px 30px rgba(0,0,0,.15); }
  .mobile-nav .nav-item { min-width: 49px; flex: 1; display: grid; justify-items: center; gap: 2px; min-height: 54px; padding: 6px 2px; font-size: .5rem; border-radius: 10px; white-space: nowrap; }
  .mobile-nav .nav-symbol { font-size: 1.05rem; }
  .mobile-nav .nav-item.active { color: var(--amber); background: rgba(247,172,56,.1); }
  .mobile-app-version { position: fixed; z-index: 39; right: 10px; bottom: calc(72px + env(safe-area-inset-bottom)); display: block; padding: 3px 7px; border: 1px solid rgba(0,0,0,.06); border-radius: 999px; color: #8a837d; background: rgba(246,243,239,.92); font-size: .56rem; font-weight: 750; }
  .dashboard-grid { display: grid; grid-template-columns: 1fr; }
  .dashboard-grid .span-12 { grid-column: auto; }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .stat-card { padding: 14px 11px; }
  .stat-card strong { font-size: 1.35rem; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar > :first-child { grid-column: 1 / -1; }
  .filter-bar .btn { width: 100%; }
  .operator-row { grid-template-columns: 42px 1fr auto; }
  .operator-row > .operator-email { grid-column: 2; }
  .operator-row > .toggle-label { grid-column: span 1; }
  .detail-columns { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .auth-screen { padding: 12px; }
  .auth-card { padding: 27px 21px 23px; border-radius: 25px; }
  .auth-brand { gap: 10px; margin-bottom: 27px; padding-bottom: 19px; }
  .auth-brand img { width: 164px; }
  .auth-access-badge { font-size: .5rem; }
  .auth-card h1 { font-size: clamp(2.45rem, 13vw, 3.1rem); }
  .auth-card h1 + p, .auth-card #invite-email { margin: 14px 0 23px; }
  .auth-footer { margin-top: 21px; }
  .page-header { display: grid; }
  .page-actions { justify-content: start; }
  .page-actions .btn { min-height: 40px; padding: 8px 12px; font-size: .76rem; }
  .clock-card { min-height: 260px; padding: 22px; }
  .stat-row { gap: 7px; }
  .stat-card span { min-height: 28px; font-size: .65rem; }
  .worker-list, .card-grid, .stock-grid { grid-template-columns: 1fr; }
  .filters-wrap { padding: 12px; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar > :first-child { grid-column: auto; }
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap tr, .table-wrap th, .table-wrap td { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tr { padding: 12px 15px; border-bottom: 1px solid var(--line); }
  .table-wrap td { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border: 0; text-align: right; }
  .table-wrap td::before { content: attr(data-label); color: var(--muted); font-size: .67rem; font-weight: 800; text-transform: uppercase; text-align: left; }
  .table-wrap td:first-child { display: block; text-align: left; }
  .table-wrap td:first-child::before { display: none; }
  .maintenance-line { grid-template-columns: 1fr 1fr; }
  .maintenance-line > :last-child { grid-column: span 2; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal { width: 100%; max-height: 92dvh; border-radius: 24px 24px 0 0; }
  .detail-summary { grid-template-columns: 1fr; }
  .operator-row { grid-template-columns: 42px 1fr; gap: 10px; }
  .operator-row > *:not(.avatar):not(.operator-info) { grid-column: 2; }
  .settings-install { align-items: stretch; flex-direction: column; }
  .settings-install .btn { width: 100%; }
  .invoice-grid { grid-template-columns: repeat(2, 1fr); }
  .toast-region { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); left: 12px; }
  .toast { max-width: none; }
}

@media (display-mode: standalone) {
  .install-button, #mobile-install-button { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
