@font-face { font-family: 'Moderat'; src: url('fonts/Moderat Light.otf') format('opentype'); font-weight: 300; font-style: normal; }
@font-face { font-family: 'Moderat'; src: url('fonts/Moderat Regular.otf') format('opentype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'Moderat'; src: url('fonts/Moderat Medium.otf') format('opentype'); font-weight: 500; font-style: normal; }
@font-face { font-family: 'Moderat'; src: url('fonts/Moderat Medium.otf') format('opentype'); font-weight: 600; font-style: normal; }
@font-face { font-family: 'Moderat'; src: url('fonts/Moderat Bold.otf') format('opentype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'Moderat'; src: url('fonts/Moderat Bold.otf') format('opentype'); font-weight: 800; font-style: normal; }
@font-face { font-family: 'Moderat'; src: url('fonts/Moderat Black.otf') format('opentype'); font-weight: 900; font-style: normal; }

* { -webkit-tap-highlight-color: transparent; }
body { font-family: 'Moderat', 'Inter', system-ui, -apple-system, 'Helvetica Neue', sans-serif; }

.phone-frame {
  width: 393px; height: 852px; border-radius: 48px;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.08), 0 20px 40px -20px rgba(0,0,0,0.05), inset 0 0 0 12px #111;
  overflow: hidden; position: relative; background: #000;
}
.phone-screen { width: 100%; height: 100%; border-radius: 44px; overflow-y: auto; overflow-x: hidden; position: relative; }
.phone-screen::-webkit-scrollbar { display: none; }
.phone-screen { -ms-overflow-style: none; scrollbar-width: none; }
.notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 126px; height: 34px; background: #000; border-radius: 0 0 20px 20px; z-index: 50; }
.home-indicator { position: sticky; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; padding: 8px 0 10px; z-index: 40; }
.home-indicator div { width: 134px; height: 5px; border-radius: 100px; background: #000; opacity: 0.15; }
.screen-enter { animation: slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.slide-up { animation: slideUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.stagger-1 { animation-delay: 0.05s; animation-fill-mode: both; }
.stagger-2 { animation-delay: 0.1s; animation-fill-mode: both; }
.stagger-3 { animation-delay: 0.15s; animation-fill-mode: both; }
.stagger-4 { animation-delay: 0.2s; animation-fill-mode: both; }
.stagger-5 { animation-delay: 0.25s; animation-fill-mode: both; }
.timer-pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Editorial design system */
.card { background: #fff; border: 1px solid rgba(0,0,0,0.08); transition: transform 0.2s ease; }
.card:active { transform: scale(0.985); }
.section-label { font-size: 10px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(0,0,0,0.55); }
.divider { height: 1px; background: rgba(0,0,0,0.08); }
.tab-active { color: #111 !important; font-weight: 600 !important; border-bottom: 2px solid #111 !important; }
.inner-tab-active { color: #111 !important; font-weight: 600 !important; border-bottom: 2px solid #111 !important; }

.feed-card { overflow: hidden; cursor: pointer; transition: transform 0.2s ease; background: #fff; border: 1px solid rgba(0,0,0,0.08); }
.feed-card:active { transform: scale(0.97); }
.task-editorial { padding: 16px 0; border-bottom: 1px solid rgba(0,0,0,0.08); transition: transform 0.2s ease; }
.task-editorial:active { transform: scale(0.985); }
.cal-event { border-left: 2px solid; padding: 12px 16px; margin-bottom: 8px; background: rgba(0,0,0,0.02); }
.grid-cell { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.grid-cell:hover { background: rgba(0,0,0,0.04); }
.grid-cell.has-event { background: #111; color: #fff; border-radius: 50%; font-weight: 600; }
.grid-cell.is-today { box-shadow: inset 0 0 0 2px #111; border-radius: 50%; font-weight: 700; }
.grid-cell.is-today.has-event { box-shadow: none; }
.grid-cell.empty-day { color: rgba(0,0,0,0.15); }
.grid-cell.regular-day { color: #111; }
.grid-cell.prev-next { color: rgba(0,0,0,0.15); }
.ts-cell { width: 42px; height: 38px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.ts-cell:hover { background: rgba(0,0,0,0.04); }
.ts-cell.has-hours { background: #111; color: #fff; border-radius: 8px; }
.ts-cell.today-cell { box-shadow: inset 0 0 0 2px #111; border-radius: 8px; }

/* Dot-grid calendar */
.cal-dot { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; transition: transform 0.15s ease, background 0.2s ease; }
.cal-dot:active { transform: scale(0.88); }
.cal-dot.prev-next { background: rgba(0, 0, 0, 0.04); cursor: default; }
.cal-dot.weekend { background: rgba(0, 0, 0, 0.07); }
.cal-dot.weekday { background: rgba(0, 0, 0, 0.10); }
.cal-dot.event { background: #9BB9DE; }
.cal-dot.today { background: #5C6B63; box-shadow: 0 0 0 6px rgba(92, 107, 99, 0.16); }
.cal-dot.leave { background: #E6A9A9; }
.cal-dot.cal-sel { box-shadow: 0 0 0 2px rgba(17,17,17,0.55); }

/* Editorial event row */
.event-editorial { padding-bottom: 22px; border-bottom: 1px solid rgba(0,0,0,0.07); }
.event-editorial:last-child { border-bottom: none; padding-bottom: 0; }
.health-good { background: rgba(107,122,94,0.12); color: #6B7A5E; }
.health-warn { background: rgba(184,149,106,0.12); color: #8B7A5E; }
.health-risk { background: rgba(160,96,84,0.12); color: #A06054; }
.inv-paid { background: rgba(107,122,94,0.12); color: #6B7A5E; }
.inv-unpaid { background: rgba(184,149,106,0.12); color: #8B7A5E; }
.inv-overdue { background: rgba(160,96,84,0.12); color: #A06054; }
.inv-not-issued { background: rgba(0,0,0,0.04); color: rgba(0,0,0,0.55); }
.decision-pending { border-left: 2px solid #8B7A5E; }
.decision-approved { border-left: 2px solid #6B7A5E; }
.decision-rejected { border-left: 2px solid #A06054; }

/* Client decisions — editorial rows + option swatches */
.decision-row { padding: 16px 0 16px 16px; border-bottom: 1px solid rgba(0,0,0,0.08); cursor: pointer; transition: transform 0.2s ease, opacity 0.2s ease; }
.decision-row:active { transform: scale(0.99); }
.decision-row:last-child { border-bottom: none; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 9px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-pending { color: #8B7A5E; } .status-pending .dot { background: #8B7A5E; }
.status-approved { color: #6B7A5E; } .status-approved .dot { background: #6B7A5E; }
.status-changes { color: #A06054; } .status-changes .dot { background: #A06054; }
.decision-option { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid rgba(0,0,0,0.12); cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease; }
.decision-option:active { transform: scale(0.99); }
.decision-option.selected { border-color: #111; background: rgba(0,0,0,0.02); }
.decision-option .swatch { width: 44px; height: 44px; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.10); }
.decision-option .pick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,0.2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: border-color 0.2s ease, background 0.2s ease; }
.decision-option.selected .pick { border-color: #111; background: #111; }

/* Client timeline — vertical phase progress (Grafiks) */
.tl-row { position: relative; padding-left: 30px; padding-bottom: 36px; }
.tl-row:last-child { padding-bottom: 4px; }
.tl-row::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 0; width: 1px; background: rgba(0,0,0,0.14); }
.tl-row:last-child::before { display: none; }
.tl-marker { position: absolute; left: 0; top: 2px; width: 13px; height: 13px; border-radius: 50%; box-sizing: border-box; }
.tl-marker.done { background: #111; }
.tl-marker.current { background: #7E876D; box-shadow: 0 0 0 5px rgba(126,135,109,0.18); }
.tl-marker.upcoming { background: transparent; border: 1.5px solid rgba(0,0,0,0.2); }

/* Notifications (Paziņojumi) */
.notif-row { padding: 16px 0 16px 16px; border-bottom: 1px solid rgba(0,0,0,0.08); position: relative; }
.notif-row:last-child { border-bottom: none; }
.notif-row.unread { border-left: 2px solid #7E876D; }
.notif-row.read { opacity: 0.62; }

/* Documents (Dokumenti) */
.doc-row { padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,0.08); cursor: pointer; transition: transform 0.2s ease; }
.doc-row:active { transform: scale(0.99); }
.doc-row:last-child { border-bottom: none; }
.doc-format { width: 40px; height: 40px; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.16); display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; color: #111; }
.tl-done { background: #111; }
.tl-active { background: #111; box-shadow: 0 0 0 4px rgba(17,17,17,0.12); }
.tl-pending { background: rgba(0,0,0,0.08); }
.badge-private { background: rgba(0,0,0,0.04); color: rgba(0,0,0,0.55); }
.badge-public { background: rgba(0,0,0,0.06); color: #111; }
.progress-ring { transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1); }

/* Splash / Login */
.splash-screen { position: absolute; inset: 0; z-index: 60; background: #111; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 44px; transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1), transform 0.65s cubic-bezier(0.4, 0, 0.2, 1), filter 0.65s cubic-bezier(0.4, 0, 0.2, 1); }
.splash-screen.dismiss { animation: fadeOutBlur 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes fadeOutBlur {
  from { opacity: 1; transform: scale(1); filter: blur(0px); }
  to   { opacity: 0; transform: scale(1.04); filter: blur(14px); }
}
.splash-role-btn { cursor: pointer; display: flex; flex-direction: column; align-items: center; padding: 12px 24px; background: transparent; border: none; outline: none; transition: opacity 0.2s ease; }
.splash-role-btn:active { transform: scale(0.96); }
.splash-role-btn:hover { opacity: 0.85; }
.login-input { background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,0.75); padding: 6px 0; color: #fff; font-family: 'Moderat', system-ui, sans-serif; font-size: 14px; font-weight: 400; outline: none; transition: border-color 0.3s ease; }
.login-input::placeholder { color: rgba(255,255,255,0.3); }
.login-input:focus { border-bottom-color: #fff; }
.brand-logo { line-height: 1; letter-spacing: 0.12em; font-weight: 800; font-size: 10px; text-transform: uppercase; }
.brand-logo span { display: block; }
.brand-logo .ou { padding-left: 1.2em; }

/* Bottom nav */
.bottom-nav { position: sticky; bottom: 0; left: 0; right: 0; z-index: 40; background: #E5E3E0; padding: 6px 16px 24px; border-top: 1px solid rgba(0,0,0,0.06); }
.bottom-nav .nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; opacity: 0.35; transition: opacity 0.2s; cursor: pointer; color: #111; }
.bottom-nav .nav-item.active { opacity: 1; }
.bottom-nav .nav-item span { font-size: 9px; font-weight: 500; color: #111; letter-spacing: 0.05em; }
.bottom-nav .nav-item svg { stroke: #111; }

/* Input fields for light theme */
.input-editorial { background: transparent; border: none; border-bottom: 1px solid rgba(0,0,0,0.25); padding: 10px 0; color: #111; font-family: 'Moderat', system-ui, sans-serif; font-size: 14px; font-weight: 400; outline: none; transition: border-color 0.3s ease; width: 100%; }
.input-editorial::placeholder { color: rgba(0,0,0,0.35); }
.input-editorial:focus { border-bottom-color: rgba(0,0,0,0.6); }
select.input-editorial { appearance: none; cursor: pointer; }

/* Fallback color shown only if splash-bg.png fails to load. The photo covers it normally. */
.splash-screen { background: #1A1A1A; }

/* === Mobile: strip the desktop phone-frame on small screens === */
/* On real phones (or when running as installed PWA), the app fills the screen
   and the fake iPhone bezel/notch disappear. Desktop preview keeps the bezel. */
@media (max-width: 480px), (display-mode: standalone) {
  body { padding: 0 !important; align-items: stretch !important; background: #E5E3E0 !important; }
  body > div:first-child { gap: 0 !important; }
  .phone-frame {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #E5E3E0 !important;
  }
  .phone-screen, .splash-screen { border-radius: 0 !important; }
  .notch { display: none !important; }
  /* Hide the "// Darbinieka sākumlapa" debug label and role-switcher on mobile */
  #role-switcher, #screen-label { display: none !important; }
  body > div:first-child > div.text-center { display: none !important; }
  /* On mobile, the in-frame floating switch takes over (only when a multi-role person is logged in). */
  #role-fab.rf-on { display: block !important; }
}
/* The in-frame profile switch is desktop-hidden (the top pill handles desktop); mobile shows it via .rf-on above. */
#role-fab { display: none; }
