/* ============================================================
   सार्वजनिक वितरण व्यवस्था ऑनलाईन पोर्टल
   Public Distribution System Online Portal
   Main Stylesheet — style.css (Single CSS for entire portal)
   Designed & Developed by: Shekhar Suradkar, Inspecting Officer
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@300;400;500;600;700&family=Noto+Sans:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
  /* Primary Colors */
  --primary:        #1A6B3C;
  --primary-dark:   #145530;
  --primary-light:  #E8F5EE;
  --secondary:      #2E4057;
  --secondary-dark: #1E2D3E;
  --accent:         #F4A261;
  --accent-dark:    #E08040;

  /* Neutrals */
  --white:          #FFFFFF;
  --bg:             #F4F6F9;
  --bg-card:        #FFFFFF;
  --border:         #DEE2E8;
  --border-light:   #EEF0F4;

  /* Text */
  --text-dark:      #1A1A2E;
  --text-mid:       #4A5568;
  --text-light:     #8A96A8;
  --text-white:     #FFFFFF;

  /* Status Colors */
  --success:        #28A745;
  --warning:        #FFC107;
  --danger:         #DC3545;
  --info:           #17A2B8;

  /* Layout */
  --sidebar-width:  260px;
  --header-height:  70px;
  --footer-height:  60px;
  --border-radius:  8px;
  --border-radius-lg: 12px;
  --shadow:         0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.16);

  /* Font */
  --font:           'Noto Sans Devanagari', 'Noto Sans', sans-serif;
  --transition:     background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: color 0.2s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ============================================================
   LAYOUT
   ============================================================ */

.portal-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-layout {
  display: flex;
  flex: 1;
  padding-top: var(--header-height);
}

.page-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  transition: margin-left 0.3s ease;
}

.page-content.sidebar-collapsed {
  margin-left: 60px;
}

/* ============================================================
   HEADER
   ============================================================ */

.portal-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #2E7D52 100%);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

/* Header Left */
.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.header-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: brightness(1.1);
  flex-shrink: 0;
}

.header-logo-placeholder {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 22px;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.3);
}

.header-title { color: var(--white); }

.header-title .title-mr {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.2px;
}

.header-title .title-en {
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.85;
  line-height: 1.2;
}

/* Header Center — District/Taluka info */
.header-center {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 5px 14px;
  color: var(--white);
  font-size: 0.78rem;
}

.header-center .location-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.header-center .location-divider {
  opacity: 0.4;
  font-size: 1rem;
}

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  overflow: hidden;
}

.lang-btn {
  padding: 4px 12px;
  color: rgba(255,255,255,0.75);
  font-size: 0.75rem;
  font-weight: 500;
  background: transparent;
  border: none;
  transition: var(--transition);
  cursor: pointer;
  font-family: var(--font);
}

.lang-btn.active {
  background: var(--white);
  color: var(--primary);
  font-weight: 700;
}

/* Notification Bell */
.notif-btn {
  position: relative;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
}
.notif-btn:hover { background: rgba(255,255,255,0.25); }

.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.6rem;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* User Info */
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 24px;
  padding: 5px 12px 5px 5px;
  cursor: pointer;
  transition: var(--transition);
}
.user-info:hover { background: rgba(255,255,255,0.22); }

