/* ==========================================================================
   2000s CLASSIC RETRO VIETNAMESE GOVERNMENT PORTAL STYLESHEET (ASP.NET STYLE)
   ========================================================================== */

:root {
  --gov-teal-dark: #116879;
  --gov-teal-main: #155b6a;
  --gov-blue-title: #0b4d75;
  --gov-green-legend: #008000;
  --bg-page: #f2f5f8;
  --bg-card: #ffffff;
  --border-silver: #a6c0d7;
  --border-dark: #7a94ad;
  --text-main: #111111;
  --text-muted: #444444;
}

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

body {
  font-family: Arial, Tahoma, Verdana, sans-serif;
  font-size: 13px;
  color: var(--text-main);
  background-color: var(--bg-page);
  line-height: 1.4;
}

/* TOP CONTAINER & BANNER */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #99b0c6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-gov-banner {
  background: #ffffff;
  border-bottom: 2px solid #116879;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.gov-logo-title {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.national-emblem-img {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.gov-agency-name {
  font-size: 0.75rem;
  font-weight: bold;
  color: #555555;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.gov-system-title {
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--gov-blue-title);
  margin-top: 3px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gov-header-info {
  text-align: right;
  font-size: 0.8rem;
  color: #333;
  flex-shrink: 0;
}

.gov-hotline {
  color: #c00000;
  font-weight: bold;
}

.gov-date-time {
  margin-top: 4px;
  color: #555;
}

/* PRIMARY NAVBAR (DARK CYAN / TEAL 2000s BAR) */
.main-nav-bar {
  background: var(--gov-teal-dark);
  border-top: 1px solid #238497;
  border-bottom: 2px solid #0b4550;
  display: flex;
  padding: 0 10px;
}

.main-nav-bar .nav-link,
.main-nav-bar .dropdown-toggle {
  color: #ffffff;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: bold;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-right: 1px solid #1c7c8f;
}

.main-nav-bar .nav-link:hover,
.main-nav-bar .dropdown-toggle:hover,
.main-nav-bar .nav-link.active {
  background: #0d4e5b;
}

.nav-dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 1px solid #7a94ad;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
  z-index: 1000;
  min-width: 210px;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #222;
  font-size: 0.82rem;
  text-decoration: none;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.dropdown-item:hover {
  background: #eaf2f8;
  color: var(--gov-blue-title);
  font-weight: bold;
}

