/* ═══════════════════════════════════════════════════════════════════
   VacationMind — Stylesheet
   ═══════════════════════════════════════════════════════════════════ */

/* ── Design tokens ──────────────────────────────────────────────────── */
:root {
  --color-primary:       #2563eb;
  --color-primary-dark:  #1d4ed8;
  --color-primary-light: #dbeafe;

  --color-success:       #16a34a;
  --color-success-dark:  #15803d;
  --color-success-light: #dcfce7;

  --color-danger:        #dc2626;
  --color-danger-dark:   #b91c1c;
  --color-danger-light:  #fee2e2;

  --color-warning:       #d97706;
  --color-warning-light: #fef3c7;

  --color-selected:      #7c3aed;
  --color-selected-light:#ede9fe;

  --color-today-border:  #f59e0b;
  --color-today-bg:      #fffbeb;

  --color-surface:       #ffffff;
  --color-bg:            #f1f5f9;
  --color-border:        #e2e8f0;

  --color-text:          #0f172a;
  --color-text-muted:    #64748b;
  --color-text-disabled: #94a3b8;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10);
  --shadow-lg: 0 20px 40px rgba(0,0,0,.14);

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --transition: 120ms ease;
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; }
[hidden] { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════ */
.page-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  padding: 24px;
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.login-card {
  width: 100%;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  margin-bottom: 16px;
}

.login-brand-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.5px;
}

.login-brand-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ── Form ───────────────────────────────────────────────────────────── */
.login-form { display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.form-input.is-invalid {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,.12);
}

.input-password-wrapper { position: relative; }

.input-password-wrapper .form-input { padding-right: 44px; }

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.toggle-password:hover { color: var(--color-text); }

.form-field-error {
  font-size: 0.8rem;
  color: var(--color-danger);
  min-height: 1.2em;
}

.form-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-alert-error {
  background: var(--color-danger-light);
  color: var(--color-danger-dark);
  border: 1px solid rgba(220,38,38,.2);
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), box-shadow var(--transition),
              opacity var(--transition);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}

.btn:disabled { opacity: 0.55; pointer-events: none; }
.btn-full { width: 100%; padding: 12px 18px; font-size: 1rem; }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.btn-success {
  background: var(--color-success);
  color: #fff;
  border-color: var(--color-success);
}
.btn-success:hover:not(:disabled) {
  background: var(--color-success-dark);
  border-color: var(--color-success-dark);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--color-danger-dark);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: currentColor;
}
.btn-outline:hover:not(:disabled) {
  background: var(--color-primary-light);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--color-bg);
  color: var(--color-text);
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-icon { padding: 7px; width: 34px; height: 34px; }

/* ── Spinner ────────────────────────────────────────────────────────── */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════════════════════ */
.page-dashboard { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Header ─────────────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.05rem;
}

.header-brand-name { color: var(--color-text); }

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user-name {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.header-user-nif {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 600;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  white-space: nowrap;
}

/* ── Main ───────────────────────────────────────────────────────────── */
.app-main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 120px;
}

