:root {
  --primary-color: #82d2f3;
  --primary-dark: #4fb3e0;
  --text-dark: #0b3550;
  --bg-soft: #f4f9fc;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-soft);
  color: #2c3e50;
}

/* ---------------- Top Navbar ---------------- */
.topnav {
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 0.65rem 0;
  position: sticky;
  top: 0;
  z-index: 1030;
}
.brand-badge {
  background: var(--primary-color);
  color: var(--text-dark);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
}
.navbar-brand { color: var(--text-dark); font-size: 1.05rem; }
.btn-icon { background: transparent; border: none; font-size: 1.4rem; color: var(--text-dark); }
.btn-user-menu { background: var(--bg-soft); border: 1px solid #e3eef5; border-radius: 30px; padding: 4px 12px; }
.avatar-circle {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-color); color: var(--text-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
}

/* ---------------- App Shell ---------------- */
.app-shell { display: flex; min-height: calc(100vh - 64px); }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid #eef3f6;
  min-height: calc(100vh - 64px);
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  color: #5b7385; text-decoration: none; font-weight: 500;
  margin-bottom: 4px; transition: all .15s ease;
}
.sidebar-link:hover { background: var(--bg-soft); color: var(--text-dark); }
.sidebar-link.active { background: var(--primary-color); color: var(--text-dark); }
.sidebar-link i { font-size: 1.1rem; width: 20px; text-align: center; }

.main-content { flex: 1; padding: 1.75rem; width: 100%; overflow-x: hidden; }

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed; left: -260px; top: 64px; bottom: 0; z-index: 1040;
    transition: left .2s ease; box-shadow: 4px 0 16px rgba(0,0,0,0.08);
  }
  .sidebar.show { left: 0; }
  .main-content { padding: 1.1rem; }
}

/* ---------------- Cards ---------------- */
.card {
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 2px 14px rgba(20,60,90,0.06);
}
.stat-card {
  border-radius: var(--radius);
  padding: 1.3rem;
  background: #fff;
  box-shadow: 0 2px 14px rgba(20,60,90,0.06);
  height: 100%;
}
.stat-card .stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); color: var(--primary-dark); font-size: 1.3rem;
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 700; color: var(--text-dark); }
.stat-card .stat-label { color: #8698a5; font-size: 0.85rem; }

/* ---------------- Buttons ---------------- */
.btn-primary {
  background: var(--primary-color); border-color: var(--primary-color); color: var(--text-dark); font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--primary-dark); border-color: var(--primary-dark); color: #fff;
}
.btn-outline-primary { color: var(--primary-dark); border-color: var(--primary-color); }
.btn-outline-primary:hover { background: var(--primary-color); border-color: var(--primary-color); color: var(--text-dark); }

/* ---------------- Auth Pages ---------------- */
.auth-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eaf7fd 0%, #ffffff 100%);
  padding: 1.5rem;
}
.auth-card {
  max-width: 420px; width: 100%; background: #fff; border-radius: 18px;
  box-shadow: 0 10px 40px rgba(20,60,90,0.12); padding: 2.4rem;
}
.auth-logo { text-align: center; margin-bottom: 1.4rem; }
.auth-logo .brand-badge { font-size: 1.1rem; padding: 8px 16px; }

/* ---------------- Tables ---------------- */
.table-modern thead th {
  border: none; color: #8698a5; font-weight: 600; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: .04em;
  background: var(--bg-soft);
}
.table-modern td { vertical-align: middle; border-color: #f1f5f8; }
.table-modern tbody tr:hover { background: #fbfdff; }

.badge-status-active { background: #e6f9ee; color: #1c8f52; }
.badge-status-disabled { background: #fdeaea; color: #c0392b; }
.badge-status-pending { background: #fff6e0; color: #b5850b; }
.badge-status-approved { background: #e6f9ee; color: #1c8f52; }

/* ---------------- Misc ---------------- */
.short-url-box {
  background: var(--bg-soft); border-radius: 10px; padding: 10px 14px;
  font-family: monospace; font-size: 0.92rem; word-break: break-all;
}
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; }
.page-header h2 { color: var(--text-dark); font-weight: 700; margin: 0; }
.qr-thumb { width: 42px; height: 42px; border-radius: 6px; border: 1px solid #eef3f6; cursor: pointer; }

.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; background: linear-gradient(135deg, #eaf7fd 0%, #ffffff 100%); padding: 2rem; }
.error-page .code { font-size: 6rem; font-weight: 800; color: var(--primary-color); line-height: 1; }
