:root {
  --navy: #0d1b2a; --navy2: #112236; --card: #162a3f; --card2: #1a3050;
  --gold: #c9a96e; --gold2: #e8c98a; --text: #e8e8e8; --muted: #7a9bb5;
  --red: #f87171; --border: rgba(201,169,110,0.15);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; background: var(--navy); color: var(--text); min-height: 100vh; }
a { color: var(--gold); }

/* Layout */
.layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy2); border-right: 1px solid var(--border); padding: 2rem 1.5rem; display: flex; flex-direction: column; gap: 2rem; }
.logo { text-align: center; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.logo img { display: block; margin: 0 auto; }
.logo h1 { font-size: 1.6rem; color: var(--gold); letter-spacing: 0.05em; }
.logo p { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.side-label { display: block; font-size: 0.7rem; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; margin-bottom: 0.75rem; }

.user-pill { display: flex; align-items: center; gap: 0.75rem; background: var(--card); padding: 0.75rem 1rem; border-radius: 10px; border: 1px solid var(--border); }
.user-avatar { width: 36px; height: 36px; background: linear-gradient(135deg, var(--gold), var(--gold2)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--navy); font-size: 0.9rem; flex-shrink: 0; }
.user-info { flex: 1; overflow: hidden; }
.user-info strong { display: block; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info span { font-size: 0.75rem; color: var(--muted); }

.sidebar-nav { margin-top: auto; display: flex; flex-direction: column; gap: 0.4rem; }
.nav-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.875rem; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: 0.875rem; transition: all 0.2s; background: none; border: none; font-family: inherit; cursor: pointer; width: 100%; text-align: left; }
.nav-link:hover { background: var(--card); color: var(--text); }
.nav-link.active { background: rgba(201,169,110,0.12); color: var(--gold); }
.mobile-nav { display: none; }

.main { padding: 2.5rem; overflow-y: auto; }
.page-header { margin-bottom: 2rem; }
.page-header .label { font-size: 0.7rem; letter-spacing: 0.15em; color: var(--gold); text-transform: uppercase; margin-bottom: 0.25rem; }
.page-header h2 { font-size: 2.2rem; font-weight: 700; }
.page-header p { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }

/* Flash */
.flash { padding: 0.8rem 1rem; border-radius: 10px; margin-bottom: 1.25rem; font-size: 0.875rem; border: 1px solid; }
.flash.ok { color: var(--gold2); border-color: rgba(201,169,110,0.35); background: rgba(201,169,110,0.08); }
.flash.error { color: var(--red); border-color: rgba(248,113,113,0.35); background: rgba(248,113,113,0.08); }

/* Forms & buttons */
.form { display: flex; flex-direction: column; gap: 0.6rem; }
.form-row { display: flex; gap: 0.6rem; }
.form-row > * { flex: 1; min-width: 0; }
input[type=text], input[type=password] { background: var(--navy2); border: 1px solid var(--border); color: var(--text); padding: 0.75rem 0.9rem; border-radius: 10px; font-family: inherit; font-size: 0.95rem; outline: none; width: 100%; }
input:focus { border-color: var(--gold); }
.hint { font-size: 0.75rem; color: var(--muted); }
.btn-gold, .btn-ghost, .btn-danger { border-radius: 8px; padding: 0.65rem 1rem; font-weight: 600; font-size: 0.875rem; cursor: pointer; font-family: inherit; transition: all 0.2s; }
.btn-gold { background: var(--gold); color: var(--navy); border: none; }
.btn-gold:hover { background: var(--gold2); }
.btn-ghost { background: none; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--gold); }
.btn-danger { background: none; color: var(--red); border: 1px solid rgba(248,113,113,0.4); }
.btn-danger:hover { background: rgba(248,113,113,0.1); }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; margin-bottom: 1.5rem; }
.card-title, .section-title { font-size: 0.72rem; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; margin-bottom: 1rem; }

/* Welcome */
.welcome { max-width: 460px; margin: 3rem auto; text-align: center; }
.welcome .bismillah { font-size: 2rem; color: var(--gold); margin-bottom: 1rem; direction: rtl; font-family: 'Amiri', serif; }
.welcome h2 { font-size: 2rem; margin-bottom: 0.5rem; }
.welcome > p { color: var(--muted); margin-bottom: 1.75rem; line-height: 1.6; }
.tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.tabs a { flex: 1; padding: 0.6rem; border-radius: 8px; text-decoration: none; color: var(--muted); border: 1px solid var(--border); font-size: 0.875rem; }
.tabs a.active { color: var(--gold); background: rgba(201,169,110,0.12); }
.welcome .panel { text-align: left; }

