/* ═══════════════════════════════════════════════════════
   ATTENDANCE MANAGEMENT SYSTEM — MAIN STYLESHEET
   Theme: Blue (#0000FF) | Simple & Balanced
   ═══════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────── */
:root {
  --primary:       #0000FF;
  --primary-dark:  #0000CC;
  --primary-light: #3333FF;
  --primary-subtle:#E8E8FF;

  --sidebar-bg:    #00006B;
  --sidebar-hover: #0000AA;
  --sidebar-active:#0000FF;
  --sidebar-text:  #BFC6E0;
  --sidebar-active-text: #ffffff;
  --sidebar-width: 240px;

  --bg:            #F2F4F9;
  --card:          #FFFFFF;
  --border:        #DDE1EF;
  --text:          #1A1D2E;
  --text-muted:    #6B7280;
  --text-light:    #9CA3AF;

  --success:       #16A34A;
  --success-light: #DCFCE7;
  --danger:        #DC2626;
  --danger-light:  #FEE2E2;
  --warning:       #D97706;
  --warning-light: #FEF3C7;
  --info:          #0284C7;
  --info-light:    #E0F2FE;

  --radius:        8px;
  --radius-lg:     12px;
  --shadow:        0 1px 4px rgba(0,0,0,0.08), 0 2px 12px rgba(0,0,0,0.05);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.10);
  --transition:    all 0.2s ease;
}

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

html { font-size: 15px; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; }

/* ── Layout: Admin Portal ────────────────────────────────── */
.portal-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 1000;
  transition: var(--transition);
}

.sidebar-brand {
  padding: 20px 16px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  min-height: 64px;
}

.sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand .brand-icon svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.sidebar-brand .brand-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sidebar-brand .brand-sub {
  font-size: 0.72rem;
  color: var(--sidebar-text);
  margin-top: 1px;
}

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.nav-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(191,198,224,0.5);
  padding: 16px 16px 4px;
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--sidebar-text);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.sidebar-link.active {
  background: var(--primary);
  color: #fff;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #fff;
  border-radius: 0 2px 2px 0;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.sidebar-link.active svg { opacity: 1; }

.badge-pill {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.sidebar-footer .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-footer .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-footer .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.sidebar-footer .user-role {
  font-size: 0.72rem;
  color: var(--sidebar-text);
}

/* Main content area */
.portal-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top bar */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}

.topbar .page-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

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

.topbar .sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}

/* Page body */
.page-body {
  padding: 24px;
  flex: 1;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h2, .card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: #FAFBFF;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card .stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-card .stat-info .stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.stat-card .stat-info .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Icon backgrounds */
.icon-blue  { background: var(--primary-subtle); color: var(--primary); }
.icon-green { background: var(--success-light);  color: var(--success); }
.icon-red   { background: var(--danger-light);   color: var(--danger);  }
.icon-amber { background: var(--warning-light);  color: var(--warning); }
.icon-info  { background: var(--info-light);     color: var(--info);    }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }

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

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-subtle); }

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

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover { background: #15803D; }

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

.btn-sm { padding: 5px 12px; font-size: 0.82rem; }
.btn-lg { padding: 10px 24px; font-size: 0.95rem; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text);
  background: #fff;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,0,255,0.08);
}

.form-select {
  width: 100%;
  padding: 9px 36px 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text);
  background-color: #fff;
  transition: var(--transition);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,0,255,0.08);
}

textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 4px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead tr {
  background: #F8F9FF;
  border-bottom: 2px solid var(--border);
}

thead th {
  padding: 11px 14px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #FAFAFF; }

tbody td {
  padding: 11px 14px;
  color: var(--text);
  vertical-align: middle;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger);  }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--info-light);    color: var(--info);    }
.badge-primary { background: var(--primary-subtle); color: var(--primary); }
.badge-muted   { background: #F3F4F6; color: var(--text-muted); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-light); border-color: #BBF7D0; color: #14532D; }
.alert-danger  { background: var(--danger-light);  border-color: #FECACA; color: #7F1D1D; }
.alert-warning { background: var(--warning-light); border-color: #FDE68A; color: #78350F; }
.alert-info    { background: var(--info-light);    border-color: #BAE6FD; color: #0C4A6E; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-item {
  display: inline-flex;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.page-link:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary);
}

.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Login Page ──────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #00006B 0%, #0000BB 60%, #1a1aFF 100%);
  padding: 24px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .logo-icon {
  width: 60px;
  height: 60px;
  background: var(--primary);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.login-logo .logo-icon svg {
  width: 32px;
  height: 32px;
  fill: #fff;
}

.login-logo h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.login-logo p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Employee Portal Layout ──────────────────────────────── */
.employee-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.employee-nav {
  background: var(--primary);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.employee-nav .nav-brand {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin-right: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
}

.employee-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  overflow-x: auto;
}

.employee-nav .nav-link {
  padding: 0 14px;
  height: 60px;
  display: flex;
  align-items: center;
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  gap: 6px;
}

.employee-nav .nav-link:hover,
.employee-nav .nav-link.active {
  color: #fff;
  border-bottom-color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.08);
}

.employee-nav .nav-link svg { width: 16px; height: 16px; }

.employee-nav .nav-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 0.875rem;
}

.employee-nav .nav-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  overflow: hidden;
}

