/* ================================================================
   TeamEvents — Main Stylesheet
   ================================================================ */

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --clr-bg:        #f4f5f7;
  --clr-surface:   #ffffff;
  --clr-border:    #e2e5ea;
  --clr-text:      #1a1d23;
  --clr-muted:     #6b7280;
  --clr-primary:   #4f46e5;
  --clr-primary-h: #4338ca;
  --clr-success:   #16a34a;
  --clr-danger:    #dc2626;
  --clr-warning:   #d97706;
  --clr-info:      #0284c7;
  --radius:        8px;
  --radius-lg:     12px;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 12px rgba(0,0,0,.10);
  --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
  --nav-h:         60px;
}

html { font-size: 16px; }
body { font-family: var(--font); background: var(--clr-bg); color: var(--clr-text); line-height: 1.6; }
a    { color: var(--clr-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ─────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: #1a1a2e;
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.nav-brand   { font-size: 1.1rem; font-weight: 700; color: #fff; letter-spacing: .5px; }
.nav-links   { display: flex; gap: 4px; flex: 1; }
.nav-link    { color: #c5c8d6; padding: 6px 12px; border-radius: 6px; font-size: .9rem; transition: background .15s, color .15s; }
.nav-link:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav-right   { display: flex; align-items: center; gap: 16px; }
.user-name   { color: #fff; font-size: .9rem; }
.badge-role  { background: rgba(255,255,255,.15); color: #c5c8d6; font-size: .7rem; padding: 2px 8px; border-radius: 20px; }

/* ── Notification Bell ─────────────────────────────────────────── */
.notif-bell  { position: relative; cursor: pointer; }
.bell-icon   { font-size: 1.2rem; }
.bell-badge  {
  position: absolute; top: -6px; right: -8px;
  background: var(--clr-danger); color: #fff;
  font-size: .65rem; font-weight: 700;
  padding: 2px 5px; border-radius: 10px; min-width: 18px; text-align: center;
}
.notif-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 320px; background: var(--clr-surface);
  border: 1px solid var(--clr-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); z-index: 200;
}
.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--clr-border);
}
.notif-item {
  padding: 12px 16px; border-bottom: 1px solid var(--clr-border);
  cursor: pointer; transition: background .1s;
}
.notif-item:hover { background: #f9fafb; }
.notif-item.unread { background: #eff6ff; }
.notif-item:last-child { border-bottom: none; }
.notif-title   { font-size: .875rem; font-weight: 600; }
.notif-message { font-size: .8rem; color: var(--clr-muted); margin-top: 2px; }
.notif-time    { font-size: .75rem; color: var(--clr-muted); margin-top: 4px; }

/* ── Main Content ───────────────────────────────────────────────── */
.main-content { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; }

/* ── Auth Pages ─────────────────────────────────────────────────── */
.auth-page    { background: #0f0f1a; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-card    { background: var(--clr-surface); border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow-md); }
.auth-logo    { font-size: 1.4rem; font-weight: 800; color: var(--clr-primary); margin-bottom: 8px; letter-spacing: .5px; }
.auth-title   { font-size: 1.25rem; font-weight: 700; margin-bottom: 24px; }
.auth-footer  { margin-top: 20px; text-align: center; font-size: .875rem; color: var(--clr-muted); }
.auth-tabs    { display: flex; gap: 4px; margin-bottom: 20px; background: var(--clr-bg); border-radius: var(--radius); padding: 4px; }
.tab-btn      { flex: 1; padding: 8px; border: none; border-radius: 6px; background: none; cursor: pointer; font-size: .875rem; color: var(--clr-muted); transition: all .15s; }
.tab-btn.active { background: var(--clr-surface); color: var(--clr-text); font-weight: 600; box-shadow: var(--shadow); }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-group     { margin-bottom: 16px; }
.form-group label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; }
.form-row       { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-card      { background: var(--clr-surface); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); max-width: 720px; }
.form-footer    { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.req            { color: var(--clr-danger); }

input[type=text],
input[type=email],
input[type=tel],
input[type=password],
input[type=datetime-local],
select,
textarea {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--clr-border); border-radius: var(--radius);
  font-family: var(--font); font-size: .95rem; color: var(--clr-text);
  background: var(--clr-surface); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
textarea { resize: vertical; }
small    { font-size: .8rem; color: var(--clr-muted); display: block; margin-top: 4px; }

.otp-input { font-size: 1.5rem; letter-spacing: .5em; text-align: center; font-weight: 700; }

.checkbox-list  { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; padding: 10px; border: 1.5px solid var(--clr-border); border-radius: var(--radius); margin-bottom: 8px; }
.checkbox-item  { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.checkbox-item input { width: auto; }
.checkbox-item small { margin: 0; }

.inline-form { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.inline-form select { flex: 1; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn         { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius); border: none; font-family: var(--font); font-size: .9rem; font-weight: 600; cursor: pointer; transition: all .15s; text-decoration: none; }
.btn:hover   { text-decoration: none; filter: brightness(.93); }
.btn-block   { width: 100%; justify-content: center; margin-top: 8px; }
.btn-sm      { padding: 6px 12px; font-size: .8rem; }
.btn-xs      { padding: 3px 8px; font-size: .75rem; }
.btn-primary { background: var(--clr-primary); color: #fff; }
.btn-success { background: var(--clr-success);  color: #fff; }
.btn-danger  { background: var(--clr-danger);   color: #fff; }
.btn-ghost   { background: transparent; color: var(--clr-text); border: 1.5px solid var(--clr-border); }

/* ── Alerts ─────────────────────────────────────────────────────── */
.alert         { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: .9rem; }
.alert p       { margin: 0; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ── Stats Row ──────────────────────────────────────────────────── */
.stats-row  { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card  { background: var(--clr-surface); border-radius: var(--radius-lg); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.stat-num   { display: block; font-size: 2rem; font-weight: 800; color: var(--clr-primary); }
.stat-label { font-size: .8rem; color: var(--clr-muted); text-transform: uppercase; letter-spacing: .5px; }

/* ── Activity List ──────────────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-card {
  background: var(--clr-surface); border-radius: var(--radius-lg);
  padding: 16px 20px; border: 1.5px solid var(--clr-border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  transition: box-shadow .15s; flex-wrap: wrap;
}
.activity-card:hover { box-shadow: var(--shadow-md); }
.activity-card.overdue  { border-color: #fca5a5; background: #fff5f5; }
.activity-card.completed { opacity: .7; }
.activity-info   { display: flex; flex-direction: column; gap: 4px; }
.activity-title  { font-weight: 600; font-size: .95rem; color: var(--clr-text); }
.activity-meta   { font-size: .8rem; color: var(--clr-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.activity-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Activity Detail */
.activity-detail-card { background: var(--clr-surface); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); margin-bottom: 24px; }
.activity-detail-card h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 16px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; font-size: .875rem; color: var(--clr-muted); }
.activity-description { color: var(--clr-text); line-height: 1.7; margin-bottom: 24px; }
.complete-form { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--clr-border); }

/* ── Sections ───────────────────────────────────────────────────── */
.section        { margin-bottom: 40px; }
.section h2     { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

/* ── Tables ─────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; background: var(--clr-surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.data-table th { background: #f8f9fb; padding: 12px 16px; text-align: left; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--clr-muted); border-bottom: 1.5px solid var(--clr-border); }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--clr-border); font-size: .9rem; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fafb; }

/* ── Tabs (page tabs) ───────────────────────────────────────────── */
.tabs      { display: flex; gap: 4px; border-bottom: 2px solid var(--clr-border); margin-bottom: 24px; }
.tab-link  { padding: 10px 18px; font-size: .9rem; font-weight: 600; color: var(--clr-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; }
.tab-link:hover  { color: var(--clr-text); text-decoration: none; }
.tab-link.active { color: var(--clr-primary); border-bottom-color: var(--clr-primary); }

/* ── Teams ──────────────────────────────────────────────────────── */
.team-card     { background: var(--clr-surface); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; border: 1.5px solid var(--clr-border); }
.team-header   { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.member-chips  { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.chip          { display: inline-flex; align-items: center; gap: 4px; background: #eff6ff; color: #1e40af; font-size: .8rem; padding: 4px 10px; border-radius: 20px; }
.chip-remove   { background: none; border: none; cursor: pointer; color: #1e40af; font-size: 1rem; line-height: 1; padding: 0 2px; }
.chip-remove:hover { color: var(--clr-danger); }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge            { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-pending    { background: #fef9c3; color: #854d0e; }
.badge-in_progress{ background: #dbeafe; color: #1e40af; }
.badge-done       { background: #dcfce7; color: #166534; }
.badge-danger     { background: #fee2e2; color: #991b1b; }
.badge-info       { background: #dbeafe; color: #1e40af; }

/* ── Modals ─────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card    { background: var(--clr-surface); border-radius: var(--radius-lg); padding: 32px; width: 100%; max-width: 480px; box-shadow: 0 20px 48px rgba(0,0,0,.2); }
.modal-card h2 { margin-bottom: 20px; font-size: 1.2rem; }

/* ── Misc ───────────────────────────────────────────────────────── */
.text-sm      { font-size: .875rem; }
.text-muted   { color: var(--clr-muted); }
.empty-state  { color: var(--clr-muted); font-size: .9rem; padding: 24px 0; text-align: center; }
.empty-state-page { text-align: center; padding: 80px 20px; }
.empty-state-page h1 { font-size: 5rem; color: var(--clr-border); }
.empty-state-page p  { color: var(--clr-muted); margin: 12px 0 24px; }

.site-footer { text-align: center; padding: 24px; font-size: .8rem; color: var(--clr-muted); border-top: 1px solid var(--clr-border); margin-top: 60px; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .form-row   { grid-template-columns: 1fr; }
  .stats-row  { grid-template-columns: 1fr 1fr; }
  .navbar     { padding: 0 16px; gap: 12px; }
  .nav-links  { display: none; }
  .main-content { padding: 20px 16px; }
  .activity-card { flex-direction: column; align-items: flex-start; }
}
