/* Divesea Staff Calendar v2 — Dark + Gold Admin Theme */
:root {
  --bg: #0d0d0f;
  --surface: #16161a;
  --surface-alt: #1e1e24;
  --border: #2a2a35;
  --gold: #cd9812;
  --gold-light: #e8b830;
  --red: #e93323;
  --white: #f0f0f5;
  --text: #c8c8d0;
  --text-muted: #707080;
  --accent: #cd9812;
  --font-heading: 'League Spartan', sans-serif;
  --font-body: 'Poppins', -apple-system, sans-serif;
  /* Event type colors */
  --color-task: #3b82f6;
  --color-leave: #8b5cf6;
  --color-order: #f59e0b;
  --color-pickup: #10b981;
  --color-event: #ec4899;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Top Bar ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 12px 24px; position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand.center { flex-direction: column; text-align: center; gap: 4px; }
.logo-mark {
  width: 40px; height: 40px; background: linear-gradient(135deg, var(--gold), #b8860b);
  color: #0d0d0f; font-weight: 900; font-size: 20px; font-family: var(--font-heading);
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; box-shadow: 0 0 12px rgba(205,152,18,0.3);
}
.logo-mark.big { width: 64px; height: 64px; font-size: 32px; border-radius: 10px; }
.header-logo { height: 36px; width: auto; }
.login-logo { max-width: 140px; height: auto; margin-bottom: 8px; }
.brand-text h1 {
  font-family: var(--font-heading); font-size: 16px; letter-spacing: 3px;
  font-weight: 800; color: var(--white);
}
.brand-text p { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); }
.brand.center h1 { font-size: 24px; letter-spacing: 5px; }
.brand.center p { font-size: 12px; color: var(--text-muted); }

.staff-indicator { color: var(--gold); font-size: 12px; font-weight: 600; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid var(--border); background: var(--surface-alt);
  color: var(--text); padding: 7px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all 0.15s; font-family: var(--font-body);
}
.btn:hover { background: var(--border); color: var(--white); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); color: #0d0d0f; border-color: var(--gold); font-weight: 700; }
.btn-primary:hover { background: var(--gold-light); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,0.05); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: var(--white); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; }

/* ---------- Overdue Strip ---------- */
.overdue-strip {
  display: none; background: var(--red); color: var(--white);
  padding: 10px 24px; font-size: 13px; font-weight: 600;
  border-bottom: 2px solid #ff6b6b; align-items: center; gap: 12px;
}
.overdue-strip.show { display: flex; }
.overdue-strip a { color: var(--white); text-decoration: underline; }
.overdue-count { background: rgba(0,0,0,0.3); padding: 2px 8px; border-radius: 10px; font-size: 12px; }

/* ---------- Calendar Wrapper ---------- */
.app { min-height: 100vh; }
.cal-wrap { max-width: 1300px; margin: 20px auto; padding: 0 20px; }
.cal-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-header h2 {
  flex: 1; font-family: var(--font-heading); font-size: 20px;
  font-weight: 700; color: var(--white); letter-spacing: 1px;
}