.user-avatar {
  width: 30px; height: 30px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-details { color: var(--white); }
.user-name { font-size: 0.78rem; font-weight: 600; line-height: 1.2; }
.user-role { font-size: 0.65rem; opacity: 0.8; line-height: 1.2; }

/* Logout */
.logout-btn {
  width: 36px; height: 36px;
  background: rgba(220,53,69,0.3);
  border: 1px solid rgba(220,53,69,0.4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
}
.logout-btn:hover { background: var(--danger); }

/* Hamburger */
.hamburger {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  display: none;
  align-items: center; justify-content: center;
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.portal-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--secondary-dark);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 900;
  transition: width 0.3s ease;
  display: flex;
  flex-direction: column;
}

.portal-sidebar.collapsed { width: 60px; }

/* Sidebar User Card */
.sidebar-user {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { color: var(--white); font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: var(--accent); font-size: 0.68rem; white-space: nowrap; }

/* Sidebar Nav */
.sidebar-nav { flex: 1; padding: 10px 0; }

.nav-section-title {
  color: rgba(255,255,255,0.35);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 10px 18px 4px;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  color: rgba(255,255,255,0.65);
  font-size: 0.83rem;
  transition: background 0.2s ease, color 0.2s ease, border-left-color 0.2s ease;
  cursor: pointer;
  border-left: 3px solid transparent;
  white-space: nowrap;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
  border-left-color: var(--primary);
}

.nav-item.active {
  background: rgba(26,107,60,0.25);
  color: var(--white);
  border-left-color: var(--primary);
  font-weight: 600;
}

.nav-item i {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--white);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

/* Sidebar Sub-menu */
.nav-item.has-sub::after {
  content: '\f107';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-left: auto;
  font-size: 11px;
  transition: transform 0.25s;
}
.nav-item.has-sub.open::after { transform: rotate(180deg); }

.nav-submenu {
  display: none;
  background: rgba(0,0,0,0.15);
}
.nav-submenu.open { display: block; }

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 46px;
  color: rgba(255,255,255,0.5);
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.nav-subitem:hover { color: var(--white); background: rgba(255,255,255,0.05); }
.nav-subitem.active { color: var(--accent); font-weight: 600; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
  font-size: 0.68rem;
  text-align: center;
}

/* ============================================================
   FOOTER
   ============================================================ */

.portal-footer {
  background: var(--secondary-dark);
  color: rgba(255,255,255,0.6);
  padding: 12px 24px;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;
  border-top: 3px solid var(--primary);
}

.portal-footer.sidebar-collapsed { margin-left: 60px; }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.footer-copy { font-size: 0.72rem; }
.footer-copy span { color: var(--primary); font-weight: 600; }

.footer-dev { font-size: 0.72rem; text-align: center; }
.footer-dev strong { color: var(--accent); }

.footer-help { font-size: 0.72rem; text-align: right; }
.footer-help a { color: var(--accent); }
.footer-help a:hover { color: var(--white); }

.footer-lastlogin {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  width: 100%;
  text-align: center;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Login Page Footer — full width */
.login-footer {
  margin-left: 0 !important;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 60%, #0D1B2A 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Background pattern */
.login-page::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 30% 40%, rgba(26,107,60,0.25) 0%, transparent 55%),
              radial-gradient(ellipse at 70% 70%, rgba(244,162,97,0.1) 0%, transparent 45%);
  pointer-events: none;
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}

/* Login Card Header */
.login-card-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 28px 32px;
  text-align: center;
  position: relative;
}

.login-logo-wrap {
  width: 68px; height: 68px;
  background: rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 30px;
  color: var(--white);
}

.login-portal-name {
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}

.login-portal-name-en {
  color: rgba(255,255,255,0.75);
  font-size: 0.72rem;
  font-weight: 400;
}

.login-dept {
  margin-top: 10px;
  color: rgba(255,255,255,0.65);
  font-size: 0.7rem;
}

/* Login Card Body */
.login-card-body { padding: 28px 32px; }

.login-card-body h2 {
  font-size: 1.1rem;
  color: var(--text-dark);
  font-weight: 700;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 22px;
}

/* Form Elements */
.form-group { margin-bottom: 16px; }

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

.form-label .required { color: var(--danger); margin-left: 2px; }

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 14px;
  pointer-events: none;
}

.form-control {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  color: var(--text-dark);
  background: var(--white);
  transition: var(--transition);
  outline: none;
  font-family: var(--font);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,107,60,0.1);
}

.form-control.error { border-color: var(--danger); }

.password-toggle {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-light);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.password-toggle:hover { color: var(--primary); }

/* Select with icon */
.form-select {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  color: var(--text-dark);
  background: var(--white);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  font-family: var(--font);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A96A8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,107,60,0.1);
}

/* Captcha */
.captcha-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
}

.captcha-box {
  background: linear-gradient(135deg, var(--primary-light), #D4EDDA);
  border: 1.5px solid var(--primary);
  border-radius: var(--border-radius);
  padding: 8px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--primary-dark);
  user-select: none;
  font-family: 'Courier New', monospace;
  min-width: 110px;
  text-align: center;
}

