/* =========================================================
   FORTRESSLINK NETWORK PORTAL - GLOBAL STYLESHEET
   ========================================================= */

:root {
  --blue: #0b5ed7;
  --blue-dark: #084298;
  --dark: #10233f;
  --dark-2: #0a1729;
  --light: #f4f7fb;
  --surface: #ffffff;
  --border: #e3e8ef;
  --text: #1f2937;
  --muted: #64748b;
  --green: #198754;
  --red: #dc3545;
  --amber: #b45309;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(15, 35, 63, .08);
  --shadow-lg: 0 14px 40px rgba(15, 35, 63, .16);
}

/* =========================================================
   BASE
   ========================================================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background: var(--light);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-left: 18px;
  padding-right: 18px;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn,
.small-btn,
button {
  font-family: inherit;
  border: 0;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease,
              background .15s ease, opacity .15s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--blue), #1467e0);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
  box-shadow: 0 6px 16px rgba(11, 94, 215, .25);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(11, 94, 215, .32);
}

.btn:active {
  transform: translateY(0);
}

.btn.outline {
  background: rgba(255, 255, 255, .08);
  border: 2px solid rgba(255, 255, 255, .75);
  box-shadow: none;
}

.btn.outline:hover {
  background: #fff;
  color: var(--dark);
}

.btn.full {
  width: 100%;
}

.small-btn {
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.small-btn:hover {
  opacity: .88;
}

.small-btn.warning {
  background: var(--amber);
}

.small-btn.danger {
  background: var(--red);
}

/* =========================================================
   PUBLIC LANDING PAGE
   ========================================================= */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.14), transparent 28%),
    linear-gradient(135deg, #0b5ed7, #10233f);
  color: #fff;
  padding: clamp(55px, 9vw, 110px) 0;
  text-align: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -55% auto;
  width: 440px;
  height: 440px;
  background: rgba(255,255,255,.07);
  border-radius: 50%;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.7rem, 4.5vw, 3rem);
  line-height: 1.15;
}

.hero p {
  max-width: 700px;
  margin: 0 auto 26px;
  font-size: clamp(.98rem, 2vw, 1.12rem);
  color: rgba(255,255,255,.88);
}

.buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.services {
  padding: clamp(38px, 6vw, 75px) 0;
}

.section-head {
  text-align: center;
  margin-bottom: 26px;
}

.section-head h2 {
  margin: 0 0 8px;
  color: var(--dark);
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

/* =========================================================
   DASHBOARD LAYOUT
   ========================================================= */

.layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.main-area {
  flex: 1;
  width: 100%;
  margin-left: 260px;
  min-width: 0;
  transition: margin-left .28s ease;
}

.dashboard-content {
  padding: 26px 0 50px;
}

.page-title {
  color: var(--dark);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  margin: 0 0 8px;
  line-height: 1.25;
}

.page-subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: .95rem;
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #10233f, #0a1729);
  color: #fff;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 90;
  transform: translateX(0);
  transition: transform .28s ease;
  box-shadow: 4px 0 24px rgba(0, 0, 0, .18);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: .98rem;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.sidebar-brand span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--blue);
  border-radius: 10px;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-user {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  padding: 12px;
}

.sidebar-user strong {
  display: block;
  font-size: .9rem;
  line-height: 1.3;
  word-break: break-word;
}

.sidebar-user small {
  color: rgba(255, 255, 255, .7);
  font-size: .76rem;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
  padding: 12px 13px;
  border-radius: 10px;
  font-size: .92rem;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}

.sidebar-links a:hover,
.sidebar-links a.active {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.sidebar-links a span:first-child {
  font-size: 1.05rem;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding-top: 14px;
}

.logout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffb4b4 !important;
  text-decoration: none;
  padding: 12px 13px;
  border-radius: 10px;
  font-weight: 700;
  transition: background .15s ease;
}

.logout-link:hover {
  background: rgba(220, 53, 69, .18);
  color: #fff !important;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(10, 23, 41, .6);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* =========================================================
   MOBILE TOPBAR
   ========================================================= */

.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(16, 35, 63, .97);
  color: #fff;
  padding: 10px 14px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 1.25rem;
  border: 1px solid rgba(255, 255, 255, .2);
  flex-shrink: 0;
}

.mobile-title {
  font-weight: 700;
  font-size: .93rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================================
   CARDS AND STATISTICS
   ========================================================= */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card h3 {
  margin: 0 0 10px;
  color: var(--dark);
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 130px;
}

.stat-card h3 {
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card p {
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 800;
  color: var(--dark);
  margin: 0;
}

.stat-card.blue { border-top: 4px solid var(--blue); }
.stat-card.green { border-top: 4px solid var(--green); }
.stat-card.amber { border-top: 4px solid var(--amber); }
.stat-card.red { border-top: 4px solid var(--red); }

/* =========================================================
   FORMS
   ========================================================= */

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.12), transparent 30%),
    linear-gradient(135deg, #0b5ed7, #10233f);
}

