* {
  box-sizing: border-box;
}

body {
  --alta-navy: #0F2744;
  --alta-ocean: #114B7A;
  --alta-turquoise: #00A6A6;
  --alta-bg: #F5F7FA;
  --alta-card: #FFFFFF;
  --alta-text: #132238;
  --alta-muted: #667085;
  --alta-border: #E5E7EB;
  --alta-soft: #EAF4F8;
  --alta-shadow: 0 14px 34px rgba(15, 39, 68, 0.08);
  --theme-main: var(--alta-ocean);
  --theme-dark: var(--alta-navy);
  --theme-soft: #D7E9F7;
  --theme-card-border: var(--alta-border);
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--alta-bg);
  color: var(--alta-text);
}

.auth-page,
.app-page {
  min-height: 100vh;
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card,
.welcome-card,
.white-card,
.module-card,
.card {
  background: var(--alta-card);
  border: 1px solid var(--alta-border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--alta-shadow);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 28px;
  box-shadow: 0 18px 48px rgba(15, 39, 68, 0.16);
}

.brand-block {
  margin-bottom: 24px;
  text-align: center;
}

.brand-block h1 {
  margin: 0 0 8px;
  font-size: 28px;
  color: var(--theme-main);
}

.brand-block p,
.welcome-card p,
.module-card p {
  margin: 0;
  color: var(--alta-muted);
}

.form-card,
.form-group {
  display: flex;
  flex-direction: column;
}

.form-card {
  gap: 16px;
}

.form-group {
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 700;
  color: #344054;
}

.form-group input,
.form-group select,
.form-group textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #D0D5DD;
  background: #FFFFFF;
  color: var(--alta-text);
  outline: none;
  font: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
select:focus {
  border-color: var(--alta-turquoise);
  box-shadow: 0 0 0 3px rgba(0, 166, 166, 0.14);
}

.btn {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  display: inline-flex;
  justify-content: center;
  min-height: 40px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--alta-ocean);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--alta-navy);
}

.btn-secondary {
  background: #EEF3F8;
  border-color: #DCE5EE;
  color: var(--alta-ocean);
}

.btn-secondary:hover {
  background: #E4F6F6;
  border-color: rgba(0, 166, 166, 0.45);
  color: var(--alta-navy);
}

.btn-success {
  background: #16A34A;
  color: #FFFFFF;
}

.btn-danger {
  background: #DC2626;
  color: #FFFFFF;
}

.error-text {
  min-height: 18px;
  color: #DC2626;
  font-size: 14px;
  margin: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  background: var(--alta-navy);
  box-shadow: 0 14px 36px rgba(15, 39, 68, 0.18);
  flex-wrap: wrap;
}

.topbar-left {
  min-width: 220px;
}

.app-title {
  margin: 0;
  font-size: 22px;
  color: #FFFFFF;
}

.app-subtitle {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.topbar-right {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-department-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.topbar-label {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}

.topbar-select {
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.96);
  color: var(--alta-text);
  font-weight: 700;
}

.user-box {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 10px 14px;
  border-radius: 10px;
  color: #FFFFFF;
  min-height: 42px;
  display: flex;
  align-items: center;
}

.topbar .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

.topbar .btn-secondary:hover {
  background: rgba(0, 166, 166, 0.32);
  border-color: rgba(0, 166, 166, 0.72);
}

.main-content {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.home-content {
  max-width: 1280px;
}

.welcome-card {
  margin-bottom: 24px;
}

.welcome-card h2,
.module-card h3 {
  margin-top: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.home-module-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  align-items: stretch;
}

.module-card {
  display: flex;
  min-height: 142px;
  flex-direction: column;
  justify-content: flex-start;
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 166, 166, 0.42);
  box-shadow: 0 14px 30px rgba(15, 39, 68, 0.11);
}

.module-card h3 {
  min-height: 48px;
  margin-bottom: 10px;
  color: var(--alta-ocean);
  line-height: 1.2;
}

.module-subtitle {
  min-height: 0 !important;
  margin: -4px 0 10px !important;
  color: var(--alta-text) !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.module-card p {
  min-height: 0;
  margin-bottom: 0;
  line-height: 1.45;
}

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

.page-actions-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.page-actions {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.page-actions h2,
.page-actions h3 {
  color: var(--alta-text);
  margin-top: 0;
}

.card {
  margin-bottom: 18px;
}

.filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  align-items: end;
}

.filter-actions {
  justify-content: end;
}

.table-wrap,
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--alta-border);
  border-radius: 12px;
  background: #FFFFFF;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #EEF2F7;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #F8FAFC;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table tbody tr:nth-child(even) td {
  background: #FCFDFE;
}

.data-table tbody tr:hover td,
.selectable-table tbody tr.is-selected td {
  background: #EDF7F8;
}

.data-table td.numeric,
.data-table th.numeric {
  text-align: right;
}

.btn-sm {
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.page-feedback {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #B8E7E7;
  background: #EFFBFB;
  color: #0F5F68;
}

.page-feedback.error {
  border-color: #FECDCA;
  background: #FEF3F2;
  color: #B42318;
}

.page-feedback.success {
  border-color: #ABEFC6;
  background: #ECFDF3;
  color: #067647;
}

.page-feedback.warning {
  border-color: #FEDF89;
  background: #FFFAEB;
  color: #B54708;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.45);
}

.modal-card {
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #FFFFFF;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.modal-large {
  width: min(980px, 100%);
}

.modal-xl {
  width: min(1180px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0 0 4px;
}

.modal-header p {
  margin: 0;
  color: var(--alta-muted);
}

.quick-f9-input {
  width: 230px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #D0D5DD;
  border-radius: 8px;
  font: inherit;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .topbar {
    align-items: stretch;
  }

  .topbar-right {
    width: 100%;
    align-items: stretch;
  }

  .topbar-department-box {
    width: 100%;
  }

  .topbar-select {
    width: 100%;
    min-width: 0;
  }

  .page-actions,
  .page-actions-right {
    width: 100%;
    align-items: stretch;
  }

  .quick-f9-input {
    width: 100%;
  }
}