.captcha-refresh {
  background: none; border: none;
  color: var(--primary);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  padding: 4px;
}
.captcha-refresh:hover { transform: rotate(180deg); color: var(--primary-dark); }

.captcha-input { flex: 1; }

/* Error message */
.form-error {
  font-size: 0.72rem;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}
.form-error.show { display: block; }

/* Login Button */
.btn-login {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  letter-spacing: 0.3px;
}

.btn-login:hover {
  background: linear-gradient(135deg, var(--primary), #2E9E5A);
  box-shadow: 0 4px 16px rgba(26,107,60,0.35);
  transform: translateY(-1px);
}

.btn-login:active { transform: translateY(0); }

/* Login Alert */
.login-alert {
  padding: 10px 14px;
  border-radius: var(--border-radius);
  font-size: 0.78rem;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
}
.login-alert.show { display: flex; }
.login-alert.error { background: #FFF5F5; border: 1px solid #FED7D7; color: var(--danger); }
.login-alert.success { background: #F0FFF4; border: 1px solid #C6F6D5; color: var(--success); }

/* ============================================================
   DASHBOARD CARDS
   ============================================================ */

.page-title {
  margin-bottom: 20px;
}

.page-title h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title h1 i {
  color: var(--primary);
  font-size: 1.1rem;
}

.page-title .breadcrumb {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb-sep { color: var(--border); }

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

.stat-card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger  { border-left-color: var(--danger);  }
.stat-card.info    { border-left-color: var(--info);    }
.stat-card.accent  { border-left-color: var(--accent);  }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--border-radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-card .stat-icon         { background: var(--primary-light); color: var(--primary); }
.stat-card.warning .stat-icon { background: #FFF8E1; color: var(--warning); }
.stat-card.danger .stat-icon  { background: #FFF5F5; color: var(--danger);  }
.stat-card.info .stat-icon    { background: #E8F8FB; color: var(--info);    }
.stat-card.accent .stat-icon  { background: #FFF3E8; color: var(--accent);  }

.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-dark); line-height: 1.1; }
.stat-label { font-size: 0.72rem; color: var(--text-light); margin-top: 2px; }
.stat-sub   { font-size: 0.68rem; color: var(--text-light); margin-top: 4px; }
.stat-up    { color: var(--success); font-size: 0.68rem; }
.stat-down  { color: var(--danger);  font-size: 0.68rem; }

/* ============================================================
   CARDS & PANELS
   ============================================================ */

.card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

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

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i { color: var(--primary); }

.card-actions { display: flex; gap: 8px; }

.card-body { padding: 20px; }
.card-body.p0 { padding: 0; }

/* ============================================================
   TABLES
   ============================================================ */

.table-responsive { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table thead th {
  background: var(--primary);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.78rem;
}

.data-table thead th:first-child { border-radius: 0; }

.data-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

.data-table tbody tr:hover { background: var(--primary-light); }
.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody td {
  padding: 10px 14px;
  color: var(--text-mid);
  vertical-align: middle;
}

.data-table tbody tr:nth-child(even) { background: #FAFBFC; }
.data-table tbody tr:nth-child(even):hover { background: var(--primary-light); }

/* Table Actions */
.table-actions { display: flex; gap: 6px; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--border-radius);
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn-sm   { padding: 5px 10px; font-size: 0.72rem; }
.btn-lg   { padding: 11px 22px; font-size: 0.9rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 6px; }

.btn-primary   { background: var(--primary);   color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: var(--white); }
.btn-success   { background: var(--success);   color: var(--white); }
.btn-warning   { background: var(--warning);   color: var(--text-dark); }
.btn-danger    { background: var(--danger);    color: var(--white); }
.btn-info      { background: var(--info);      color: var(--white); }
.btn-accent    { background: var(--accent);    color: var(--white); }
.btn-outline   { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-light     { background: var(--bg); color: var(--text-mid); }
.btn-light:hover { background: var(--border); }

/* ============================================================
   BADGES & STATUS
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 600;
  gap: 4px;
}

.badge-success  { background: #D4EDDA; color: #155724; }
.badge-warning  { background: #FFF3CD; color: #856404; }
.badge-danger   { background: #F8D7DA; color: #721C24; }
.badge-info     { background: #D1ECF1; color: #0C5460; }
.badge-primary  { background: var(--primary-light); color: var(--primary-dark); }
.badge-secondary{ background: #E9ECEF; color: var(--secondary); }
.badge-defaced  { background: #F8D7DA; color: #721C24; }
.badge-active   { background: #D4EDDA; color: #155724; }
.badge-partial  { background: #FFF3CD; color: #856404; }

/* ============================================================
   FORMS (General)
   ============================================================ */

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

.form-group-full { grid-column: 1 / -1; }

textarea.form-control {
  padding-top: 10px;
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 0.68rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* ============================================================
   ALERTS & NOTIFICATIONS
   ============================================================ */

.alert {
  padding: 12px 16px;
  border-radius: var(--border-radius);
  font-size: 0.82rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert i { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #D4EDDA; border: 1px solid #C3E6CB; color: #155724; }
.alert-warning { background: #FFF3CD; border: 1px solid #FFEEBA; color: #856404; }
.alert-danger  { background: #F8D7DA; border: 1px solid #F5C6CB; color: #721C24; }
.alert-info    { background: #D1ECF1; border: 1px solid #BEE5EB; color: #0C5460; }

/* ============================================================
   MODALS
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

.modal {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-overlay.open .modal { transform: translateY(0); }
.modal-lg { max-width: 760px; }

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: var(--white);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.35); }

.modal-body { padding: 20px; }

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

/* ============================================================
   PERMIT STATUS
   ============================================================ */

.permit-progress {
  background: var(--border-light);
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
  margin: 6px 0;
}

.permit-progress-bar {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.4s ease;
}

/* ============================================================
   BARCODE SCANNER (Transporter)
   ============================================================ */

.scanner-area {
  border: 2.5px dashed var(--primary);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  text-align: center;
  background: var(--primary-light);
  cursor: pointer;
  transition: var(--transition);
}

.scanner-area:hover { border-color: var(--primary-dark); background: #D8EEDE; }

.scanner-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.scanner-text { color: var(--primary-dark); font-weight: 600; font-size: 0.9rem; }
.scanner-sub  { color: var(--text-light); font-size: 0.75rem; margin-top: 4px; }

/* ============================================================
   UTILITIES
   ============================================================ */

.text-center { text-align: center; }
.text-right  { text-align: right;  }
.text-left   { text-align: left;   }

.text-primary   { color: var(--primary);   }
.text-secondary { color: var(--secondary); }
.text-success   { color: var(--success);   }
.text-warning   { color: var(--warning);   }
.text-danger    { color: var(--danger);    }
.text-info      { color: var(--info);      }
.text-muted     { color: var(--text-light);}
.text-accent    { color: var(--accent);    }

.fw-bold   { font-weight: 700; }
.fw-semi   { font-weight: 600; }
.fw-normal { font-weight: 400; }

.mt-1 { margin-top:  6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; }.mb-2 { margin-bottom:12px;} .mb-3 { margin-bottom:20px;}
.ms-auto { margin-left: auto; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap:  6px; } .gap-2 { gap: 12px; } .gap-3 { gap: 20px; }
.flex-wrap { flex-wrap: wrap; }

.hidden  { display: none !important; }
.visible { display: block !important; }

.divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 16px 0;
}

/* Loading Spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   RESPONSIVE — MOBILE & TABLET
   ============================================================ */

@media (max-width: 992px) {
  .portal-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }

  .portal-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }

  .page-content {
    margin-left: 0 !important;
  }

  .portal-footer {
    margin-left: 0 !important;
  }

  .hamburger { display: flex; }

  .header-center { display: none; }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 850;
    display: none;
  }

  .sidebar-overlay.show { display: block; }
}

@media (max-width: 768px) {
  :root { --header-height: 60px; }

  .header-title .title-mr { font-size: 0.85rem; }
  .header-title .title-en { display: none; }

  .user-details { display: none; }

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

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

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-help { text-align: center; }

  .page-content { padding: 16px; }

  .card-body { padding: 14px; }
}

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