/* 1. KHAI BÁO NGUỒN FILE FONT ROBOTO OFFLINE TỪ MÁY CHỦ */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/roboto-regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  src: url('/fonts/roboto-medium.ttf') format('truetype');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  src: url('/fonts/roboto-bold.ttf') format('truetype');
}

:root {
  --primary: #0a2540;
  --primary-light: #163e69;
  --accent-gold: #c68a18;
  --accent-gold-light: #f59e0b;
  --red-gov: #b91c1c;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 10px;
  --radius-sm: 6px;
  --font: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================ */
/* TOP-HEADER: 2 DÒNG ĐỘNG (DÒNG 1 IN HOA, DÒNG 2 CHÚ THÍCH NHỎ) */
/* ============================================================ */
.top-header {
  background: linear-gradient(90deg, #071a30 0%, #0d2847 60%, #153c69 100%);
  color: white;
  border-bottom: 3px solid var(--accent-gold);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.agency-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}

.header-titles {
  display: flex;
  flex-direction: column;
}

/* Dòng 1: In hoa hoàn toàn tên cơ quan */
.header-line-1 {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
  line-height: 1.25;
}

/* Dòng 2: Kích thước nhỏ chữ chú thích bình thường */
.header-line-2 {
  font-size: 0.9rem;
  font-weight: 400;
  color: #cbd5e1;
  text-transform: none;
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.admin-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-quick-admin {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: white;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
}

.btn-quick-admin:hover {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: white;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

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

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.825rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
}

.user-sub {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
}

.btn-profile {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #f1f5f9;
  padding: 0.3rem 0.65rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
}

.btn-profile:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.45);
  color: white;
}

.btn-logout {
  background: transparent;
  border: 1px solid #f87171;
  color: #fca5a5;
  padding: 0.3rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: #b91c1c;
  color: white;
  border-color: #b91c1c;
}

/* ============================================================ */
/* MAIN DASHBOARD: 2 PHÂN HỆ THỂ LOẠI RÕ RỆT */
/* ============================================================ */
.main-body {
  flex: 1;
  padding: 1.75rem 1.5rem 3rem 1.5rem;
}

.dashboard-wrapper {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.admin-banner {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 4px solid var(--accent-gold);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #92400e;
}

.admin-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.banner-badge {
  background: var(--red-gov);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.app-category-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
}

.category-indicator {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.icon-lc { background: linear-gradient(135deg, #0d2847, #1d4ed8); }
.icon-nganh { background: linear-gradient(135deg, #b91c1c, #d97706); }

.category-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.category-line {
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.category-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

/* ============================================================ */
/* CẤU TRÚC KHỐI ỨNG DỤNG TINH GỌN: [BODY] + [GẠCH ĐÁY] + [TRUY CẬP →] */
/* ============================================================ */
.compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.1rem;
}

.compact-app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 0.65rem 1rem;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.compact-app-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 18px -3px rgba(10, 37, 64, 0.1), 0 4px 6px -2px rgba(10, 37, 64, 0.05);
  border-color: #94a3b8;
  background: #ffffff;
}

.compact-app-body {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}

/* Icon ứng dụng */
.compact-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.compact-app-card:hover .compact-app-icon {
  transform: scale(1.08);
}

.app-ico-desktop { background: #e0f2fe; color: #0284c7; }
.app-ico-award { background: #fef3c7; color: #d97706; }
.app-ico-folder { background: #d1fae5; color: #059669; }
.app-ico-check-square { background: #f3e8ff; color: #9333ea; }
.app-ico-globe { background: #e2e8f0; color: #334155; }
.app-ico-mail { background: #ffe4e6; color: #e11d48; }
.app-ico-landmark { background: #fee2e2; color: #b91c1c; }
.app-ico-shield { background: #ffedd5; color: #c2410c; }
.app-ico-bar-chart { background: #ccfbf1; color: #0f766e; }
.app-ico-file-text { background: #ede9fe; color: #6d28d9; }
.app-ico-video { background: #dbeafe; color: #1e40af; }
.app-ico-default { background: #f1f5f9; color: #475569; }

/* Tên ứng dụng nằm ngay bên cạnh */
.compact-app-title {
  flex: 1;
  font-size: 0.935rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Nút bánh răng cấu hình ⚙️ */
.btn-gear-icon {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.95rem;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  z-index: 5;
}

.btn-gear-icon:hover {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: white;
  transform: rotate(45deg);
}

/* Đường viền gạch ngang mảnh nhẹ nhàng, trang nhã ở đáy thẻ */
.compact-app-divider {
  width: 100%;
  height: 1px;
  background-color: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  margin-top: 0.75rem;
  margin-bottom: 0.45rem;
  transition: border-color 0.2s;
}

.compact-app-card:hover .compact-app-divider {
  border-color: #cbd5e1;
}

/* Khu vực chân thẻ chứa dòng chữ Truy cập → nằm gọn gàng, tinh tế sát lề dưới bên phải */
.compact-app-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}

.compact-app-action {
  font-size: 0.785rem;
  font-weight: 600;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.compact-app-card:hover .compact-app-action {
  color: var(--accent-gold);
  transform: translateX(3px);
}

/* ============================================================ */
/* FOOTER */
/* ============================================================ */
.footer-bar {
  background: white;
  border-top: 1px solid var(--border-light);
  padding: 1.25rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.footer-tech code {
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--red-gov);
  font-weight: 600;
}

/* ============================================================ */
/* MODAL COMPONENT STYLES */
/* ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
}

.modal-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
  width: 100%;
}

.modal-sm { max-width: 480px; }
.modal-md { max-width: 640px; }
.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1100px; }
.modal-full { max-width: 1280px; }

.modal-head {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-headline {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

.modal-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #0f172a;
}

.modal-toolbar-row {
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.search-filters {
  display: flex;
  gap: 0.75rem;
  flex: 1;
}

.search-filters input,
.modal-toolbar-row input {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
  flex: 1;
}

.search-filters select {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
}

.modal-body-scroll {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-foot {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.flex-between {
  justify-content: space-between !important;
}

/* ============================================================ */
/* STYLED TABLE & TREE VIEW */
/* ============================================================ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.styled-table th {
  background: #f1f5f9;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  color: #334155;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.styled-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.styled-table tr:hover {
  background: #f8fafc;
}

/* Tree view indentation */
.tree-node-parent {
  font-weight: 700;
  color: var(--primary);
}

.tree-node-child {
  padding-left: 2rem !important;
  color: #334155;
}

.tree-icon-branch {
  color: #94a3b8;
  margin-right: 0.4rem;
}

/* Badges */
.badge-level {
  display: inline-block;
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.badge-provincial {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-regional {
  background: #f3e8ff;
  color: #7e22ce;
}

.badge-perm {
  font-size: 0.675rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: #e2e8f0;
  color: #64748b;
  margin-right: 2px;
}

.badge-perm.active {
  background: #059669;
  color: white;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-success { background: #059669; color: white; }
.btn-success:hover { background: #047857; }
.btn-danger { background: var(--red-gov); color: white; }
.btn-danger:hover { background: #991b1b; }
.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-secondary:hover { background: #cbd5e1; }

.btn-outline-primary {
  background: transparent;
  border-color: var(--primary-light);
  color: var(--primary);
}
.btn-outline-primary:hover { background: #eff6ff; }

.btn-outline-success {
  background: transparent;
  border-color: #059669;
  color: #059669;
}
.btn-outline-success:hover { background: #ecfdf5; }

.btn-outline-danger {
  background: transparent;
  border-color: #fca5a5;
  color: #dc2626;
}
.btn-outline-danger:hover { background: #fef2f2; }

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.btn-reset-pass {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.775rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s;
}

.btn-reset-pass:hover {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
}

/* ============================================================ */
/* FORMS & CONFIG BLOCKS */
/* ============================================================ */
.config-block {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.config-block-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.header-config-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-top: 0.75rem;
}

.logo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 110px;
}

.logo-box img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  background: white;
}

.btn-upload-logo {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-light);
  cursor: pointer;
  text-decoration: underline;
  position: relative;
}

.btn-upload-logo input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.header-inputs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-field {
  margin-bottom: 0.85rem;
}

.form-field label {
  display: block;
  font-size: 0.825rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.35rem;
}

.form-field input[type="text"],
.form-field input[type="password"],
.form-field select {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  outline: none;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(10, 37, 64, 0.1);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.perm-checkbox-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: white;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

/* ============================================================ */
/* GEAR MODAL (BULK UPDATE) */
/* ============================================================ */
.gear-unit-section {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  overflow: hidden;
}

.gear-unit-head {
  background: #e2e8f0;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
}

.gear-officer-grid {
  padding: 0.75rem 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.5rem;
  background: white;
}

.gear-officer-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.825rem;
}

.gear-officer-label:hover {
  background: #f1f5f9;
}

.gear-officer-label input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* ============================================================ */
/* UTILS */
/* ============================================================ */
.d-none { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.8rem; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.mb-3 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.p-0 { padding: 0 !important; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.block-header-flex { display: flex; align-items: center; justify-content: space-between; }
.loading-box { padding: 2rem; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

@media (max-width: 900px) {
  .header-container { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .header-right { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .compact-grid { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .header-config-row { flex-direction: column; }
}

/* ============================================================ */
/* TRANG ĐĂNG NHẬP (LOGIN PAGE COMPONENT) */
/* ============================================================ */
body.login-page {
  font-family: var(--font);
  background: linear-gradient(135deg, #071729 0%, #0d2847 50%, #173860 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: #0f172a;
}

.login-container {
  width: 100%;
  max-width: 530px;
}

.login-card {
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  padding: 36px 75px;
  border-top: 5px solid var(--accent-gold);
}

@media (max-width: 600px) {
  .login-card {
    padding: 30px 20px;
  }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.agency-titles .sub-agency {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--red-gov);
  letter-spacing: 0.75px;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.agency-titles h1 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.agency-titles p {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
}

.login-form .form-group {
  margin-bottom: 1.25rem;
}

.login-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.45rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 0.8rem 0.85rem 0.8rem 2.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
  background: #f8fafc;
}

.input-wrapper input:focus {
  border-color: var(--primary-light);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(22, 62, 105, 0.15);
}

.btn-block {
  width: 100%;
}

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

.security-note {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.5;
}

/* ============================================================ */
/* TOAST NOTIFICATION CONTAINER & MESSAGES */
/* ============================================================ */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast-msg {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
  border-left: 4px solid #10b981;
}

.toast-msg.toast-success {
  background: #064e3b;
  border-left-color: #34d399;
  color: #ecfdf5;
}

.toast-msg.toast-error {
  background: #7f1d1d;
  border-left-color: #f87171;
  color: #fef2f2;
}

.toast-msg.toast-fadeout {
  opacity: 0;
  transform: translateY(-10px);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-15px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