/* RETRO SHEET TAB SWITCHER BAR */
.to-tab-bar {
  background: #e4ecf3;
  border-bottom: 1px solid #b0c4de;
  padding: 6px 14px 0 14px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.retro-tab {
  background: #d4e2ee;
  border: 1px solid #9bb4cb;
  border-bottom: none;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  border-radius: 3px 3px 0 0;
}

.retro-tab:hover {
  background: #eaf1f7;
}

.retro-tab.active {
  background: #ffffff;
  border-color: #9bb4cb #9bb4cb #ffffff #9bb4cb;
  color: var(--gov-blue-title);
}

.btn-add-tab-retro {
  background: linear-gradient(#f4f4f4, #e0e0e0);
  border: 1px solid #888;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: bold;
  color: #222;
  cursor: pointer;
  border-radius: 2px;
  margin-left: auto;
  margin-bottom: 4px;
}

.btn-add-tab-retro:hover {
  background: #e8e8e8;
}

/* CONTENT BODY */
.content-body {
  padding: 16px;
  flex: 1;
}

/* FIELDSET & LEGEND RETRO COMPONENT */
fieldset.gov-fieldset {
  border: 1px solid var(--border-silver);
  background: #ffffff;
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 2px;
}

legend.gov-legend {
  color: var(--gov-green-legend);
  font-size: 0.92rem;
  font-weight: bold;
  padding: 0 8px;
}

legend.gov-legend-blue {
  color: var(--gov-blue-title);
  font-size: 0.92rem;
  font-weight: bold;
  padding: 0 8px;
}

/* FORM CONTROLS & GRID */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  font-size: 0.82rem;
  font-weight: bold;
  color: #333;
}

.form-input,
.form-select,
.form-textarea {
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  padding: 5px 8px;
  border: 1px solid #999999;
  border-radius: 1px;
  background: #ffffff;
  color: #111;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gov-blue-title);
  background: #f7fafc;
  outline: none;
}

/* RETRO BUTTONS (2000s BEVEL BUTTON STYLE) */
.btn-retro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: bold;
  padding: 5px 14px;
  color: #111111;
  background: linear-gradient(#f6f6f6, #dcdcdc);
  border: 1px solid #777777;
  border-radius: 2px;
  cursor: pointer;
}

.btn-retro:hover {
  background: linear-gradient(#ffffff, #e4e4e4);
}

.btn-retro:active {
  background: #d0d0d0;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.btn-retro-blue {
  background: linear-gradient(#20638b, #0c4366);
  border-color: #082d45;
  color: #ffffff;
}

.btn-retro-blue:hover {
  background: linear-gradient(#2877a7, #10527c);
}

.btn-retro-green {
  background: linear-gradient(#2e8b57, #1c633d);
  border-color: #12452a;
  color: #ffffff;
}

.btn-retro-green:hover {
  background: linear-gradient(#37a366, #22794a);
}

.btn-retro-red {
  background: linear-gradient(#c0392b, #962d22);
  border-color: #732219;
  color: #ffffff;
}

.btn-retro-red:hover {
  background: linear-gradient(#d94334, #aa3327);
}

.btn-retro-gray {
  background: linear-gradient(#f0f0f0, #d5d5d5);
  border-color: #777777;
  color: #222222;
}

/* STEP WIZARD BAR */
.step-wizard-bar {
  display: flex;
  background: #eef4f8;
  border: 1px solid #a6c0d7;
  margin-bottom: 16px;
  border-radius: 2px;
}

.wizard-step-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  font-size: 0.82rem;
  font-weight: bold;
  color: #666;
  border-right: 1px solid #a6c0d7;
}

.wizard-step-item:last-child {
  border-right: none;
}

.wizard-step-item.active {
  background: #ffffff;
  color: var(--gov-blue-title);
  border-bottom: 3px solid var(--gov-blue-title);
}

.wizard-step-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #aaa;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
}

.wizard-step-item.active .wizard-step-number {
  background: var(--gov-blue-title);
}

.wizard-step-panel {
  display: none;
}

.wizard-step-panel.active {
  display: block;
}

/* MODAL OVERLAY & DIALOG */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.success-modal-box {
  background: #ffffff;
  border: 2px solid var(--gov-teal-dark);
  padding: 24px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  border-radius: 3px;
}

.success-checkmark-circle {
  width: 56px;
  height: 56px;
  background: #27ae60;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 14px auto;
}

.success-modal-title {
  color: var(--gov-blue-title);
  font-size: 1.15rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.success-modal-msg {
  font-size: 0.85rem;
  color: #444;
  margin-bottom: 18px;
}

/* FOOTER */
.gov-footer {
  background: #0d4e5b;
  color: #ffffff;
  text-align: center;
  padding: 10px;
  font-size: 0.78rem;
  border-top: 2px solid #08333c;
  margin-top: auto;
}

/* TOAST MESSAGES (RETRO GOVERNMENT NOTIFICATION BANNER) */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: 90%;
}

.toast-retro {
  background: #ffffff;
  border: 1px solid #7a94ad;
  border-radius: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: all 0.25s ease;
}

.toast-retro.fade-out {
  opacity: 0;
  transform: translateX(60px);
}

.toast-retro-header {
  background: linear-gradient(#116879, #0d4e5b);
  color: #ffffff;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #0a3d47;
}

.toast-retro.success .toast-retro-header {
  background: linear-gradient(#1f7a46, #14542f);
}

.toast-retro.error .toast-retro-header {
  background: linear-gradient(#b82e22, #872118);
}

.toast-retro.info .toast-retro-header {
  background: linear-gradient(#196291, #0f4365);
}

.toast-retro-close {
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.85;
}

.toast-retro-close:hover {
  opacity: 1;
}

.toast-retro-body {
  padding: 10px 14px;
  font-size: 0.83rem;
  color: #111111;
  line-height: 1.45;
  background: #ffffff;
  font-family: Arial, sans-serif;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(80px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* GLOBAL RETRO LOADING OVERLAY (MATCHING PORTAL LAYOUT) */
.global-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(242, 245, 248, 0.94);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-panel-retro {
  background: #ffffff;
  border: 1px solid #99b0c6;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  border-radius: 3px;
  max-width: 520px;
  width: 90%;
  overflow: hidden;
}

.loading-panel-header {
  background: linear-gradient(#116879, #0d4e5b);
  color: #ffffff;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #08333c;
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading-panel-body {
  padding: 26px 32px;
  text-align: center;
  background: #ffffff;
}

.loading-emblem-img {
  width: 60px;
  height: 60px;
  margin-bottom: 10px;
  animation: emblemPulse 2s infinite ease-in-out;
}

.loading-title {
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--gov-blue-title);
  text-transform: uppercase;
  margin-bottom: 3px;
}

.loading-subtitle {
  font-size: 0.78rem;
  color: var(--gov-teal-dark);
  font-weight: bold;
  margin-bottom: 16px;
}

.loading-spinner-container {
  margin: 18px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* PURE CSS CONTINUOUS ROTATING SPINNER */
.custom-retro-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #d4e2ee;
  border-top: 4px solid #116879;
  border-right: 4px solid #116879;
  border-radius: 50%;
  animation: spinRetroContinuous 0.75s linear infinite !important;
  margin: 6px auto;
}

@keyframes spinRetroContinuous {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-status-text {
  font-size: 0.86rem;
  font-weight: bold;
  color: #111111;
  margin-bottom: 14px;
  min-height: 24px;
}

.loading-progress-bar-outer {
  width: 100%;
  height: 10px;
  background: linear-gradient(#f6f6f6, #dcdcdc);
  border: 1px solid #777777;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}

.loading-progress-bar-inner {
  width: 30%;
  height: 100%;
  background: linear-gradient(#27ae60, #1b6d3c);
  border-radius: 1px;
  transition: width 0.3s ease;
}

@keyframes emblemPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

