@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600;700&display=swap');

  :root {
    --bg: #0B0C0E;
    --bg-soft: #111315;
    --card: #15181B;
    --card-2: #191D21;
    --card-3: #20252A;
    --border: rgba(255,255,255,0.1);
    --border-strong: rgba(255,255,255,0.18);
    --primary: #FFD166;
    --primary-ink: #161006;
    --accent: #87D6FF;
    --text: #FFFFFF;
    --text-dim: #A7ADB4;
    --text-dim-2: #727A84;
    --success: #42D77D;
    --success-bg: rgba(66,215,125,0.13);
    --warning: #FFB23F;
    --warning-bg: rgba(255,178,63,0.15);
    --danger: #FF5A52;
    --danger-bg: rgba(255,90,82,0.15);
    --r-lg: 8px;
    --r-md: 8px;
    --r-sm: 8px;
    --shadow: 0 18px 42px rgba(0,0,0,0.38);
    --shadow-sm: 0 8px 24px rgba(0,0,0,0.24);
    --ease: cubic-bezier(.25,.8,.25,1);
  }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html { -webkit-font-smoothing: antialiased; }
  body {
    margin: 0;
    background:
      linear-gradient(180deg, #111418 0%, var(--bg) 42%, #090A0B 100%);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    padding-bottom: 100px;
    min-height: 100vh;
  }

  /* ---------- HEADER ---------- */
  .header {
    background: rgba(11,12,14,0.82);
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 5;
    backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 10px 34px rgba(0,0,0,0.22);
  }
  .header .brand { display:flex; align-items:center; gap:12px; margin:0 auto 6px; max-width:960px; }
  .header .logo {
    width:42px; height:42px; border-radius:8px;
    background: var(--primary);
    display:flex; align-items:center; justify-content:center; font-size:19px;
    box-shadow: 0 8px 20px rgba(255,209,102,0.22);
  }
  .header h1 { color:var(--text); font-family:'Space Grotesk',sans-serif; font-size:20px; font-weight:700; margin:0; letter-spacing:0; }
  .header h1 span { color: var(--primary); }
  .header p { color:var(--text-dim); font-size:12.5px; margin:2px auto 0; max-width:960px; }

  /* ---------- TABS ---------- */
  .tabs {
    display:grid; grid-template-columns:repeat(6,1fr); gap:4px; padding:6px;
    margin: 12px auto 6px; max-width:960px; width:calc(100% - 20px);
    border:1px solid var(--border); border-radius:8px;
    background: rgba(21,24,27,0.72); backdrop-filter: blur(14px) saturate(130%);
    box-shadow: var(--shadow-sm);
  }
  .tab { padding:9px 1px; border-radius:var(--r-sm); font-size:10.5px; font-weight:600;
    background: transparent; color:var(--text-dim); border:none; white-space:nowrap; text-align:center;
    transition: background var(--ease) .18s, color var(--ease) .18s, transform .12s;
    position: relative; overflow: hidden;
  }
  .tab.active { background: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 18px rgba(255,209,102,0.24); }
  .tab:active { transform: scale(0.95); }

  main { padding: 8px 20px 0; display:flex; flex-direction:column; gap:12px; max-width:960px; margin:0 auto; }

  /* ---------- SEARCH & FILTER ---------- */
  .search-box {
    display:flex; align-items:center; gap:8px;
    background: rgba(21,24,27,0.88); border:1px solid var(--border); border-radius: var(--r-md);
    padding: 11px 14px;
    box-shadow: var(--shadow-sm);
  }
  .search-box input {
    flex:1; background:none; border:none; outline:none; color:var(--text); font-size:14px; font-family:'Inter',sans-serif;
  }
  .search-box input::placeholder { color: var(--text-dim-2); }
  .search-box .ic { color: var(--text-dim); font-size:14px; }
  .filter-row { display:flex; gap:7px; overflow-x:auto; padding-bottom:2px; }
  .filter-row::-webkit-scrollbar { display:none; }
  .chip {
    flex:0 0 auto; padding:8px 14px; border-radius:999px; font-size:12.5px; font-weight:600;
    background: rgba(21,24,27,0.88); color:var(--text-dim); border:1px solid var(--border); white-space:nowrap;
    transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
  }
  .chip.active { background: var(--text); color: #111; border-color: var(--text); box-shadow: 0 6px 16px rgba(255,255,255,0.12); }

  /* ---------- KPI GRID ---------- */
  .grid3 { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
  .stat {
    border-radius: var(--r-md); padding:15px 12px; background: rgba(21,24,27,0.92); border:1px solid var(--border);
    box-shadow: var(--shadow-sm);
  }
  .stat .n { font-family:'JetBrains Mono',monospace; font-size:24px; font-weight:700; line-height:1; }
  .stat .l { font-size:11.5px; font-weight:600; margin-top:6px; color: var(--text-dim); }
  .stat.p-available .n { color: var(--success); }
  .stat.p-rented .n { color: var(--warning); }
  .stat.p-maintenance .n { color: var(--danger); }

  /* ---------- MONEY / KPI CARD ---------- */
  .money-card { background: rgba(25,29,33,0.94); border-radius: var(--r-lg); padding:20px; border:1px solid var(--border); box-shadow: var(--shadow); }
  .money-card .row { display:flex; justify-content:space-between; align-items:flex-end; }
  .money-card .lbl { color:var(--text-dim); font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.4px; }
  .money-card .val { font-family:'JetBrains Mono',monospace; font-size:21px; font-weight:700; margin-top:4px; }
  .money-card hr { border:none; border-top:1px solid var(--border); margin:14px 0; }
  .money-card .net { font-family:'JetBrains Mono',monospace; font-size:23px; font-weight:700; }

  /* ---------- CARDS (bike / rental / expense) ---------- */
  .card { background: rgba(21,24,27,0.92); border-radius: var(--r-md); padding:15px; border:1px solid var(--border); box-shadow: var(--shadow-sm); transition: border-color .18s var(--ease), transform .16s var(--ease), background .16s var(--ease); }
  .card:hover { border-color: var(--border-strong); background: rgba(25,29,33,0.96); }
  .card-row { display:flex; justify-content:space-between; align-items:center; gap:10px; }
  .plate {
    display:inline-flex; padding:4px 9px; border-radius:7px; background: var(--primary); color: var(--primary-ink);
    font-family:'JetBrains Mono',monospace; font-weight:700; font-size:12.5px; letter-spacing:.2px;
  }
  .pill { display:inline-flex; align-items:center; gap:5px; padding:5px 11px; border-radius:999px; font-size:11.5px; font-weight:700; }
  .p-available { background: var(--success-bg); color: var(--success); }
  .p-rented { background: var(--warning-bg); color: var(--warning); }
  .p-maintenance { background: var(--danger-bg); color: var(--danger); }
  .empty { background: rgba(21,24,27,0.72); border:1px dashed var(--border-strong); border-radius: var(--r-md); padding:28px 16px; text-align:center; color:var(--text-dim); font-size:13px; }

  /* ---------- FAB ---------- */
  .fab {
    position:fixed; bottom:26px; right:20px; width:58px; height:58px; border-radius:50%;
    background: var(--primary); border:none; font-size:30px; font-weight:400; color: var(--primary-ink);
    line-height:1; display:flex; align-items:center; justify-content:center;
    box-shadow: 0 14px 30px rgba(255,209,102,0.32);
    transition: transform .15s var(--ease);
  }
  .fab:active { transform: scale(0.9); }
  .fab.rip { position: fixed; }

  .section-title { display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700; color:var(--text-dim); margin:4px 0 0; text-transform:uppercase; letter-spacing:.4px; }

  /* ---------- MODAL ---------- */
  .modal-bg {
    position:fixed; inset:0; background:rgba(0,0,0,.66); display:flex; align-items:flex-end; justify-content:center; z-index:50;
    backdrop-filter: blur(8px);
    animation: fadeIn .2s var(--ease);
  }
  @keyframes fadeIn { from { opacity:0 } to { opacity:1 } }
  .modal {
    width:100%; max-width:480px; max-height:88vh; overflow-y:auto;
    background: rgba(25,29,33,0.98); border:1px solid var(--border-strong); border-radius: 22px 22px 0 0; padding:22px;
    box-shadow: 0 -18px 48px rgba(0,0,0,0.42);
    animation: slideUp .28s var(--ease);
  }
  @keyframes slideUp { from { transform:translateY(24px); opacity:.6 } to { transform:translateY(0); opacity:1 } }
  .modal h3 { font-family:'Space Grotesk',sans-serif; margin:0 0 18px; display:flex; justify-content:space-between; align-items:center; font-size:18px; }
  .modal h3 span { color: var(--text-dim); font-weight:400; font-size:20px; cursor:pointer; }

  .field { display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
  .field label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.3px; color:var(--text-dim); }
  .field input, .field select {
    border:1px solid var(--border); background: rgba(32,37,42,0.92); color: var(--text); border-radius: var(--r-sm);
    padding:11px 12px; font-size:14.5px; font-family:'Inter',sans-serif; outline:none;
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
  }
  .field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,209,102,0.14); }

  /* ---------- BUTTONS ---------- */
  .btn-primary {
    width:100%; padding:14px; border:none; border-radius: var(--r-sm); background: var(--primary); color: var(--primary-ink);
    font-weight:700; font-size:14.5px; margin-top:4px; position:relative; overflow:hidden;
    transition: transform .12s var(--ease), filter .16s var(--ease);
  }
  .btn-primary:active { transform: scale(0.98); filter:brightness(0.94); }
  .btn-outline {
    padding:10px 14px; border-radius: var(--r-sm); border:1px solid var(--border); background: rgba(32,37,42,0.92); color: var(--text);
    font-size:12.5px; font-weight:700; position:relative; overflow:hidden; transition: border-color .16s var(--ease), transform .12s var(--ease);
  }
  .btn-outline:active { transform: scale(0.97); }
  .btn-outline.danger { color: var(--danger); border-color: rgba(255,69,58,0.35); }
  .btn-success {
    flex:1; padding:10px; border:none; border-radius: var(--r-sm); background: var(--success); color:#04240D;
    font-size:12.5px; font-weight:700; position:relative; overflow:hidden; transition: transform .12s var(--ease);
  }
  .btn-success:active { transform: scale(0.97); }
  .row-gap { display:flex; gap:8px; margin-top:12px; }
  select.status-select { font-size:11px; font-weight:700; padding:5px 10px; border-radius:999px; background:var(--card-3); color:var(--text); border:1px solid var(--border); }
  .amount-neg { color: var(--danger); font-family:'JetBrains Mono',monospace; font-weight:700; }

  /* ---------- COUNTDOWN ---------- */
  .countdown { font-size:11px; font-weight:700; padding:4px 10px; border-radius:999px; white-space:nowrap; }
  .countdown-ok { background: var(--card-3); color: var(--text-dim); }
  .countdown-warn { background: var(--warning-bg); color: var(--warning); }
  .countdown-overdue { background: var(--danger-bg); color: var(--danger); }

  /* ---------- TOGGLES ---------- */
  .toggle-row { display:flex; gap:8px; }
  .toggle-btn {
    flex:1; padding:11px; border-radius: var(--r-sm); border:1px solid var(--border); background: rgba(21,24,27,0.9);
    font-size:13px; font-weight:600; color:var(--text-dim); position:relative; overflow:hidden;
    transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease), transform .12s var(--ease);
  }
  .toggle-btn.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
  .toggle-btn:active { transform: scale(0.97); }

  /* ---------- PAYOUT ---------- */
  .payout-card { border-radius: var(--r-md); padding:18px; border:1px solid var(--border); }
  .payout-card .p-name { font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:15px; margin-bottom:5px; }
  .payout-card .p-amount { font-family:'JetBrains Mono',monospace; font-weight:700; font-size:23px; }
  .payout-card .p-note { font-size:11.5px; color:var(--text-dim); margin-top:6px; line-height:1.4; }

  .banner-alert {
    background: var(--danger-bg); border:1px solid rgba(255,69,58,0.35); color: var(--danger);
    border-radius: var(--r-md); padding:13px 15px; font-size:13px; font-weight:600; line-height:1.45;
  }

  /* ---------- RIPPLE ---------- */
  .rip { position:relative; overflow:hidden; }
  .ripple { position:absolute; border-radius:50%; background:rgba(255,255,255,0.35); transform:scale(0); pointer-events:none; animation: rip-anim .6s ease-out; }
  @keyframes rip-anim { to { transform:scale(2.4); opacity:0; } }

  /* ---------- CONTRACTS ---------- */
  .contract-status { font-size:11px; font-weight:700; padding:4px 10px; border-radius:999px; white-space:nowrap; }
  .cs-active { background: var(--success-bg); color: var(--success); }
  .cs-completed { background: rgba(154,154,154,0.16); color: var(--text-dim); }
  .cs-overdue { background: var(--danger-bg); color: var(--danger); }
  .cs-cancelled { background: rgba(154,154,154,0.1); color: var(--text-dim-2); }
  .contract-num { font-family:'JetBrains Mono',monospace; font-weight:700; font-size:12px; color: var(--primary); }
  .checklist-item {
    display:flex; align-items:center; gap:10px; padding:12px 14px; background: var(--card-3);
    border-radius: var(--r-sm); margin-bottom:8px; cursor:pointer; border:1px solid var(--border);
    transition: border-color .16s var(--ease), background .16s var(--ease);
  }
  .checklist-item.checked { border-color: var(--success); background: rgba(52,199,89,0.08); }
  .checklist-item .box {
    width:20px; height:20px; border-radius:6px; border:2px solid var(--text-dim); flex:0 0 auto;
    display:flex; align-items:center; justify-content:center; font-size:13px; color:#04240D;
  }
  .checklist-item.checked .box { background: var(--success); border-color: var(--success); }
  .sig-pad-wrap { background:#fff; border-radius: var(--r-sm); overflow:hidden; border:1px solid var(--border); touch-action:none; }
  .sig-pad-wrap canvas { display:block; width:100%; height:160px; touch-action:none; }
  .sig-label { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
  .contract-field-view { display:grid; grid-template-columns:1fr 1fr; gap:8px 14px; font-size:12.5px; margin-bottom:14px; }
  .contract-field-view .k { color:var(--text-dim); font-size:10.5px; text-transform:uppercase; letter-spacing:.3px; }
  .contract-field-view .v { font-weight:600; margin-top:2px; }
  .photo-section { border:1px solid var(--border); background:rgba(32,37,42,0.82); border-radius:var(--r-sm); padding:12px; margin-bottom:14px; }
  .photo-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:10px; }
  .photo-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.3px; color:var(--text-dim); }
  .photo-actions { display:flex; gap:8px; flex-wrap:wrap; }
  .photo-upload-btn {
    display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:9px 11px;
    border:1px solid var(--border); background:rgba(21,24,27,0.9); color:var(--text); border-radius:var(--r-sm);
    font-size:12px; font-weight:700; cursor:pointer; position:relative; overflow:hidden;
  }
  .photo-preview { display:grid; grid-template-columns:repeat(auto-fill,minmax(92px,1fr)); gap:8px; }
  .photo-thumb { position:relative; aspect-ratio:4/3; border-radius:var(--r-sm); overflow:hidden; background:#111; border:1px solid var(--border); }
  .photo-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
  .photo-thumb button {
    position:absolute; top:5px; right:5px; width:26px; height:26px; border:0; border-radius:50%;
    background:rgba(0,0,0,.72); color:#fff; font-size:18px; line-height:1; cursor:pointer;
  }
  .photo-empty { grid-column:1/-1; border:1px dashed var(--border); border-radius:var(--r-sm); color:var(--text-dim); font-size:12px; padding:16px; text-align:center; }
  .contract-photo-view { display:grid; grid-template-columns:repeat(auto-fill,minmax(118px,1fr)); gap:8px; margin:8px 0 14px; }

/* ---------- MOBILE-FIRST APP SHELL (refactor) ---------- */
:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 14px;
}
body {
  padding-bottom: calc(94px + var(--safe-bottom));
}
.header {
  border-bottom: 0;
  box-shadow: none;
}
.tabs {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + var(--safe-bottom));
  z-index: 40;
  width: auto;
  max-width: 520px;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 auto;
  padding: 7px;
  border-radius: 26px;
  background: rgba(28, 30, 34, .84);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 18px 60px rgba(0,0,0,.48);
}
.tab {
  min-height: 56px;
  border-radius: 20px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  font-size:10px;
}
.tab .tab-ic { font-size:19px; line-height:1; }
.tab.active { background: rgba(255,255,255,.94); color:#111; box-shadow: 0 9px 24px rgba(255,255,255,.12); }
.fab { bottom: calc(92px + var(--safe-bottom)); border-radius: 22px; }
.card, .money-card, .stat, .search-box, .payout-card, .banner-alert { border-radius: 22px; }
.btn-primary, .btn-outline, .btn-success, .toggle-btn, .field input, .field select, .field textarea { border-radius: 16px; min-height:44px; }
.field textarea {
  border:1px solid var(--border); background: rgba(32,37,42,0.92); color: var(--text); padding:11px 12px; font-size:14.5px; font-family:'Inter',sans-serif; outline:none; resize:vertical;
}
.entity-row { display:flex; align-items:center; gap:12px; min-width:0; }
.entity-main { min-width:0; flex:1; }
.meta-line { color:var(--text-dim); font-size:12px; line-height:1.4; }
.thumb { width:56px; height:56px; border-radius:16px; object-fit:cover; flex:0 0 auto; border:1px solid var(--border); background:var(--card-3); display:flex; align-items:center; justify-content:center; font-weight:800; }
.thumb-sm { width:44px; height:44px; border-radius:14px; font-size:13px; }
.thumb-fallback { color:var(--primary); font-family:'Space Grotesk',sans-serif; }
.client-fallback { color: var(--accent); }
.mini-money { font-family:'JetBrains Mono',monospace; font-weight:800; font-size:13px; }
.more-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:12px; }
.more-card { min-height:116px; border:1px solid var(--border); border-radius:24px; background:rgba(21,24,27,.92); color:var(--text); display:flex; flex-direction:column; align-items:flex-start; justify-content:space-between; padding:16px; box-shadow:var(--shadow-sm); text-align:left; }
.more-card span { font-size:26px; }
.more-card strong { font-size:15px; }
.more-card small { color:var(--text-dim); }
.metric-list { margin-top:14px; border:1px solid var(--border); border-radius:22px; overflow:hidden; background:rgba(21,24,27,.68); }
.metric-list > div { display:flex; justify-content:space-between; gap:16px; padding:13px 15px; border-bottom:1px solid var(--border); font-size:13px; }
.metric-list > div:last-child { border-bottom:0; }
.metric-list span { color:var(--text-dim); }
.metric-list strong { text-align:right; }
.calendar-head { display:flex; align-items:center; justify-content:space-between; gap:10px; background:rgba(21,24,27,.92); border:1px solid var(--border); border-radius:24px; padding:12px; }
.calendar-legend { display:flex; gap:10px; overflow-x:auto; color:var(--text-dim); font-size:11.5px; padding:2px 0; }
.calendar-legend span { display:flex; align-items:center; gap:5px; flex:0 0 auto; }
.calendar-weekdays { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; color:var(--text-dim); font-size:11px; font-weight:700; text-align:center; }
.calendar-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
.cal-cell { min-height:74px; border:1px solid var(--border); border-radius:18px; background:rgba(21,24,27,.9); color:var(--text); padding:7px; text-align:left; display:flex; flex-direction:column; justify-content:space-between; overflow:hidden; }
.cal-empty { background:transparent; border:0; }
.cal-cell.today { border-color:var(--primary); box-shadow:0 0 0 2px rgba(255,209,102,.16) inset; }
.cal-date { font-size:12px; font-weight:800; }
.cal-dots { display:flex; gap:3px; flex-wrap:wrap; }
.cal-dot { width:8px; height:8px; border-radius:999px; display:inline-block; }
.cal-green { background:var(--success); }
.cal-yellow { background:var(--warning); }
.cal-red { background:var(--danger); }
.cal-blue { background:var(--accent); }
.cal-gray { background:var(--text-dim-2); }
.cal-thumbs { display:flex; gap:2px; transform:scale(.72); transform-origin:left bottom; height:28px; }
@media (max-width: 430px) {
  main { padding: 8px 14px 0; }
  .header { padding: 14px 16px 10px; }
  .grid3 { gap:8px; }
  .stat { padding:13px 10px; }
  .stat .n { font-size:21px; }
  .tabs { left:8px; right:8px; }
  .tab { min-height:54px; }
  .calendar-grid { gap:4px; }
  .cal-cell { min-height:64px; border-radius:14px; padding:6px; }
}


