:root {
  --primary: #005689;
  --primary-dark: #032d4b;
  --accent-orange: #ff6600;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-body: #f1f5f9;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
}

/* LOGIN VIEW STYLES */
#loginView {
  min-height: 100vh;
  background: linear-gradient(to bottom right, #0f172a, #032d4b, #030712);
}

.glass-card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
}

/* DASHBOARD VIEW STYLES */
.sidebar {
  width: 260px;
  background: var(--primary-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;            /* start at the very top, not below the phone's top bar */
  left: 0;
  height: 100vh;
  height: 100dvh;    /* real visible height on phones (excludes the browser address bar) */
  overflow-y: auto;  /* if the screen is short, the menu scrolls so Logout is always reachable */
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand i {
  font-size: 1.8rem;
  color: var(--accent-orange);
}

.sidebar-brand span {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  list-style: none;
  padding: 1rem 0;
  flex-grow: 1;
  overflow-y: auto;
}

.menu-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.85rem 1.5rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
}

.menu-item.active a, .menu-item a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-left: 4px solid var(--accent-orange);
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content Wrapper */
.main-wrapper {
  margin-left: 260px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-header {
  background: var(--card-bg);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.dashboard-container {
  padding: 1.5rem;
}

.welcome-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow);
}

@media (min-width: 640px) {
  .welcome-banner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
  }
}

.status-badge {
  background: var(--success);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
  margin-top: 6px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.icon-blue { background: rgba(0, 86, 137, 0.1); color: var(--primary); }
.icon-orange { background: rgba(255, 102, 0, 0.1); color: var(--accent-orange); }
.icon-green { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.icon-purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.card-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.5s ease-in-out;
  border-radius: 4px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 992px) {
  .grid-2 {
    grid-template-columns: 2fr 1fr;
  }
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

.data-table th, .data-table td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
}

.badge-paid {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.btn-orange { background: var(--accent-orange); color: #fff; }
.btn-orange:hover { background: #e65c00; }

.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.content-section {
  display: none;
}

.content-section.active-section {
  display: block;
}

/* Mobile Responsive Drawer Overlay */
@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .dashboard-container {
    padding: 1rem;
  }
}