/* ============================================
   NotifyBoard — Premium Dark Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg:        #08080F;
  --bg2:       #0F0F1A;
  --bg3:       #16162A;
  --glass:     rgba(255,255,255,0.05);
  --glass2:    rgba(255,255,255,0.09);
  --border:    rgba(255,255,255,0.08);
  --border2:   rgba(255,255,255,0.14);
  --blue:      #1A73E8;
  --blue-dim:  rgba(26,115,232,0.18);
  --blue-glow: rgba(26,115,232,0.35);
  --green:     #00E676;
  --green-dim: rgba(0,230,118,0.12);
  --red:       #F44336;
  --red-dim:   rgba(244,67,54,0.15);
  --amber:     #FFC107;
  --amber-dim: rgba(255,193,7,0.12);
  --text:      #F0F0F8;
  --text2:     #9090B0;
  --text3:     #555570;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 8px 32px rgba(0,0,0,0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.4;
}

/* ── Animated Background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 10%, rgba(26,115,232,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 90%, rgba(0,230,118,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.app {
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin: 0 auto;
  padding: 0 16px 80px;
  min-height: 100vh;
}

/* ── Screen Switching ── */
.screen { display: none; }
.screen.active { display: block; }

/* ── Typography ── */
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p  { color: var(--text2); font-size: 14px; line-height: 1.6; }

/* ── App Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
}

.logo {
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(135deg, #1A73E8, #00E676);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text2);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text3);
  transition: background 0.3s;
}

.status-dot.online { background: var(--green); box-shadow: 0 0 8px var(--green); }

/* ── Glass Card ── */
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  padding: 20px;
  margin-bottom: 12px;
}

.card-tight { padding: 14px 16px; }

/* ── Setup Screen ── */
.setup-hero {
  text-align: center;
  padding: 48px 0 32px;
}

.setup-hero .icon { font-size: 56px; margin-bottom: 16px; display: block; }
.setup-hero h1 { font-size: 28px; margin-bottom: 8px; }
.setup-hero p { font-size: 14px; max-width: 280px; margin: 0 auto; }

/* ── Form Elements ── */
.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus, .field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim);
}

.field textarea { resize: none; }

/* ── Buttons ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.12s, opacity 0.12s, box-shadow 0.2s;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, #1A73E8, #0D5BC4);
  color: white;
  box-shadow: 0 4px 20px var(--blue-glow);
}

.btn-primary:hover { box-shadow: 0 6px 28px var(--blue-glow); }

.btn-success {
  background: linear-gradient(135deg, #00E676, #00BF5F);
  color: #000;
}

.btn-ghost {
  background: var(--glass2);
  border: 1px solid var(--border2);
  color: var(--text);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 13px;
  border-radius: 8px;
  width: auto;
}

.btn-icon { font-size: 20px; }

/* ── 2 Big Action Buttons ── */
.action-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.action-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 16px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.action-big::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  background: white;
  transition: opacity 0.15s;
}

.action-big:active { transform: scale(0.96); }
.action-big:active::before { opacity: 0.06; }

.action-big .big-icon { font-size: 36px; }
.action-big .big-label { color: white; }
.action-big .big-sub { font-size: 11px; font-weight: 400; opacity: 0.75; }

