/* ============================================================
   Team Dynamic Recovery — March Madness v1.2
   app.css  |  Phone-first employee app styles
   ============================================================ */

/* --- LIGHT THEME (default) --- */
:root, [data-theme="light"] {
  --bg:          #f2f2f7;
  --bg2:         #ffffff;
  --bg3:         #f2f2f7;
  --bg4:         #e5e5ea;
  --bg5:         #d1d1d6;
  --border:      #e0e0e5;
  --text:        #1c1c1e;
  --text2:       #6e6e73;
  --text3:       #aeaeb2;
  --cyan:        #007aff;
  --cyan2:       #0056cc;
  --cyan-dim:    rgba(0,122,255,0.10);
  --cyan-glow:   rgba(0,122,255,0.25);
  --red:         #ff3b30;
  --green:       #34c759;
  --yellow:      #ff9500;
  --purple:      #af52de;
  --shadow:      0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
  --nav-bg:      rgba(255,255,255,0.94);
  --bottom-bg:   rgba(255,255,255,0.94);
  --card-bg:     #ffffff;
  --input-bg:    #f2f2f7;
  --overlay:     rgba(0,0,0,0.4);
  --login-bg:    linear-gradient(160deg,#007aff 0%,#5ac8fa 55%,#34c759 100%);
  --tab-active:  var(--cyan);
}

/* --- DARK THEME --- */
[data-theme="dark"] {
  --bg:          #0f0f11;
  --bg2:         #161619;
  --bg3:         #1e1e22;
  --bg4:         #252529;
  --bg5:         #2e2e35;
  --border:      #2e2e35;
  --text:        #f0f0f2;
  --text2:       #9999aa;
  --text3:       #55556a;
  --cyan:        #00e5cc;
  --cyan2:       #00b8a6;
  --cyan-dim:    rgba(0,229,204,0.12);
  --cyan-glow:   rgba(0,229,204,0.22);
  --red:         #ff4466;
  --green:       #00cc88;
  --yellow:      #ffcc44;
  --purple:      #cc77ff;
  --shadow:      0 2px 16px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.6);
  --nav-bg:      rgba(22,22,25,0.96);
  --bottom-bg:   rgba(22,22,25,0.96);
  --card-bg:     #161619;
  --input-bg:    #1e1e22;
  --overlay:     rgba(0,0,0,0.7);
  --login-bg:    linear-gradient(160deg,#001a3a 0%,#002a50 55%,#001a20 100%);
  --tab-active:  var(--cyan);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body, .app-body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 430px;
  margin: 0 auto;
  overflow-x: hidden;
  transition: background 0.25s, color 0.25s;
}

/* === SVG HELPERS === */
.icon-svg  { width: 22px; height: 22px; color: var(--text2); flex-shrink: 0; }
.tab-svg   { width: 22px; height: 22px; transition: color 0.15s; }
.stat-svg  { width: 20px; height: 20px; }
.action-svg{ width: 22px; height: 22px; }

/* ====================================================
   LOGIN
   ==================================================== */
.login-screen {
  position: fixed; inset: 0;
  background: var(--login-bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 28px 24px;
}
.login-inner {
  width: 100%; max-width: 340px;
  display: flex; flex-direction: column; align-items: center;
}

.login-hero-icon {
  width: 96px; height: 96px;
  background: rgba(255,255,255,0.18);
  border-radius: 28px; margin-bottom: 22px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.25);
  backdrop-filter: blur(10px);
}
.login-hero-icon svg { width: 64px; height: 64px; }

.login-title {
  font-size: 21px; font-weight: 800; color: #fff;
  text-align: center; margin-bottom: 4px; letter-spacing: -0.3px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.15);
}
.login-subtitle { font-size: 14px; color: rgba(255,255,255,0.75); margin-bottom: 28px; text-align: center; }