/* ---------- WORKSCREEN REFINEMENT ---------- */
.work-actions { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:10px; }
.work-action { min-height:64px; border:1px solid var(--border); border-radius:22px; background:rgba(25,29,33,.92); color:var(--text); display:flex; align-items:center; justify-content:center; gap:10px; box-shadow:var(--shadow-sm); font-weight:800; }
.work-action span { width:34px; height:34px; border-radius:14px; display:flex; align-items:center; justify-content:center; background:rgba(255,255,255,.08); }
.menu-hero { border:1px solid var(--border); border-radius:28px; padding:18px; background:linear-gradient(145deg, rgba(255,209,102,.14), rgba(135,214,255,.08) 54%, rgba(21,24,27,.92)); box-shadow:var(--shadow-sm); }
.menu-hero h2 { margin:0; font-family:'Space Grotesk',sans-serif; font-size:22px; line-height:1.15; }
.menu-hero p { margin:8px 0 0; color:var(--text-dim); font-size:13px; }
.settings-panel { border:1px solid var(--border); border-radius:24px; overflow:hidden; background:rgba(21,24,27,.86); box-shadow:var(--shadow-sm); }
.settings-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:15px; border-bottom:1px solid var(--border); color:var(--text); }
.settings-row:last-child { border-bottom:0; }
.settings-row strong { display:block; font-size:14px; margin-bottom:3px; }
.settings-row small { display:block; color:var(--text-dim); font-size:12px; line-height:1.35; }
.more-card { min-height:104px; }
@media (max-width: 430px) {
  .work-actions { gap:8px; }
  .work-action { min-height:58px; border-radius:20px; font-size:13px; }
  .more-grid { gap:10px; }
  .more-card { min-height:98px; padding:14px; }
}