.auth-card {
  background: #fff;
  padding: clamp(22px, 5vw, 36px);
  border-radius: 18px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  text-align: center;
  color: var(--dark);
  margin: 0 0 6px;
  font-size: 1.5rem;
}

.auth-card .small {
  margin-top: 14px;
}

form label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 700;
  font-size: .88rem;
}

input,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  margin-bottom: 6px;
  background: #fbfdff;
  font-size: .95rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus,
select:focus {
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(11, 94, 215, .14);
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  align-items: end;
}

.admin-form .btn {
  width: 100%;
  margin-top: 4px;
}

/* =========================================================
   TABLES
   ========================================================= */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  min-width: 640px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #eef4ff;
  color: var(--dark);
  font-size: .73rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

tbody tr:hover {
  background: #f8fbff;
}

td form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

td input[type="number"] {
  width: 110px;
  margin: 0;
  padding: 7px 9px;
  font-size: .82rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* =========================================================
   BADGES AND ALERTS
   ========================================================= */

.badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.badge.confirmed {
  background: #d1e7dd;
  color: var(--green);
}

.badge.pending {
  background: #fff3cd;
  color: var(--amber);
}

.badge.rejected,
.badge.disabled {
  background: #f8d7da;
  color: var(--red);
}

.alert {
  padding: 12px 15px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: .9rem;
  border-left: 5px solid transparent;
}

.alert.success {
  background: #d1e7dd;
  color: #0f5132;
  border-color: var(--green);
}

.alert.danger {
  background: #f8d7da;
  color: #842029;
  border-color: var(--red);
}

.alert.warning {
  background: #fff3cd;
  color: #664d03;
  border-color: var(--amber);
}

.alert.info {
  background: #cfe2ff;
  color: #084298;
  border-color: var(--blue);
}

/* =========================================================
   UTILITIES
   ========================================================= */

.small {
  font-size: .86rem;
  text-align: center;
  color: var(--muted);
}

.success {
  color: var(--green);
  font-weight: 700;
}

.empty-state {
  padding: 26px;
  text-align: center;
  color: var(--muted);
}

footer {
  background: var(--dark-2);
  color: #fff;
  text-align: center;
  padding: 24px 18px;
  margin-top: 30px;
}

footer p {
  margin: 0;
  color: rgba(255,255,255,.8);
  font-size: .88rem;
}

/* =========================================================
   PROFILE MODAL
   ========================================================= */

.profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 1.15rem;
  border: 1px solid rgba(255, 255, 255, .25);
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.profile-btn:hover {
  background: rgba(255, 255, 255, .25);
  transform: scale(1.05);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 23, 41, .65);
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: #fff;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 0;
  color: var(--dark);
  font-size: 1.2rem;
}

.close-modal {
  background: #eef2f7;
  color: var(--dark);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.close-modal:hover {
  background: #dde5ee;
}

.profile-details {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.profile-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .9rem;
}

.profile-item span:first-child {
  font-weight: 700;
  color: var(--dark);
}

.profile-item span:last-child {
  text-align: right;
  color: var(--muted);
  word-break: break-word;
}

.modal h3 {
  margin: 0 0 10px;
  color: var(--dark);
  font-size: 1rem;
}

/* =========================================================
   RESPONSIVE - TABLETS AND PHONES
   ========================================================= */

@media (max-width: 992px) {
  .sidebar {
    width: 280px;
    max-width: 85%;
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-area {
    margin-left: 0;
    width: 100%;
  }

  .mobile-topbar {
    display: flex;
  }

  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .dashboard-content {
    padding-top: 18px;
  }

  .page-title {
    font-size: 1.3rem;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card {
    padding: 18px;
    margin-bottom: 16px;
  }

  .stat-card {
    min-height: auto;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions form,
  .actions .small-btn {
    width: 100%;
  }

  td input[type="number"] {
    width: 100%;
  }

  .modal {
    padding: 20px;
  }

  .profile-item {
    flex-direction: column;
    gap: 3px;
  }

  .profile-item span:last-child {
    text-align: left;
  }
}

@media (max-width: 420px) {
  .sidebar {
    width: 88%;
  }

  .mobile-title {
    font-size: .86rem;
  }

  .page-title {
    font-size: 1.2rem;
  }

  .card {
    padding: 16px;
  }

  .hero {
    padding: 50px 0;
  }
}