.login-form { width: 100%; }
.login-field-wrap { position: relative; margin-bottom: 12px; }
.login-field-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: rgba(255,255,255,0.55); pointer-events: none;
}
.login-input {
  width: 100%; padding: 14px 16px 14px 42px;
  border-radius: 14px; border: 1.5px solid rgba(255,255,255,0.22);
  font-size: 16px; font-family: inherit;
  background: rgba(255,255,255,0.14); color: #fff;
  outline: none; transition: all 0.15s;
  backdrop-filter: blur(8px); -webkit-appearance: none; appearance: none;
}
.login-input::placeholder { color: rgba(255,255,255,0.45); }
.login-input:focus { border-color: rgba(255,255,255,0.65); background: rgba(255,255,255,0.20); }
.login-input option { background: #1c1c1e; color: #f0f0f2; }
.login-code-input { letter-spacing: 6px; text-align: center; font-weight: 700; font-size: 18px; padding-left: 16px; }

.login-btn {
  width: 100%; padding: 15px;
  border-radius: 14px; border: none;
  background: #fff; color: var(--cyan);
  font-family: inherit; font-size: 17px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.1s, box-shadow 0.1s; margin-top: 6px;
}
.login-btn:active { transform: scale(0.98); }
.login-error {
  background: rgba(255,59,48,0.18); border: 1px solid rgba(255,59,48,0.35);
  color: #fff; border-radius: 12px; padding: 10px 14px;
  font-size: 13px; text-align: center; margin-top: 12px;
}
.login-footer { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 20px; text-align: center; }

/* ====================================================
   TOP NAV
   ==================================================== */
.top-nav {
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px 12px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  transition: background 0.25s;
}
.nav-logo-wrap { display: flex; align-items: center; gap: 10px; }
.nav-logo-img  { width: 36px; height: 36px; object-fit: contain; border-radius: 9px; }
.nav-logo-text { font-size: 14px; font-weight: 800; color: var(--text); line-height: 1.2; }
.nav-logo-text span { display: block; font-size: 11px; color: var(--text2); font-weight: 500; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), #5ac8fa);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: #fff;
  cursor: pointer; box-shadow: 0 2px 8px var(--cyan-glow); flex-shrink: 0;
}

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.15s; position: relative; flex-shrink: 0;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn .icon-svg { width: 18px; height: 18px; }
.icon-moon, .icon-sun { width: 18px; height: 18px; color: var(--text2); }

.notif-dot {
  position: absolute; top: 3px; right: 3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--bg2);
}

/* ====================================================
   NOTIFICATION / FLASH PANEL
   ==================================================== */
