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

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.mt-10    { margin-top: 10px; }
.mt-20    { margin-top: 20px; }
.error-msg   { color: #e53e3e; font-size: 14px; padding: 8px 0; }
.success-msg { color: #38a169; font-size: 14px; padding: 8px 0; }

/* ─── Login Page ─────────────────────────────────────────────────────────── */
#page-login,
#page-set-password {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a56db 0%, #0d3380 100%);
}

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

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

.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: #1a56db;
}

.login-logo p {
  font-size: 14px;
  color: #666;
  margin-top: 4px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}

.form-group input,
.inline-form input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 15px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.inline-form input:focus {
  outline: none;
  border-color: #1a56db;
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.inline-form input {
  flex: 1;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 12px;
  background: #1a56db;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.btn-primary:hover { background: #1446b8; }

.inline-form .btn-primary {
  width: auto;
  white-space: nowrap;
  margin-top: 0;
}

.btn-secondary {
  padding: 8px 16px;
  background: #fff;
  color: #1a56db;
  border: 1px solid #1a56db;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #1a56db;
  color: #fff;
}

.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 8px;
  width: 100%;
  transition: background 0.2s;
}

.btn-logout:hover { background: rgba(255,255,255,0.1); }

/* ─── Dashboard Layout ───────────────────────────────────────────────────── */
#page-dashboard {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
}

.sidebar-logo {
  padding: 24px 20px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.nav-item {
  display: block;
  padding: 12px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.nav-item.active {
  background: rgba(26,86,219,0.3);
  color: #fff;
  border-left-color: #1a56db;
}

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

#user-email {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
  word-break: break-all;
}

/* ─── Main Content ───────────────────────────────────────────────────────── */
.main-content {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.dashboard-header {
  background: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}

.dashboard-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
}

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

.header-right label {
  font-size: 14px;
  font-weight: 600;
  color: #555;
}

#client-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

/* ─── Content Sections ───────────────────────────────────────────────────── */
.content-section {
  padding: 24px;
  flex: 1;
}

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

.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.card-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.card-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-value {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin-top: 4px;
}

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

.badge-green  { background: #d1fae5; color: #065f46; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-gray   { background: #f3f4f6; color: #374151; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 8px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f8f9fa;
  color: #555;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid #e5e7eb;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  vertical-align: top;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8f9ff; }

.no-data {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 14px;
}

/* ─── Loading spinner ────────────────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 40px;
  color: #999;
  font-s
