/* ============================================================
   App-level styles for LekhaKong (DTS)
   Layout shell, header, tabbar, cards, sheets, toast.
   ============================================================ */

html, body { margin:0; padding:0; background:#0E424A; }

/* Outer page frame */
.app-frame {
  min-height:100vh;
  display:flex;
  justify-content:center;
  background:linear-gradient(165deg,#0E424A,#11626E);
  font-family:var(--font-sans);
}

/* Phone-shaped surface */
.app-shell {
  width:100%;
  max-width:var(--app-max-w);
  height:100vh;
  background:var(--surface-page);
  display:flex;
  flex-direction:column;
  position:relative;
  overflow:hidden;
  box-shadow:0 0 60px rgba(0,0,0,.3);
}

/* ===== Login ===== */
.login-screen {
  flex:1; display:flex; flex-direction:column;
  background:linear-gradient(170deg,#11626E 0%,#0E7C8B 55%,#149DAC 100%);
  color:#fff; padding:0 28px;
}
.login-screen .body { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:18px; }
.login-logo { width:90px; height:90px; border-radius:24px; background:#fff; display:flex; align-items:center; justify-content:center; box-shadow:0 16px 40px rgba(0,0,0,.3); }
.login-logo span { font-family:var(--font-display); font-weight:700; font-size:42px; color:var(--teal-600); line-height:1; }
.login-hero { width:100%; max-width:330px; height:auto; display:block; filter:drop-shadow(0 8px 18px rgba(0,0,0,.18)); }
.login-title { text-align:center; }
.login-title .name { font-family:var(--font-display); font-weight:600; font-size:26px; line-height:1.15; }
.login-title .sub  { font-size:14px; opacity:.92; margin-top:6px; }
.login-title .sub2 { font-size:13px; opacity:.72; margin-top:2px; }
.login-screen .actions { padding-bottom:40px; display:flex; flex-direction:column; gap:14px; }
.btn-line {
  height:54px; border:none; border-radius:999px; background:var(--line-green);
  color:#fff; font-family:var(--font-sans); font-weight:600; font-size:17px;
  display:flex; align-items:center; justify-content:center; gap:10px; cursor:pointer;
  box-shadow:0 10px 24px rgba(6,199,85,.35);
}
.btn-line:active { background:var(--line-green-press); }
.login-note { text-align:center; font-size:12px; opacity:.78; margin:0; line-height:1.6; }

/* ===== App layout ===== */
.app-body { flex:1; min-height:0; display:flex; flex-direction:column; }
.app-header {
  flex:0 0 auto;
  background:linear-gradient(150deg,#11626E,#0E7C8B 70%,#149DAC);
  color:#fff;
  padding:16px 18px 18px;
}
.app-header .row { display:flex; align-items:center; gap:12px; }
.avatar-circle {
  width:46px; height:46px; border-radius:50%;
  background:rgba(255,255,255,.18); display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-weight:600; font-size:18px; flex:0 0 auto;
}
.greeting { font-size:13px; opacity:.85; }
.role-name { font-family:var(--font-display); font-weight:600; font-size:18px; line-height:1.2; }
.icon-btn {
  width:42px; height:42px; border:none; border-radius:50%;
  background:rgba(255,255,255,.16); color:#fff;
  display:flex; align-items:center; justify-content:center; cursor:pointer; position:relative;
}
.notif-dot {
  position:absolute; top:8px; right:9px;
  width:8px; height:8px; border-radius:50%;
  background:var(--coral-500); border:1.5px solid #0E7C8B;
}
.role-tabs {
  margin-top:14px; display:flex; gap:6px;
  background:rgba(255,255,255,.14); padding:4px; border-radius:999px;
}
.role-tabs button {
  flex:1; border:none; cursor:pointer; border-radius:999px; padding:8px 0;
  font-family:var(--font-sans); font-weight:600; font-size:13px;
  background:transparent; color:rgba(255,255,255,.85);
}
.role-tabs button.active { background:#fff; color:var(--teal-700); }

.sub-header { display:flex; align-items:center; gap:10px; min-height:46px; }
.sub-header .title { font-family:var(--font-display); font-weight:600; font-size:18px; white-space:nowrap; }

.app-scroll { flex:1; min-height:0; overflow-y:auto; padding:16px 16px 96px; }

/* ===== Hero status card ===== */
.hero-card {
  background:linear-gradient(145deg,#0E7C8B,#149DAC);
  border-radius:18px; padding:14px 16px; color:#fff;
  box-shadow:0 10px 22px rgba(14,124,139,.28);
}
.hero-card .top { display:flex; align-items:center; justify-content:space-between; }
.hero-card .label { font-size:12.5px; opacity:.85; }
.hero-card .value { font-family:var(--font-display); font-weight:600; font-size:26px; line-height:1.1; margin-top:1px; white-space:nowrap; }
.hero-card .date-chip {
  background:rgba(255,255,255,.18); border-radius:10px;
  padding:6px 10px; font-size:12px; font-weight:600;
}
.hero-card .bar { margin-top:10px; height:6px; border-radius:999px; background:rgba(255,255,255,.22); overflow:hidden; }
.hero-card .bar > div { height:100%; border-radius:999px; background:#fff; }
.hero-card .cta {
  margin-top:11px; width:100%; height:42px; border:none; border-radius:999px;
  background:#fff; color:var(--teal-700);
  font-family:var(--font-sans); font-weight:600; font-size:14.5px;
  display:flex; align-items:center; justify-content:center; gap:8px; cursor:pointer; white-space:nowrap;
}

/* ===== Menu grid (4-cols) ===== */
.menu-card {
  background:var(--surface-card); border-radius:18px;
  border:1px solid var(--border-subtle); padding:14px 6px;
  box-shadow:var(--shadow-sm);
}
.menu-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:4px 0; }
.tile { border:none; background:transparent; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:7px; padding:8px 4px; transition:transform .12s; }
.tile:active { transform:scale(.95); }
.tile .ic { width:52px; height:52px; border-radius:16px; display:flex; align-items:center; justify-content:center; }
.tile .lbl { font-size:11.5px; color:var(--text-body); text-align:center; line-height:1.25; font-weight:500; }

/* ===== Generic card ===== */
.card { background:var(--surface-card); border:1px solid var(--border-subtle); border-radius:12px; padding:12px 14px; }
.card.lg { border-radius:16px; padding:16px; box-shadow:var(--shadow-sm); }
.card.accent-l { border-left:3px solid var(--teal-500); }
.section-title { font-family:var(--font-display); font-weight:600; font-size:17px; color:var(--text-strong); margin:2px 2px 8px; }
.section-row  { display:flex; align-items:center; justify-content:space-between; margin:2px 2px 8px; }
.link-all { font-size:12.5px; color:var(--text-link); font-weight:600; }

.day-block {
  width:48px; height:48px; border-radius:12px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; flex:0 0 auto;
}
.day-block .d { font-family:var(--font-display); font-weight:700; font-size:17px; line-height:1; }
.day-block .m { font-size:10px; }

.pill { font-size:11px; font-weight:600; padding:4px 10px; border-radius:999px; flex:0 0 auto; }

/* ===== Bottom Tab Bar ===== */
.tabbar {
  position:absolute; left:0; right:0; bottom:0;
  background:#fff; border-top:1px solid var(--border-subtle);
  padding:8px 6px calc(8px + var(--safe-bottom));
  display:flex; align-items:flex-end; justify-content:space-around; gap:2px;
}
.tabbar .tab { border:none; background:transparent; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:3px; padding:6px 4px; flex:1; }
.tabbar .tab .lbl { font-size:10.5px; font-weight:600; }
.tabbar .fab {
  width:54px; height:54px; border-radius:50%; border:none;
  background:var(--coral-500); color:#fff; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow:var(--shadow-sports);
  margin-top:-22px;
}
.tabbar .fab:active { transform:scale(.95); }

/* ===== Toast ===== */
.toast-stack { position:absolute; left:0; right:0; bottom:96px; display:flex; justify-content:center; pointer-events:none; }
.toast {
  pointer-events:auto;
  background:var(--neutral-900); color:#fff;
  border-radius:999px; padding:10px 18px; display:flex; align-items:center; gap:8px;
  font-size:14px; font-weight:500; box-shadow:var(--shadow-lg);
  animation:toast-in .26s var(--ease-decel);
}
.toast.info    { background:var(--teal-700); }
.toast.success { background:var(--green-600); }
.toast.warn    { background:var(--amber-600); }
.toast.danger  { background:var(--red-600); }
@keyframes toast-in { from { transform:translateY(8px); opacity:0; } to { transform:translateY(0); opacity:1; } }

/* ===== Sheet (bottom modal) ===== */
.sheet-scrim {
  position:absolute; inset:0;
  background:var(--scrim);
  display:flex; align-items:flex-end; justify-content:center;
  z-index:50;
  animation:fade-in .22s var(--ease-standard);
}
.sheet {
  background:#fff;
  width:100%; max-height:90%;
  border-top-left-radius:24px; border-top-right-radius:24px;
  display:flex; flex-direction:column;
  animation:sheet-up .32s var(--ease-decel);
}
.sheet-handle { width:38px; height:4px; border-radius:99px; background:var(--neutral-200); margin:10px auto 0; }
.sheet-header { padding:12px 18px 6px; display:flex; align-items:center; justify-content:space-between; }
.sheet-header h3 { font-size:18px; }
.sheet-body  { padding:6px 18px 18px; overflow-y:auto; }
.sheet-footer { padding:12px 18px calc(18px + var(--safe-bottom)); border-top:1px solid var(--border-subtle); display:flex; gap:10px; }
@keyframes fade-in { from { opacity:0; } to { opacity:1; } }
@keyframes sheet-up { from { transform:translateY(20px); opacity:.5; } to { transform:translateY(0); opacity:1; } }

/* ===== Form controls ===== */
.field { display:flex; flex-direction:column; gap:6px; margin-bottom:12px; }
.field label { font-size:13px; font-weight:600; color:var(--text-body); }
.field input, .field select, .field textarea {
  width:100%; height:46px;
  border:1px solid var(--border-default); border-radius:11px;
  background:#fff; padding:0 12px;
  font-family:var(--font-sans); font-size:15px; color:var(--text-strong);
}
.field textarea { height:auto; min-height:96px; padding:12px; resize:vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline:none; border-color:var(--teal-500); box-shadow:var(--focus-ring); }

.btn {
  height:48px; border:none; border-radius:999px;
  font-family:var(--font-sans); font-weight:600; font-size:15px;
  display:flex; align-items:center; justify-content:center; gap:8px;
  cursor:pointer;
}
.btn-primary { background:var(--teal-600); color:#fff; box-shadow:var(--shadow-brand); }
.btn-primary:active { background:var(--teal-700); }
.btn-ghost   { background:transparent; color:var(--text-muted); border:1px solid var(--border-default); }
.btn-coral   { background:var(--coral-500); color:#fff; box-shadow:var(--shadow-sports); }

/* segment buttons */
.seg { display:flex; gap:6px; background:var(--neutral-100); padding:4px; border-radius:12px; }
.seg button { flex:1; border:none; cursor:pointer; border-radius:10px; padding:9px 0; font-family:var(--font-sans); font-weight:600; font-size:14px; background:transparent; color:var(--text-muted); }
.seg button.active { background:#fff; color:var(--teal-700); box-shadow:0 1px 3px rgba(40,60,80,.12); }

/* utility */
.row { display:flex; align-items:center; gap:8px; }
.col { display:flex; flex-direction:column; gap:8px; }
.grow { flex:1; min-width:0; }
.mono { font-family:var(--font-mono); }
.muted { color:var(--text-muted); }
.subtle { color:var(--text-subtle); }
.strong { color:var(--text-strong); }
.hidden { display:none !important; }

/* keyframes from prototype */
@keyframes lkpulse { 0% { box-shadow:0 0 0 0 rgba(239,86,48,.45); } 70% { box-shadow:0 0 0 14px rgba(239,86,48,0); } 100% { box-shadow:0 0 0 0 rgba(239,86,48,0); } }
.pulse { animation:lkpulse 1.4s ease-out infinite; }
