/* ── Layout ─────────────────────────────────────────────────── */
body {
  background: #f5f6fa;
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: 230px;
  min-width: 230px;
  background: #fff;
  border-right: 1px solid #eaecf0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
}

.sidebar-brand {
  padding: 20px 24px 16px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #00C4BB;
  letter-spacing: -.3px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-brand img        { height: 30px; width: auto; display: block; flex-shrink: 0; }
.login-brand img          { height: 52px; width: auto; display: block; margin: 0 auto 4px; }
.lp-brand img             { height: 28px; width: auto; display: inline-block; vertical-align: middle; margin-right: 4px; }

.sidebar-section-label {
  padding: 18px 24px 6px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #adb5bd;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 24px;
  color: #444;
  font-size: .88rem;
  font-weight: 500;
  border-radius: 0;
  transition: background .15s, color .15s;
}

.sidebar .nav-link:hover {
  background: #E6F9F8;
  color: #00C4BB;
}

.sidebar .nav-link.active {
  background: #E6F9F8;
  color: #00C4BB;
  font-weight: 600;
}

.sidebar .nav-link .nav-icon {
  width: 18px;
  text-align: center;
  font-size: .95rem;
  color: #00C4BB;
  opacity: .7;
}

.sidebar .nav-link.active .nav-icon,
.sidebar .nav-link:hover .nav-icon {
  opacity: 1;
}

/* ── Main content ────────────────────────────────────────────── */
.main-content {
  margin-left: 230px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top header ─────────────────────────────────────────────── */
.top-header {
  background: #fff;
  border-bottom: 1px solid #eaecf0;
  padding: 0 28px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 999;
}

.top-header .page-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0;
}

.top-header .header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #00C4BB;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}

.notification-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #555;
  cursor: pointer;
  padding: 4px;
}

.notification-btn .badge-dot {
  position: absolute;
  top: 2px; right: 2px;
  width: 8px; height: 8px;
  background: #00C4BB;
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ── Page body ───────────────────────────────────────────────── */
.page-body {
  padding: 24px 28px;
  flex: 1;
}

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-card {
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: none;
  box-shadow: none;
}

.stat-card.pink   { background: #E6F9F8; }
.stat-card.green  { background: #edfaf3; }
.stat-card.blue   { background: #e8f4fd; }
.stat-card.yellow { background: #fdf8ec; }

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-icon.pink   { background: #C0EFED; color: #00C4BB; }
.stat-icon.green  { background: #c8f0da; color: #1db97a; }
.stat-icon.blue   { background: #bde0f7; color: #2196f3; }
.stat-icon.yellow { background: #fde8a0; color: #f4a100; }

.stat-label {
  font-size: .78rem;
  color: #888;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.2;
}

.stat-change {
  font-size: .75rem;
  margin-top: 3px;
}

.stat-change.up   { color: #1db97a; }
.stat-change.down { color: #00C4BB; }

/* ── Content cards ───────────────────────────────────────────── */
.content-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.content-card .card-header {
  background: none;
  border-bottom: 1px solid #f0f0f0;
  padding: 16px 20px;
  font-weight: 600;
  font-size: .92rem;
  color: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.content-card .card-body {
  padding: 20px;
}

/* ── Tables ─────────────────────────────────────────────────── */
.content-card .table {
  font-size: .85rem;
  margin-bottom: 0;
}

.content-card .table th {
  color: #888;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-top: none;
  padding: 10px 16px;
}

.content-card .table td {
  padding: 11px 16px;
  vertical-align: middle;
  color: #333;
  border-color: #f5f5f5;
}

.content-card .table tbody tr:hover {
  background: #fafafa;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  background: #00C4BB;
  border-color: #00C4BB;
}

.btn-primary:hover, .btn-primary:focus {
  background: #009E98;
  border-color: #009E98;
}

.btn-outline-primary {
  color: #00C4BB;
  border-color: #00C4BB;
}

.btn-outline-primary:hover {
  background: #00C4BB;
  border-color: #00C4BB;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge.bg-success  { background: #d4f5e5 !important; color: #1db97a !important; font-weight: 600; }
.badge.bg-danger   { background: #C0EFED !important; color: #00C4BB !important; font-weight: 600; }
.badge.bg-warning  { background: #fdf3d0 !important; color: #f4a100 !important; font-weight: 600; }
.badge.bg-secondary{ background: #eaeaea !important; color: #666    !important; font-weight: 600; }
.badge.bg-primary  { background: #dce9fd !important; color: #2196f3 !important; font-weight: 600; }
.badge.bg-info     { background: #dce9fd !important; color: #2196f3 !important; font-weight: 600; }

/* ── Form controls ───────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
  border-color: #00C4BB;
  box-shadow: 0 0 0 .2rem rgba(0,196,187,.15);
}

.form-check-input:checked {
  background-color: #00C4BB;
  border-color: #00C4BB;
}

/* ── Rounded form elements ───────────────────────────────────── */
.form-control,
.form-select,
.input-group > .form-control,
.input-group > .form-select {
  border-radius: 0.5rem;
}

.form-control-sm,
.form-select-sm {
  border-radius: 0.375rem;
}

.btn {
  border-radius: 0.5rem;
}

.btn-sm {
  border-radius: 0.375rem;
}

.btn-lg {
  border-radius: 0.625rem;
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert-success { background:#edfaf3; border-color:#c8f0da; color:#1a6b45; }
.alert-danger  { background:#E6F9F8; border-color:#C0EFED; color:#8b2a18; }
.alert-info    { background:#e8f4fd; border-color:#bde0f7; color:#135a8a; }
.alert-warning { background:#fdf8ec; border-color:#fde8a0; color:#7a5200; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* ── Loading overlay ─────────────────────────────────────────── */
#page-loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#page-loading-overlay.active {
  display: flex;
}
.loading-spinner-wrap {
  text-align: center;
}