/* ---------- Legend ---------- */
.legend { display: flex; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Month Grid ---------- */
.cal-grid { background: var(--surface); border-radius: 10px; overflow: hidden;
  display: grid; grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border);
}
.cal-day-header {
  background: var(--surface-alt); color: var(--gold); text-align: center;
  padding: 8px 4px; font-size: 10px; font-weight: 700; font-family: var(--font-heading);
  letter-spacing: 1.5px; border-bottom: 1px solid var(--border);
}
.cal-day {
  background: var(--surface); border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border); min-height: 105px; padding: 5px;
  cursor: pointer; position: relative; transition: background 0.1s;
}
.cal-day:nth-child(7n+1) { border-right: none; }
.cal-day:hover { background: var(--surface-alt); }
.cal-day.other-month { background: #111118; opacity: 0.5; }
.cal-day.today { background: rgba(205,152,18,0.08); border: 1px solid var(--gold); }
.cal-day-num {
  font-size: 12px; font-weight: 700; display: inline-block;
  width: 22px; height: 22px; text-align: center; line-height: 22px;
  border-radius: 50%; color: var(--text-muted);
}
.cal-day.today .cal-day-num { color: var(--gold); }
.cal-event {
  padding: 2px 5px; border-radius: 3px; font-size: 10px; margin-top: 2px;
  overflow: hidden; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  font-weight: 500; cursor: pointer; border-left: 2px solid rgba(255,255,255,0.3);
}
.cal-event:hover { filter: brightness(1.2); }
.cal-event.type-task { background: var(--color-task); color: #fff; }
.cal-event.type-leave { background: var(--color-leave); color: #fff; }
.cal-event.type-order { background: var(--color-order); color: #0d0d0f; }
.cal-event.type-pickup { background: var(--color-pickup); color: #fff; }
.cal-event.type-event { background: var(--color-event); color: #fff; }
.cal-event.status-done { opacity: 0.5; text-decoration: line-through; }

/* ---------- Week Grid ---------- */
.week-grid {
  background: var(--surface); border-radius: 10px; border: 1px solid var(--border);
  display: grid; grid-template-columns: 60px repeat(7, 1fr);
}
.week-time-header, .week-day-header {
  background: var(--surface-alt); padding: 8px; text-align: center;
  font-size: 11px; font-weight: 600; border-bottom: 1px solid var(--border);
  color: var(--gold); font-family: var(--font-heading);
}
.week-time-slot {
  padding: 4px; text-align: right; font-size: 10px; color: var(--text-muted);
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  font-family: var(--font-body);
}
.week-cell {
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  min-height: 40px; padding: 2px; cursor: pointer; position: relative;
}
.week-cell:hover { background: rgba(205,152,18,0.05); }
.week-cell.today { background: rgba(205,152,18,0.08); }
.week-event {
  padding: 1px 4px; border-radius: 2px; font-size: 10px; margin: 1px 0;
  overflow: hidden; cursor: pointer; border-left: 2px solid rgba(255,255,255,0.3);
}
.week-event.type-task { background: var(--color-task); color: #fff; }
.week-event.type-leave { background: var(--color-leave); color: #fff; }
.week-event.type-order { background: var(--color-order); color: #0d0d0f; }
.week-event.type-pickup { background: var(--color-pickup); color: #fff; }
.week-event.type-event { background: var(--color-event); color: #fff; }

/* ---------- Day Grid ---------- */
.day-grid {
  background: var(--surface); border-radius: 10px; border: 1px solid var(--border);
  max-width: 900px; margin: 0 auto;
}
.day-slot {
  display: flex; border-bottom: 1px solid var(--border);
  min-height: 50px;
}
.day-time {
  width: 70px; padding: 8px; text-align: right; font-size: 11px;
  color: var(--text-muted); border-right: 1px solid var(--border);
  font-family: var(--font-body); flex-shrink: 0;
}
.day-content {
  flex: 1; padding: 4px; cursor: pointer;
  display: flex; flex-wrap: wrap; gap: 2px; align-items: flex-start;
}
.day-content:hover { background: rgba(205,152,18,0.05); }
.day-event {
  padding: 3px 8px; border-radius: 4px; font-size: 12px;
  cursor: pointer; font-weight: 500; border-left: 3px solid rgba(255,255,255,0.3);
  flex: 1; min-width: 200px;
}
.day-event.type-task { background: var(--color-task); color: #fff; }
.day-event.type-leave { background: var(--color-leave); color: #fff; }
.day-event.type-order { background: var(--color-order); color: #0d0d0f; }
.day-event.type-pickup { background: var(--color-pickup); color: #fff; }
.day-event.type-event { background: var(--color-event); color: #fff; }

/* ---------- Modal ---------- */
.modal-bg {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 200; align-items: center; justify-content: center;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--surface); border-radius: 12px; padding: 24px;
  width: 90%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  border-top: 3px solid var(--gold); box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.modal h3 { font-family: var(--font-heading); font-size: 18px; margin-bottom: 14px; color: var(--white); }
.modal label {
  display: block; font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-muted); margin: 10px 0 3px;
}
.modal .req { color: var(--red); }
.modal input, .modal textarea, .modal select {
  width: 100%; border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; font-size: 14px; font-family: var(--font-body);
  background: var(--bg); color: var(--white);
}
.modal input:focus, .modal textarea:focus, .modal select:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(205,152,18,0.15);
}
.form-row { display: flex; gap: 10px; }
.form-row > div { flex: 1; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); align-items: center; }
.checklist-item { display: flex; gap: 6px; align-items: center; padding: 4px 0; }
.checklist-item input[type="text"] { flex: 1; }
.checklist-item input[type="checkbox"] { width: auto; accent-color: var(--gold); }
.checklist-item button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; }
.checklist-item button:hover { color: var(--red); }

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #0a0a0d 0%, #1a1a24 100%);
  padding: 20px;
}
.login-card {
  background: var(--surface); border-radius: 14px; padding: 36px 32px;
  width: 100%; max-width: 380px; border-top: 3px solid var(--gold);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.login-card form { margin-top: 24px; }
.login-card label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 5px; display: block; }
.login-card input, .login-card select {
  width: 100%; border: 1px solid var(--border); border-radius: 6px;
  padding: 11px; font-size: 14px; margin-bottom: 14px;
  background: var(--bg); color: var(--white); font-family: var(--font-body);
}
.login-card input:focus, .login-card select:focus { outline: none; border-color: var(--gold); }
.login-card .error {
  background: rgba(233,51,35,0.15); color: var(--red); padding: 8px 12px;
  border-radius: 6px; font-size: 13px; margin-top: 10px; border-left: 3px solid var(--red);
}
.login-card .hint { text-align: center; color: var(--text-muted); font-size: 11px; margin-top: 18px; }

/* ---------- Leave Page ---------- */
.leave-wrap { max-width: 800px; margin: 20px auto; padding: 0 20px; }
.leave-wrap h2 { font-family: var(--font-heading); color: var(--white); font-size: 20px; margin-bottom: 16px; }
.new-leave {
  background: var(--surface); border-radius: 8px; padding: 16px; margin-bottom: 16px;
  border: 1px solid var(--border);
}
.new-leave summary { cursor: pointer; color: var(--gold); font-weight: 600; }
.new-leave form { margin-top: 12px; }
.leave-list { display: flex; flex-direction: column; gap: 8px; }
.leave-card {
  background: var(--surface); border-radius: 8px; padding: 14px 16px;
  border-left: 3px solid var(--gold); border: 1px solid var(--border);
}
.leave-card.leave-pending { border-left-color: var(--color-order); }
.leave-card.leave-approved { border-left-color: var(--color-pickup); }
.leave-card.leave-rejected { border-left-color: var(--red); opacity: 0.7; }
.leave-header { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.leave-status { font-size: 10px; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.leave-pending .leave-status { background: rgba(245,158,11,0.2); color: var(--color-order); }
.leave-approved .leave-status { background: rgba(16,185,129,0.2); color: var(--color-pickup); }
.leave-rejected .leave-status { background: rgba(233,51,35,0.2); color: var(--red); }
.leave-reason { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
.leave-note { color: var(--gold); font-size: 12px; margin-top: 4px; }
.leave-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ---------- Notes ---------- */
.notes-wrap { max-width: 700px; margin: 20px auto; padding: 0 20px; }
.note-form {
  background: var(--surface); border-radius: 8px; padding: 16px;
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px;
}
.note-form textarea {
  border: 1px solid var(--border); border-radius: 6px; padding: 10px;
  font-size: 14px; font-family: var(--font-body); background: var(--bg); color: var(--white);
  resize: vertical;
}
.note-form textarea:focus { outline: none; border-color: var(--gold); }
.notes-list { display: flex; flex-direction: column; gap: 6px; }
.note-card {
  background: var(--surface); border-radius: 6px; padding: 10px 14px;
  border: 1px solid var(--border); border-left: 3px solid var(--gold);
}
.note-content { color: var(--text); white-space: pre-wrap; word-wrap: break-word; }
.note-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 11px; color: var(--text-muted); }
.del-note { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 0 6px; }
.del-note:hover { color: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .topbar { padding: 8px 12px; flex-wrap: wrap; gap: 6px; }
  .brand-text h1 { font-size: 14px; }
  .cal-day { min-height: 70px; padding: 3px; }
  .cal-day-num { font-size: 10px; width: 18px; height: 18px; line-height: 18px; }
  .cal-event { font-size: 9px; }
  .actions .btn { padding: 4px 8px; font-size: 11px; }
  .week-grid { grid-template-columns: 40px repeat(7, 1fr); }
  .day-time { width: 50px; font-size: 10px; }
}