/* Prayer cards */
.prayers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.prayer-card { width: 100%; font-family: inherit; color: inherit; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem 1.25rem; text-align: center; transition: all 0.25s; cursor: pointer; position: relative; overflow: hidden; }
.prayer-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--border); transition: background 0.25s; }
.prayer-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.prayer-card.done { background: rgba(201,169,110,0.06); border-color: rgba(201,169,110,0.25); }
.prayer-card.done::before { background: var(--gold); }
.prayer-name { font-size: 1.1rem; margin-bottom: 0.25rem; }
.prayer-time { font-size: 0.8rem; color: var(--muted); margin-bottom: 1rem; }
.prayer-status { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); color: var(--navy); font-weight: 700; transition: all 0.25s; }
.prayer-card.done .prayer-status { background: var(--gold); border-color: var(--gold); }

.motivation { background: rgba(201,169,110,0.08); border: 1px solid rgba(201,169,110,0.25); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1.5rem; color: var(--gold); font-size: 0.9rem; line-height: 1.6; }

/* Progress */
.progress-section { margin-bottom: 2.5rem; }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.progress-label { font-size: 0.8rem; color: var(--muted); }
.progress-count { font-size: 0.9rem; font-weight: 600; color: var(--gold); }
.progress-bar { height: 6px; background: var(--card2); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold2)); border-radius: 3px; transition: width 0.5s ease; }

/* Social */
.circle-block { margin-bottom: 2rem; }
.circle-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.75rem; }
.circle-head h3 { font-size: 1rem; color: var(--gold); }
.social-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.social-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.social-card.me { border-color: rgba(201,169,110,0.4); }
.social-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--card2), var(--navy2)); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--gold); font-size: 0.95rem; flex-shrink: 0; }
.social-info { flex: 1; min-width: 0; }
.social-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; }
.prayer-dots { display: flex; gap: 0.35rem; }
.dot { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; color: var(--muted); background: var(--card2); }
.dot.done { background: rgba(201,169,110,0.2); border-color: rgba(201,169,110,0.4); color: var(--gold); }
.social-score { font-size: 1.1rem; font-weight: 700; color: var(--gold); text-align: right; }
.social-score span { display: block; font-size: 0.7rem; color: var(--muted); font-weight: 400; }
.empty { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }

/* Account */
.circle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.card-title + .circle-row { border-top: none; }
.invite { font-family: monospace; font-size: 0.85rem; color: var(--gold2); word-break: break-all; }

/* Analytics */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem 1.5rem; }
.stat-label { font-size: 0.72rem; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; margin-bottom: 0.5rem; }
.stat-value { font-size: 2rem; color: var(--gold); }
.stat-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.trend-circles { display: flex; gap: 1rem; justify-content: space-between; }
.trend-day { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.trend-circle { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--card2); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.95rem; color: var(--muted); }
.trend-circle.full { border-color: var(--gold); color: var(--gold); background: rgba(201,169,110,0.1); }
.trend-circle.partial { border-color: var(--muted); color: var(--text); }
.trend-circle.today { box-shadow: 0 0 0 3px rgba(201,169,110,0.3); }
.trend-count { font-size: 0.72rem; color: var(--muted); }
.heatmap-grid { display: flex; flex-direction: column; gap: 0.5rem; overflow-x: auto; }
.heatmap-row { display: flex; align-items: center; gap: 0.6rem; }
.heatmap-label { font-size: 0.72rem; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; width: 65px; text-align: right; flex-shrink: 0; }
.heatmap-cells { display: flex; gap: 2px; }
.cell { width: 13px; height: 13px; border-radius: 3px; background: var(--card2); border: 1px solid rgba(255,255,255,0.04); flex-shrink: 0; }
.cell.done { background: rgba(201,169,110,0.65); border-color: rgba(201,169,110,0.8); }

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: flex; gap: 0.25rem; align-items: center; background: var(--navy2); border-bottom: 1px solid var(--border); padding: 0.6rem 1rem; position: sticky; top: 0; z-index: 5; }
  .mobile-nav .brand { color: var(--gold); font-weight: 700; margin-right: auto; text-decoration: none; letter-spacing: 0.05em; }
  .mobile-nav .nav-link { width: auto; padding: 0.45rem 0.6rem; font-size: 0.78rem; }
  .main { padding: 1.25rem 1rem; }
  .prayers-grid { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
  .prayer-card { padding: 1rem 0.5rem; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .trend-circles { gap: 0.4rem; }
  .trend-circle { width: 38px; height: 38px; font-size: 0.8rem; }
  .form-row { flex-direction: column; }
}