/* ── Loading / Error states ─────────────────────────────────────────── */
.loading-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 300px;
  color: var(--color-text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════════
   STATS
   ═══════════════════════════════════════════════════════════════════ */
.stats-section { margin-bottom: 32px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 600px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  border-left: 4px solid transparent;
  transition: box-shadow var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-available { border-left-color: var(--color-success); }
.stat-used      { border-left-color: var(--color-warning); }
.stat-pending   { border-left-color: var(--color-selected); }
.stat-total     { border-left-color: var(--color-primary); }

.stat-value {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-available .stat-value { color: var(--color-success); }
.stat-used      .stat-value { color: var(--color-warning); }
.stat-pending   .stat-value { color: var(--color-selected); }
.stat-total     .stat-value { color: var(--color-primary); }

.stat-label { font-size: 0.875rem; color: var(--color-text-muted); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════════
   YEAR TABS
   ═══════════════════════════════════════════════════════════════════ */
.calendar-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.year-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  background: #f8fafc;
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.year-tabs::-webkit-scrollbar { display: none; }

.year-tab {
  padding: 14px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
  margin-bottom: -1px;
}

.year-tab:hover { color: var(--color-primary); }

.year-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: var(--color-surface);
}

/* ═══════════════════════════════════════════════════════════════════
   CALENDAR GRID
   ═══════════════════════════════════════════════════════════════════ */
.calendar-container { padding: 24px; }

.calendar-year {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}

.month-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.month-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
  padding: 10px 12px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  letter-spacing: 0.3px;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

/* Day headers (Seg Ter...) */
.day-header {
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  padding: 6px 2px 4px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-header.is-weekend { color: var(--color-text-disabled); }

/* Day cells */
.day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
  margin: 1px;
  transition: background var(--transition), color var(--transition),
              transform var(--transition);
  position: relative;
  user-select: none;
}

/* States */
.day-available {
  color: var(--color-text);
  cursor: pointer;
}
.day-available:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  transform: scale(1.1);
}

.day-selected {
  background: var(--color-selected);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
.day-selected:hover {
  background: #6d28d9;
  transform: scale(1.1);
}

.day-booked {
  background: var(--color-success);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
.day-booked:hover {
  background: var(--color-success-dark);
  transform: scale(1.05);
}

.day-pending-approval {
  background: repeating-linear-gradient(
    45deg,
    #7c3aed 0px, #7c3aed 4px,
    #ede9fe 4px, #ede9fe 10px
  );
  color: #4c1d95;
  cursor: pointer;
  font-weight: 700;
  border: 1px solid #7c3aed;
}
.day-pending-approval:hover {
  opacity: .85;
  transform: scale(1.05);
}

.day-booked-past {
  background: #bbf7d0;
  color: var(--color-success-dark);
  font-weight: 600;
  cursor: default;
}

.day-past {
  color: var(--color-text-disabled);
  cursor: not-allowed;
}

.day-weekend {
  color: var(--color-text-disabled);
  background: #fafafa;
  cursor: not-allowed;
  font-weight: 400;
}

.day-today {
  box-shadow: 0 0 0 2px var(--color-today-border);
  background: var(--color-today-bg);
  font-weight: 700;
}

.day-today.day-available { color: var(--color-today-border); }
.day-today.day-available:hover { background: var(--color-primary-light); }

/* ── Legend ─────────────────────────────────────────────────────────── */
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  background: #f8fafc;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.swatch-available { background: var(--color-surface); border: 1.5px solid var(--color-border); }
.swatch-selected  { background: var(--color-selected); }
.swatch-pending   {
  background: repeating-linear-gradient(45deg, #7c3aed 0px, #7c3aed 4px, #ede9fe 4px, #ede9fe 10px);
  border: 1px solid #7c3aed;
}
.swatch-booked    { background: var(--color-success); }
.swatch-today     { background: var(--color-today-bg); box-shadow: 0 0 0 2px var(--color-today-border); }
.swatch-past      { background: var(--color-bg); border: 1.5px solid var(--color-border); }
.swatch-weekend   { background: #fafafa; border: 1.5px solid #e5e7eb; }

/* ═══════════════════════════════════════════════════════════════════
   BOOKING BAR
   ═══════════════════════════════════════════════════════════════════ */
.booking-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--color-text);
  color: #fff;
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
  padding: 16px 24px;
  animation: slideUp .25s ease;
}

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

.booking-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.booking-bar-info {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 1rem;
}

.booking-bar-info strong { font-size: 1.4rem; color: #fff; }

.booking-bar-years {
  font-size: 0.8rem;
  color: rgba(255,255,255,.65);
  margin-left: 4px;
}

.booking-bar-actions { display: flex; align-items: center; gap: 12px; }

.booking-bar .btn-ghost {
  color: rgba(255,255,255,.75);
  border-color: rgba(255,255,255,.25);
}
.booking-bar .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ═══════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: calc(100vw - 40px);
}

.toast {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 14px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left: 4px solid transparent;
  animation: fadeInRight .25s ease;
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast-success { border-left-color: var(--color-success); color: var(--color-success-dark); }
.toast-error   { border-left-color: var(--color-danger);  color: var(--color-danger-dark);  }
.toast-info    { border-left-color: var(--color-primary); color: var(--color-primary-dark); }

/* ═══════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  max-width: 400px;
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  animation: scaleIn .2s ease;
}

@keyframes scaleIn {
  from { transform: scale(.95); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.modal-body { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 24px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 12px; }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .app-main { padding: 16px 12px 140px; }
  .calendar-year { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .calendar-container { padding: 12px; }
  .login-card { padding: 28px 20px; }
  .booking-bar-inner { flex-direction: column; align-items: stretch; }
  .booking-bar-actions { justify-content: flex-end; }
}

@media (max-width: 480px) {
  /* Header */
  .app-header { padding: 0 12px; height: 52px; }
  .header-user-name { display: none; }
  .header-user-nif { font-size: 0.72rem; padding: 2px 6px; }
  .header-user .btn { font-size: 0.78rem; padding: 7px 10px; }
  .header-user { gap: 8px; }

  /* Main */
  .app-main { padding: 12px 10px 160px; }

  /* Login */
  .login-card { padding: 24px 16px; }
  .login-brand-name { font-size: 1.4rem; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr; gap: 10px; }
  .stat-card { padding: 14px 16px; }
  .stat-value { font-size: 1.75rem; }

  /* Calendar: 1 mês por linha */
  .calendar-year { grid-template-columns: 1fr; gap: 8px; }
  .calendar-container { padding: 8px; }
  .month-header { font-size: 0.875rem; padding: 10px 12px; }
  .day-header { font-size: 0.65rem; padding: 6px 2px 4px; }
  .day-cell { font-size: 0.75rem; }

  /* Year tabs */
  .year-tabs { padding: 0 8px; }
  .year-tab { padding: 10px 14px; font-size: 0.85rem; }

  /* Legend */
  .calendar-legend { padding: 12px; gap: 10px; }
  .legend-item { font-size: 0.72rem; }

  /* Booking bar */
  .booking-bar { padding: 12px 14px; }
  .booking-bar-inner { gap: 10px; }
  .booking-bar-info { font-size: 0.9rem; }
  .booking-bar-info strong { font-size: 1.2rem; }
  .booking-bar-actions { gap: 8px; }
  .booking-bar-actions .btn { flex: 1; }

  /* Modal */
  .modal-overlay { align-items: flex-start; padding: 12px; }
  .modal-card {
    padding: 20px 14px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    border-radius: var(--radius-md);
  }

  /* Forced password change */
  .pw-change-overlay { padding: 12px; align-items: flex-start; }
  .pw-change-card {
    padding: 24px 16px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  /* Toast */
  .toast-container { right: 10px; top: 62px; }

  /* Inbox popup */
  .inbox-popup { right: 8px; left: 8px; width: auto; }
}

/* ═══════════════════════════════════════════════════════════════════
   INBOX
   ═══════════════════════════════════════════════════════════════════ */

/* Bell trigger in header */
.inbox-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: background var(--transition), color var(--transition);
}
.inbox-trigger:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

.inbox-trigger-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 4px;
  pointer-events: none;
}
/* Popup panel */
.inbox-popup {
  position: fixed;
  top: 62px;
  right: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: 480px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
}
.inbox-popup[hidden] { display: none; }

.inbox-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.inbox-popup-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  flex: 1;
}

.inbox-popup-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--color-text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.inbox-popup-close:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

.inbox-popup .inbox-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px;
  gap: 6px;
}

.inbox-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
}

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inbox-item {
  background: var(--color-surface);
  border: 1.5px solid var(--color-danger-light);
  border-left: 4px solid var(--color-danger);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow var(--transition);
}

.inbox-item:hover { box-shadow: var(--shadow-md); }

.inbox-item-read {
  border-left-color: var(--color-border);
  border-color: var(--color-border);
  opacity: 0.75;
  cursor: default;
}

.inbox-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.inbox-item-subject {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-text);
  flex: 1;
}

.inbox-item-meta {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.inbox-item-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}
.inbox-item-delete:hover {
  color: var(--color-danger);
  background: var(--color-danger-light);
}

.inbox-item-body {
  font-size: 0.87rem;
  color: var(--color-text-muted);
  white-space: pre-wrap;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════
   FORCED PASSWORD CHANGE OVERLAY
   ═══════════════════════════════════════════════════════════════════ */

.pw-change-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 24px;
}
.pw-change-overlay[hidden] { display: none; }

.pw-change-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.22);
}

.pw-change-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.pw-change-subtitle {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.pw-change-error {
  color: var(--color-danger-dark);
  background: var(--color-danger-light);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

#pw-change-form .form-group { margin-bottom: 16px; }

.pw-change-btn {
  width: 100%;
  margin-top: 8px;
}