.employee-nav .nav-user .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.employee-content {
  padding: 24px;
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ── Dash Grid ───────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}

/* ── QR Scanner ──────────────────────────────────────────── */
.qr-scanner-area {
  position: relative;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 1;
  max-width: 340px;
  margin: 0 auto;
}

.qr-scanner-area video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-frame {
  width: 60%;
  height: 60%;
  border: 3px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
}

/* ── Profile Avatar ──────────────────────────────────────── */
.avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Progress Bar ────────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.6s ease;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-md);
  transform: translateY(20px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal-box { transform: translateY(0); }

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 1rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
}

.modal-close:hover { background: var(--bg); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Status Colors ───────────────────────────────────────── */
.status-present { color: var(--success); }
.status-late    { color: var(--warning); }
.status-absent  { color: var(--danger);  }
.status-pending { color: var(--warning); }
.status-approved{ color: var(--success); }
.status-rejected{ color: var(--danger);  }

/* ── Charts ──────────────────────────────────────────────── */
.chart-wrapper { position: relative; height: 260px; }

/* ── Dividers & Misc ─────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.82rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.mt-4  { margin-top: 4px;  }
.mt-8  { margin-top: 8px;  }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px;  }
.mb-8  { margin-bottom: 8px;  }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-16  { padding: 16px; }
.p-20  { padding: 20px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .sidebar {
    transform: translateX(-240px);
    width: 240px;
  }

  .sidebar.open { transform: translateX(0); }

  .portal-content { margin-left: 0; }

  .topbar .sidebar-toggle { display: flex; }

  .page-body { padding: 16px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }

  .form-row { grid-template-columns: 1fr; }

  .employee-nav .nav-links { display: none; }
  .employee-nav .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    padding: 8px 0;
    z-index: 200;
  }

  .employee-nav .nav-link { height: 48px; }

  .employee-content { padding: 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
}

/* ══════════════════════════════════════════════════
   TOAST NOTIFICATION SYSTEM
   ══════════════════════════════════════════════════ */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 360px;
  width: calc(100vw - 48px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
  border-left: 4px solid var(--primary);
  pointer-events: all;
  animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative;
  overflow: hidden;
}

.toast.toast-exit {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from { transform: translateX(calc(100% + 24px)); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
  from { transform: translateX(0); opacity: 1; max-height: 200px; margin-bottom: 0; }
  to   { transform: translateX(calc(100% + 24px)); opacity: 0; max-height: 0; margin-bottom: -10px; }
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.25;
  border-radius: 0 0 0 var(--radius-lg);
  animation: toast-progress linear forwards;
}

@keyframes toast-progress {
  from { width: 100%; }
  to   { width: 0%; }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 2px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: var(--transition);
  line-height: 1;
}

.toast-close:hover { background: var(--bg); color: var(--text-muted); }
.toast-close svg { width: 14px; height: 14px; display: block; }

/* Type variants */
.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-success .toast-progress { background: var(--success); }

.toast-error { border-left-color: var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-error .toast-progress { background: var(--danger); }

.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-warning .toast-progress { background: var(--warning); }

.toast-info { border-left-color: var(--info); }
.toast-info .toast-icon { color: var(--info); }
.toast-info .toast-progress { background: var(--info); }

@media (max-width: 480px) {
  #toast-container {
    bottom: 16px;
    right: 16px;
    width: calc(100vw - 32px);
  }
}

/* ══════════════════════════════════════════════════
   CUSTOM CONFIRM DIALOG
   ══════════════════════════════════════════════════ */

#confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#confirm-overlay.open {
  opacity: 1;
  visibility: visible;
}

#confirm-dialog {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22);
  transform: scale(0.9) translateY(16px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

#confirm-overlay.open #confirm-dialog {
  transform: scale(1) translateY(0);
}

.confirm-icon-wrap {
  display: flex;
  justify-content: center;
  padding: 28px 28px 0;
}

.confirm-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-icon-circle svg {
  width: 28px;
  height: 28px;
}

.confirm-icon-circle.danger  { background: var(--danger-light);  color: var(--danger);  }
.confirm-icon-circle.warning { background: var(--warning-light); color: var(--warning); }
.confirm-icon-circle.info    { background: var(--info-light);    color: var(--info);    }

.confirm-body {
  padding: 16px 28px 24px;
  text-align: center;
}

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

.confirm-message {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.confirm-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-footer .btn { min-width: 100px; justify-content: center; }

#confirm-btn-confirm.btn-danger  { background: var(--danger);  border-color: var(--danger); }
#confirm-btn-confirm.btn-warning { background: var(--warning); border-color: var(--warning); }
#confirm-btn-confirm.btn-info    { background: var(--info);    border-color: var(--info); }