.notif-panel {
  position: sticky; top: 61px; z-index: 90;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  max-height: 60vh; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  transition: background 0.25s;
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg2); z-index: 2;
}
.notif-panel-title { font-size: 16px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.notif-overlay { position: fixed; inset: 0; z-index: 89; }

.flash-card { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.flash-card:last-child { border-bottom: none; }
.flash-type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px;
}
.flash-type-video    { background: rgba(255,59,48,0.10);  color: var(--red); }
.flash-type-photo    { background: rgba(0,122,255,0.10);  color: var(--cyan); }
.flash-type-personal { background: rgba(52,199,89,0.10);  color: var(--green); }
.flash-type-team     { background: rgba(175,82,222,0.10); color: var(--purple); }

.flash-card-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.flash-card-desc  { font-size: 13px; color: var(--text2); margin-bottom: 10px; line-height: 1.5; }
.flash-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.flash-pts-badge {
  background: linear-gradient(135deg,#ff9500,#ffcc00); color: #fff;
  font-size: 13px; font-weight: 700; padding: 5px 13px; border-radius: 20px;
  box-shadow: 0 2px 8px rgba(255,149,0,0.25);
}
.flash-do-btn {
  background: linear-gradient(135deg, var(--cyan), #5ac8fa);
  color: #fff; border: none; border-radius: 10px;
  padding: 8px 16px; font-size: 13px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 5px;
  box-shadow: 0 2px 8px var(--cyan-glow);
  transition: transform 0.1s; font-family: inherit;
}
.flash-do-btn:active { transform: scale(0.97); }
.flash-expires { font-size: 11px; color: var(--text3); }
.flash-empty { padding: 40px 20px; text-align: center; color: var(--text2); font-size: 14px; }

/* ====================================================
   PAGES & NAVIGATION
   ==================================================== */
.page { display: none; padding-bottom: 100px; min-height: calc(100vh - 62px); }
.page.active { display: block; }

.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: var(--bottom-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  display: flex; padding: 8px 0 env(safe-area-inset-bottom, 12px);
  z-index: 200; transition: background 0.25s;
}
.tab-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 2px; cursor: pointer;
  transition: all 0.15s; padding: 4px 0;
}
.tab-icon {
  width: 44px; height: 30px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.tab-icon .tab-svg { color: var(--text3); }
.tab-item.active .tab-icon { background: var(--cyan-dim); }
.tab-item.active .tab-icon .tab-svg { color: var(--tab-active); }
.tab-label { font-size: 10px; font-weight: 600; color: var(--text3); transition: color 0.15s; }
.tab-item.active .tab-label { color: var(--tab-active); }

.tab-submit-center { flex-shrink: 0; }
.tab-icon-main {
  width: 50px; height: 50px;
  background: linear-gradient(135deg, var(--cyan), #5ac8fa);
  border-radius: 16px; margin-top: -14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px var(--cyan-glow);
}

/* ====================================================
   HEADERS & SECTION LABELS
   ==================================================== */
.section-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 10px; }
.section-title  { font-size: 20px; font-weight: 700; color: var(--text); }
.section-link   { font-size: 14px; color: var(--cyan); font-weight: 500; cursor: pointer; }
.page-top-bar   { padding: 16px 16px 8px; display: flex; align-items: center; justify-content: space-between; }
.page-top-title { font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.page-top-sub   { font-size: 13px; color: var(--text2); margin-top: 2px; }

/* ====================================================
   HOME
   ==================================================== */
.greeting { padding: 18px 16px 6px; }
.greeting-sub  { font-size: 13px; color: var(--text2); }
.greeting-name { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }

.stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 0 16px 14px; }
.stat-card {
  background: var(--card-bg); border-radius: 16px;
  padding: 14px 10px; text-align: center; box-shadow: var(--shadow);
  transition: background 0.25s;
}
.stat-icon-wrap {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 8px;
}
.stat-num   { font-size: 22px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11px; color: var(--text2); font-weight: 500; margin-top: 2px; }

.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 14px; }
.action-btn {
  background: var(--card-bg); border-radius: 16px;
  padding: 14px 12px; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow); cursor: pointer; border: none;
  transition: all 0.15s; text-align: left; width: 100%;
}
.action-btn:active { transform: scale(0.97); }
.action-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.action-label { font-size: 13px; font-weight: 700; color: var(--text); }
.action-sub   { font-size: 11px; color: var(--text2); margin-top: 2px; }

/* GRADIENTS */
.blue-grad   { background: linear-gradient(135deg,#007aff,#5ac8fa); }
.green-grad  { background: linear-gradient(135deg,#34c759,#30d158); }
.orange-grad { background: linear-gradient(135deg,#ff9500,#ffcc00); }
.purple-grad { background: linear-gradient(135deg,#af52de,#c86dd7); }
.red-grad    { background: linear-gradient(135deg,#ff3b30,#ff6961); }
.teal-grad   { background: linear-gradient(135deg,#5ac8fa,#007aff); }

[data-theme="dark"] .blue-grad   { background: linear-gradient(135deg,#0066cc,#00aacc); }
[data-theme="dark"] .green-grad  { background: linear-gradient(135deg,#00aa66,#00cc88); }
[data-theme="dark"] .orange-grad { background: linear-gradient(135deg,#cc6600,#cc9900); }
[data-theme="dark"] .purple-grad { background: linear-gradient(135deg,#8844cc,#aa55ee); }

/* ====================================================
   FEED
   ==================================================== */
.feed-container { padding: 0 16px; }
.feed-card {
  background: var(--card-bg); border-radius: 20px;
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px;
  transition: background 0.25s;
}
.feed-media {
  width: 100%; height: 190px;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; position: relative; overflow: hidden;
}
.feed-media img, .feed-media video { width: 100%; height: 100%; object-fit: cover; }
.feed-media-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.52); color: #fff;
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: 20px; backdrop-filter: blur(6px);
  display: flex; align-items: center; gap: 4px;
}
.feed-body { padding: 12px 14px; }
.feed-top  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.feed-user { display: flex; align-items: center; gap: 9px; }
.feed-av   {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), #5ac8fa);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.feed-name { font-size: 14px; font-weight: 700; color: var(--text); }
.feed-sub  { font-size: 11px; color: var(--text2); }
.feed-pts-badge {
  background: linear-gradient(135deg, var(--cyan), #5ac8fa); color: #fff;
  font-size: 14px; font-weight: 700; padding: 5px 12px;
  border-radius: 20px; box-shadow: 0 2px 8px var(--cyan-glow);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.feed-caption { font-size: 14px; color: var(--text); line-height: 1.55; margin-bottom: 8px; }
.feed-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.feed-tag  { font-size: 12px; color: var(--cyan); background: var(--cyan-dim); padding: 3px 9px; border-radius: 20px; font-weight: 500; }
.feed-footer {
  padding: 9px 14px; background: var(--bg3);
  display: flex; align-items: center; justify-content: space-between;
}
.feed-cat  { font-size: 12px; color: var(--text2); font-weight: 500; }
.feed-time { font-size: 11px; color: var(--text3); }
.team-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--cyan-dim); color: var(--cyan);
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; margin-bottom: 6px;
}
.feed-flash-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,149,0,0.10); color: var(--yellow);
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px; margin-bottom: 6px;
}

/* ====================================================
   TASKS
   ==================================================== */
.cat-scroll { display: flex; gap: 8px; padding: 0 16px 12px; overflow-x: auto; scrollbar-width: none; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  padding: 7px 15px; border-radius: 20px; border: none;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all 0.15s;
  background: var(--bg4); color: var(--text2);
}
.cat-chip.active { background: var(--cyan); color: #fff; box-shadow: 0 2px 8px var(--cyan-glow); }

.task-row {
  background: var(--card-bg); border-radius: 16px;
  margin-bottom: 10px; box-shadow: var(--shadow); overflow: hidden;
  transition: background 0.25s;
}
.task-row-main { display: flex; align-items: center; gap: 12px; padding: 13px 13px 10px; }
.task-icon-wrap {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.task-info  { flex: 1; min-width: 0; }
.task-name  { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.task-meta-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 3px; }
.task-notes { font-size: 12px; color: var(--text2); line-height: 1.4; }
.task-pts-pill {
  background: linear-gradient(135deg, var(--cyan), #5ac8fa); color: #fff;
  font-size: 13px; font-weight: 700; padding: 5px 11px;
  border-radius: 20px; flex-shrink: 0;
  box-shadow: 0 2px 8px var(--cyan-glow); font-variant-numeric: tabular-nums;
}
.task-done-badge {
  background: linear-gradient(135deg,#34c759,#30d158); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 9px;
  border-radius: 20px; display: flex; align-items: center; gap: 3px;
  white-space: nowrap; flex-shrink: 0;
}
.task-action-row { display: flex; justify-content: flex-end; padding: 0 13px 12px; }
.do-task-btn {
  background: linear-gradient(135deg, var(--cyan), #5ac8fa);
  color: #fff; border: none; border-radius: 10px;
  padding: 9px 18px; font-size: 13px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 5px;
  box-shadow: 0 2px 8px var(--cyan-glow); transition: transform 0.1s; font-family: inherit;
}
.do-task-btn:active { transform: scale(0.97); }

/* PILLS */
.pill { font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 20px; display: inline-block; }
.pill-blue   { background: rgba(0,122,255,0.10);  color: #007aff; }
.pill-green  { background: rgba(52,199,89,0.10);  color: #34c759; }
.pill-gray   { background: var(--bg4);             color: var(--text2); }
.pill-purple { background: rgba(175,82,222,0.10); color: #af52de; }
.pill-red    { background: rgba(255,59,48,0.10);  color: #ff3b30; }
[data-theme="dark"] .pill-blue   { color: var(--cyan); }
[data-theme="dark"] .pill-green  { color: var(--green); }
[data-theme="dark"] .pill-purple { color: var(--purple); }
[data-theme="dark"] .pill-red    { color: var(--red); }

/* ====================================================
   LEADERBOARD
   ==================================================== */
.podium-wrap { padding: 14px 16px; display: flex; align-items: flex-end; gap: 8px; justify-content: center; }
.podium-item { text-align: center; flex: 1; max-width: 110px; }
.podium-av   {
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), #5ac8fa);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: #fff;
  margin: 0 auto 5px; box-shadow: 0 4px 14px var(--cyan-glow);
}
.podium-2 .podium-av { width: 42px; height: 42px; font-size: 14px; }
.podium-3 .podium-av { width: 38px; height: 38px; font-size: 13px; }
.podium-name { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 1px; }
.podium-pts  { font-size: 13px; font-weight: 700; color: var(--cyan); font-variant-numeric: tabular-nums; }
.podium-block { border-radius: 9px 9px 0 0; margin-top: 7px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.podium-1 .podium-block { height: 68px; background: linear-gradient(135deg,#ffd700,#ffb700); }
.podium-2 .podium-block { height: 50px; background: linear-gradient(135deg,#c0c0c0,#a0a0a0); }
.podium-3 .podium-block { height: 36px; background: linear-gradient(135deg,#cd7f32,#a0622a); }

.lb-segment { display: flex; background: var(--bg4); border-radius: 9px; padding: 3px; margin: 0 16px 14px; gap: 2px; }
.lb-seg-btn {
  flex: 1; padding: 7px; border-radius: 7px; border: none;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; background: none; color: var(--text2); transition: all 0.15s;
}
.lb-seg-btn.active { background: var(--bg2); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.10); }

.lb-list { padding: 0 16px; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-bg); border-radius: 16px;
  padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow);
  transition: background 0.25s;
}
.lb-rank   { font-size: 18px; font-weight: 800; width: 26px; text-align: center; color: var(--text3); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.lb-rank.r1{ color: #ffd700; }
.lb-rank.r2{ color: #c0c0c0; }
.lb-rank.r3{ color: #cd7f32; }
.lb-av     { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--cyan), #5ac8fa); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.lb-info   { flex: 1; min-width: 0; }
.lb-nm     { font-size: 15px; font-weight: 700; color: var(--text); }
.lb-loc    { font-size: 11px; color: var(--text2); margin-top: 1px; }
.lb-score  { font-size: 20px; font-weight: 800; color: var(--cyan); font-variant-numeric: tabular-nums; }
.lb-subs   { font-size: 11px; color: var(--text3); text-align: right; }
.lb-you-badge { font-size: 10px; background: var(--cyan-dim); color: var(--cyan); padding: 2px 6px; border-radius: 10px; font-weight: 700; margin-left: 5px; }

/* ====================================================
   SUBMIT FORM
   ==================================================== */
.form-section { padding: 0 16px 16px; }
.form-group   { margin-bottom: 18px; }
.form-label   { display: block; font-size: 11px; font-weight: 700; color: var(--text2); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.6px; }
.form-select, .form-input, .form-textarea {
  width: 100%; background: var(--input-bg);
  border: 1.5px solid var(--border); color: var(--text);
  padding: 12px 14px; border-radius: 13px;
  font-family: inherit; font-size: 15px;
  outline: none; transition: border-color 0.15s, background 0.25s;
  box-shadow: var(--shadow); -webkit-appearance: none; appearance: none;
}
.form-select:focus, .form-input:focus, .form-textarea:focus { border-color: var(--cyan); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text3); }
.form-textarea { resize: vertical; min-height: 80px; }

.type-toggle { display: flex; background: var(--bg4); border-radius: 12px; padding: 3px; gap: 3px; }
.type-btn {
  flex: 1; padding: 10px; border-radius: 10px; border: none;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; background: none; color: var(--text2); transition: all 0.15s;
}
.type-btn.active { background: var(--bg2); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.10); }

.upload-zone {
  width: 100%; height: 140px;
  border: 2px dashed var(--border); border-radius: 18px;
  background: var(--bg2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; transition: all 0.15s;
}
.upload-zone:hover, .upload-zone:active { background: var(--cyan-dim); border-color: var(--cyan); }
.upload-text { font-size: 14px; font-weight: 600; color: var(--text2); }
.upload-sub  { font-size: 12px; color: var(--text3); }
.file-preview-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 13px; display: block; }
.file-preview-name { font-size: 12px; color: var(--text2); margin-top: 6px; text-align: center; }

.tag-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  padding: 7px 13px; border-radius: 20px;
  background: var(--bg4); color: var(--text2);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s;
  border: 2px solid transparent;
}
.tag-chip.selected { background: var(--cyan-dim); color: var(--cyan); border-color: var(--cyan); }

.pts-preview {
  background: linear-gradient(135deg, var(--cyan), #5ac8fa); border-radius: 16px;
  padding: 15px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 16px var(--cyan-glow);
}
.pts-preview-label { font-size: 13px; color: rgba(255,255,255,0.85); font-weight: 500; }
.pts-preview-calc  { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 2px; font-variant-numeric: tabular-nums; }
.pts-preview-num   { font-size: 32px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }

.submit-btn {
  width: 100%; padding: 16px; border-radius: 14px; border: none;
  background: linear-gradient(135deg, var(--cyan), #5ac8fa); color: #fff;
  font-family: inherit; font-size: 16px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 16px var(--cyan-glow);
  transition: all 0.15s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.submit-btn:active { transform: scale(0.98); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ====================================================
   EVENTS
   ==================================================== */
.event-card {
  background: var(--card-bg); border-radius: 16px;
  padding: 14px 15px; margin-bottom: 10px;
  box-shadow: var(--shadow); display: flex; gap: 13px; align-items: flex-start;
  transition: background 0.25s;
}
.event-date-box {
  width: 44px; text-align: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--cyan), #5ac8fa); border-radius: 10px; padding: 6px 4px;
}
.event-month { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.8); text-transform: uppercase; }
.event-day   { font-size: 21px; font-weight: 800; color: #fff; line-height: 1; }
.event-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.event-time  { font-size: 12px; color: var(--cyan); font-weight: 500; margin-bottom: 2px; }
.event-desc  { font-size: 13px; color: var(--text2); }

/* ====================================================
   BUTTONS
   ==================================================== */
.btn-ios {
  padding: 11px 20px; border-radius: 13px; border: none;
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-ios:active { transform: scale(0.97); }
.btn-ios-primary { background: var(--cyan); color: #fff; box-shadow: 0 2px 8px var(--cyan-glow); }
.btn-ios-ghost   { background: var(--bg4); color: var(--text); border: 1px solid var(--border); }
.btn-ios-danger  { background: rgba(255,59,48,0.10); color: var(--red); border: 1px solid rgba(255,59,48,0.2); }
.btn-ios-sm      { padding: 7px 13px; font-size: 13px; border-radius: 10px; }

/* ====================================================
   MODALS
   ==================================================== */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: var(--overlay); z-index: 500;
  align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px);
  max-width: 430px; margin: 0 auto;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--bg2); border-radius: 24px 24px 0 0;
  padding: 20px 20px env(safe-area-inset-bottom, 30px);
  width: 100%; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
  transition: background 0.25s;
}
.modal-sm    { max-height: 46vh; }
.modal-handle{ width: 36px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 18px; }
.modal h3    { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 16px; letter-spacing: -0.3px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ====================================================
   UTILS
   ==================================================== */
.note-box {
  background: rgba(0,122,255,0.07); border-radius: 13px;
  padding: 11px 14px; font-size: 13px; color: var(--cyan); font-weight: 500; margin-bottom: 14px;
}
[data-theme="dark"] .note-box { background: rgba(0,229,204,0.07); }
.loading-state { text-align: center; padding: 40px 20px; color: var(--text2); font-size: 14px; }
.empty-state   { text-align: center; padding: 48px 20px; color: var(--text3); font-size: 14px; }
.empty-icon    { font-size: 38px; margin-bottom: 8px; }

/* TOAST */
#toast {
  position: fixed; bottom: 104px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(28,28,30,0.92); color: #fff;
  padding: 11px 20px; border-radius: 20px;
  font-size: 14px; font-weight: 500; z-index: 9999;
  opacity: 0; transition: all 0.3s;
  backdrop-filter: blur(10px); white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.28);
  pointer-events: none; max-width: 88vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* SCROLLBAR */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg5); border-radius: 2px; }

/* ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.feed-card, .lb-row, .task-row, .event-card { animation: fadeIn 0.3s ease; }