.action-alert {
  background: linear-gradient(145deg, #E85420, #C0392B);
  box-shadow: 0 6px 24px rgba(232,84,32,0.35);
}

.action-bill {
  background: linear-gradient(145deg, #1A73E8, #0D47A1);
  box-shadow: 0 6px 24px var(--blue-glow);
}

/* ── Apartment Grid ── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-label a {
  color: var(--blue);
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
}

.apt-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.apt-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 11px;
  font-weight: 600;
  gap: 3px;
  min-height: 56px;
}

.apt-chip .apt-num { font-size: 15px; font-weight: 800; }
.apt-chip .apt-status { font-size: 9px; color: var(--text3); }
.apt-chip .apt-avatar { font-size: 14px; }

.apt-chip.selected {
  background: var(--blue-dim);
  border-color: var(--blue);
  color: #60a5fa;
}

.apt-chip.selected .apt-status { color: #60a5fa; opacity: 0.7; }

.select-all-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  padding: 8px 0;
}

.select-all-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); }
.select-all-row span { font-size: 13px; color: var(--text2); font-weight: 500; }

/* ── Activity Feed ── */
.activity-feed { max-height: 280px; overflow-y: auto; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.activity-icon.alert-icon { background: var(--red-dim); }
.activity-icon.bill-icon  { background: var(--blue-dim); }

.activity-content { flex: 1; min-width: 0; }
.activity-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.activity-meta  { font-size: 11px; color: var(--text3); }

.empty-state {
  text-align: center;
  padding: 28px 0;
  color: var(--text3);
  font-size: 13px;
}

/* ── Bottom Sheet Modal ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  align-items: flex-end;
  backdrop-filter: blur(6px);
}

.overlay.open { display: flex; }

.sheet {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 24px 24px 0 0;
  padding: 16px 20px 40px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  animation: slideUp 0.28s cubic-bezier(0.34,1.4,0.64,1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.sheet-handle {
  width: 36px; height: 4px;
  background: var(--border2);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.sheet h3 { margin-bottom: 6px; }
.sheet .sub { font-size: 13px; color: var(--text2); margin-bottom: 20px; }

/* Alert type pills */
.type-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.type-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg3);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s;
}

.type-pill .pill-icon { font-size: 20px; }
.type-pill.active { border-color: var(--blue); background: var(--blue-dim); color: #60a5fa; }

/* Target selection in sheet */
.target-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.target-tab {
  flex: 1;
  padding: 9px;
  border: 1.5px solid var(--border2);
  border-radius: 8px;
  background: var(--bg3);
  color: var(--text2);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.target-tab.active { border-color: var(--blue); background: var(--blue-dim); color: #60a5fa; }

/* Bill amount fields */
.bill-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.bill-field {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.bill-field .bill-icon { font-size: 22px; margin-bottom: 6px; display: block; }
.bill-field label { font-size: 11px; color: var(--text2); display: block; margin-bottom: 6px; font-weight: 600; }
.bill-field input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  outline: none;
}

/* Owner invite mini-form */
.invite-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.invite-row input {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  padding: 9px 10px;
  outline: none;
}

.invite-row input:focus { border-color: var(--blue); }

.del-btn {
  width: 30px; height: 30px;
  background: var(--red-dim);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Notification Tray ── */
.notif-tray {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 300;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-height: 50vh;
  overflow: hidden;
}

.notif-card {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  animation: notifIn 0.3s cubic-bezier(0.34,1.4,0.64,1);
  pointer-events: all;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

@keyframes notifIn {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.notif-wa {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.notif-wa .wa-dot {
  width: 20px; height: 20px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.notif-time { font-size: 10px; color: var(--text3); }
.notif-name { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.notif-msg  { font-size: 12px; color: var(--text2); line-height: 1.4; }

.notif-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.notif-btn {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  transition: opacity 0.15s;
}

.notif-btn.wa-btn { background: rgba(37,211,102,0.15); border: 1px solid rgba(37,211,102,0.3); color: #25D366; }
.notif-btn.sim-btn { background: var(--blue-dim); border: 1px solid rgba(26,115,232,0.3); color: #60a5fa; }

/* ── Toast ── */
.toast-wrap {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 400;
}

.toast {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  white-space: nowrap;
  animation: toastIn 0.25s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Owner count badge ── */
.owner-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-dim);
  color: #60a5fa;
  border: 1px solid rgba(26,115,232,0.3);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
}

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

/* ── Utilities ── */
.hidden { display: none !important; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px; }
.gap   { margin-bottom: 12px; }
.flex  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ── Responsive max width ── */
@media (min-width: 520px) {
  .app { padding: 0 0 80px; }
}
