/* Full-height layout to pin footer at bottom */
html, body {
  height: 100%;
  margin: 0;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  flex: 1; /* pushes footer down */
  padding: 20px;
}

.footer {
  background-color: #4B1C63;
  color: #fff;
  text-align: center;
  padding: 10px;
  font-size: 0.9em;
}


/* Base */
html, body {
  margin: 0;
  padding: 0;
}
body {
  font-family: Arial, sans-serif;
  background: #f7f7fb;
  color: #333;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* Top Navigation */
.topnav {
  display: flex;
  align-items: center;
  background: #4b1e63;
  color: #fff;
  padding: 10px 20px;
}
.topnav .brand {
  margin-right: auto;
}
/* Brand link styled like a button */
.topnav .brand a {
  background: #5d2a82; /* dark lavender */
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
}
.topnav .brand a:hover {
  background: #7739a6; /* lighter lavender on hover */
  color: #fff;
}

/* Primary menu (supports either <ul class="menu"> or plain <ul>) */
.topnav ul.menu,
.topnav > ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}
.topnav ul.menu li,
.topnav > ul li {
  position: relative;
}
.topnav ul.menu li a,
.topnav > ul li a {
  color: #fff;
  padding: 10px 15px;
  text-decoration: none;
  display: block;
}
.topnav ul.menu li a:hover,
.topnav > ul li a:hover {
  background: #642f82;
  border-radius: 4px;
}

/* Dropdowns */
.topnav ul.menu li ul,
.topnav > ul li ul {
  display: none;
  position: absolute;
  background: #642f82;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 160px;
  z-index: 1000;
}
.topnav ul.menu li:hover > ul,
.topnav > ul li:hover > ul {
  display: block;
}
.topnav ul.menu li ul li a,
.topnav > ul li ul li a {
  padding: 10px 15px;
}

/* Hamburger (hidden on desktop) */
.topnav .menu-toggle {
  display: none;
  font-size: 1.5em;
  cursor: pointer;
  color: #fff;
  background: none;
  border: none;
}

/* Right side (user + logout) */
.nav-right {
  margin-left: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-right .logout-link {
  background: #666;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
}
.nav-right .logout-link:hover {
  background: #7a7a7a;
}

/* Cards */
.card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin: 20px 0;
}
.card h2, .card h3 { margin-top: 0; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 15px;
  margin: 5px 0;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  font-weight: bold;
  text-align: center;
  border: none;
}
.btn-primary { background: #4b1e63; color: #fff; }
.btn-secondary { background: #666; color: #fff; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
}
table th, table td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #ddd;
}
table tr:nth-child(even) { background: #f9f9f9; }
table tr:hover { background: #f1f1f7; }

/* Forms */
form label { display: block; margin: 10px 0 5px; }
input, select, textarea {
  width: 100%;
  padding: 8px;
  font-size: 1rem;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
textarea { min-height: 80px; }

/* Alerts */
.alert { padding: 10px; border-radius: 4px; margin: 10px 0; }
.alert.info { background: #e5f2ff; border: 1px solid #99c9ff; color: #004085; }
.alert.error { background: #fdecea; border: 1px solid #f5c6cb; color: #721c24; }

/* Responsive nav (mobile) */
@media (max-width: 768px) {
  .topnav { flex-wrap: wrap; }
  .topnav .menu-toggle { display: block; margin-left: 10px; }

  /* Hide the menu by default on mobile, allow toggle via .show */
  .topnav ul.menu,
  .topnav > ul {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #4b1e63;
  }
  .topnav ul.menu.show,
  .topnav > ul.show {
    display: flex;
  }

  .topnav ul.menu li,
  .topnav > ul li {
    width: 100%;
  }

  .topnav ul.menu li a,
  .topnav > ul li a {
    padding: 12px 20px;
  }

  .nav-right {
    width: 100%;
    justify-content: flex-end;
    padding-top: 8px;
  }

  /* --- Force submenus inline on mobile --- */
  .topnav ul.menu.show li.has-children > .submenu {
    display: flex !important;
    flex-direction: column;
    position: static !important;
    background: none !important;
    padding-left: 1rem;   /* indent children */
    margin: 0;
    width: 100%;
  }

  .topnav ul.menu.show li.has-children > a,
  .topnav ul.menu.show li.has-children > span.menu-parent {
    font-weight: 700;      /* bold parent as section heading */
    padding-top: 1rem;
  }

  .topnav ul.menu.show li.has-children > .submenu li a {
    padding: 8px 25px;     /* extra indent for child links */
    font-size: 0.95rem;
  }
}


  /* --- NEW: expand all submenus on mobile --- */
  .topnav ul.menu.show li.has-children > .submenu {
    display: block !important;
    position: static !important;
    background: none;
    padding-left: 1rem;
  }
  .topnav ul.menu.show li.has-children > .submenu li a {
    padding: 10px 25px;
    font-size: 0.95rem;
  }
}

/* === Services Provided / Client Actions (shared styling) === */

/* New page already uses .svc-flags — keep that layout */
.svc-flags {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 20px;
  margin: 12px 0;
}
.svc-flags label,
.svc-flags .chk {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.3;
  font-size: 0.95rem;
}
.svc-flags input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}

/* Edit page fallback: style any fieldset that contains SVC_ checkboxes the same way */
@supports selector(:has(*)) {
  fieldset:has(input[type="checkbox"][name^="SVC_"]) > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 8px 20px;
    margin: 12px 0;
  }
  fieldset:has(input[type="checkbox"][name^="SVC_"]) label {
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.3;
    font-size: 0.95rem;
  }
  fieldset:has(input[type="checkbox"][name^="SVC_"]) input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 auto;
  }
}
/* --- Tabs (clean pill style) --- */
.tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
}
.tabs a {
  text-decoration: none;
  padding: .5rem 1rem;
  border-radius: .5rem;
  background: #f5f3fa;
  color: #4b1e63;
  font-weight: 500;
  transition: background .2s, color .2s, box-shadow .2s;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.tabs a:hover { background: #eee7fb; }
.tabs a.active {
  background: #4b1e63;
  color: #fff;
  box-shadow: 0 2px 6px rgba(75,30,99,.25);
}

/* --- Compact data tables used in Overview/Requests --- */
.table-mini {
  width: 100%;
  border-collapse: collapse;
  margin: .75rem 0 1rem;
}
.table-mini th,
.table-mini td {
  padding: 8px 10px;
  border: 1px solid #e7e3ee;
  font-size: .95rem;
  vertical-align: top;
}
.table-mini th {
  background: #f8f6fc;
  color: #4b1e63;
  font-weight: 600;
  white-space: nowrap;
}

/* --- Service/status badges --- */
.badge {
  display: inline-block;
  background: #eee;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .8rem;
  margin: 0 6px 6px 0;
  line-height: 1;
}
.badge--ok   { background: #e6f7ef; color: #0b7e45; }
.badge--warn { background: #fff4e6; color: #a15a00; }
.badge--muted{ background: #f0f0f5; color: #555; }

/* --- Action rows (keeps buttons aligned neatly) --- */
.actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

/* --- Tabs (pill style for iin_edit.php etc.) --- */
.tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
}
.tabs a {
  text-decoration: none;
  padding: .5rem 1rem;
  border-radius: .5rem;
  background: #f5f3fa;
  color: #4b1e63;
  font-weight: 500;
  transition: background .2s, color .2s, box-shadow .2s;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.tabs a:hover { background: #eee7fb; }
.tabs a.active {
  background: #4b1e63;
  color: #fff;
  box-shadow: 0 2px 6px rgba(75,30,99,.25);
}

/* --- Compact tables for Overview / Help Requests --- */
.table-mini {
  width: 100%;
  border-collapse: collapse;
  margin: .75rem 0 1rem;
}
.table-mini th,
.table-mini td {
  padding: 8px 10px;
  border: 1px solid #e7e3ee;
  font-size: .95rem;
  vertical-align: top;
}
.table-mini th {
  background: #f8f6fc;
  color: #4b1e63;
  font-weight: 600;
  white-space: nowrap;
}

/* --- Service / status badges --- */
.badge {
  display: inline-block;
  background: #eee;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .8rem;
  margin: 0 6px 6px 0;
  line-height: 1;
}
.badge--ok   { background: #e6f7ef; color: #0b7e45; }
.badge--warn { background: #fff4e6; color: #a15a00; }
.badge--muted{ background: #f0f0f5; color: #555; }

/* --- Button/action rows --- */
.actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

.svc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .75rem;
  margin-top: .75rem;
}
.svc-card {
  background: #fff;
  border: 1px solid #e7e3ee;
  border-radius: .6rem;
  padding: .6rem .8rem;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: transform .15s ease, box-shadow .15s ease;
}
.svc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.08);
}
.svc-label {
  font-size: .8rem;
  font-weight: 500;
  color: #555;
  margin-bottom: .2rem;
}
.svc-metric {
  font-size: 1.15rem;
  font-weight: 600;
  color: #4b1e63;
}

/* Allow services grid to expand to 4 columns on larger screens */
.svc-cards-4 {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
@media (min-width: 992px) {
  .svc-cards-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Service selection cards in forms */
.svc-select {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
  text-align: center;
}

.svc-option {
  border: 1px solid #e7e3ee;
  border-radius: .6rem;
  background: #fff;
  padding: .5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;

  /* Force vertical stack */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
}

.svc-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.08);
  border-color: #b388d6; /* faint purple border on hover */
}

.svc-option img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: .4rem;
}

.svc-option input[type="checkbox"] {
  width: 30px;
  height: 30px;
  accent-color: #b388d6; /* light lavender-purple */
  margin-top: .25rem;
}

/* Utility class: hide visually but keep for screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Dashboard buttons (portal-driven nav) --- */
.dashboard-buttons {
  margin-top: 1.5rem;
}

.grid-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;              /* space between both rows & columns */
  margin-top: 2rem;
  margin-bottom: 20px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.dashboard-button {
  background: #5a2a82;
  color: #fff;
  text-align: center;
  padding: 1.2rem;
  border-radius: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  display: block;

  width: 100%;            /* let it respect the grid gap */
  box-sizing: border-box; /* includes padding in width calc */
  
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: background 0.2s ease, transform 0.2s ease;
}

.dashboard-button:hover {
  background: #7b42a8;
  transform: translateY(-3px);
}


/* Dropdown nav */
.menu li {
  position: relative;
}

.menu li.has-children > .submenu {
  display: none;
  position: absolute;
  background: #5a2a82;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  border-radius: 0.5rem;
  min-width: 180px;
  z-index: 1000;
}

.menu li.has-children:hover > .submenu {
  display: block;
}

.menu .submenu li a {
  display: block;
  padding: 0.5rem 1rem;
  color: #fff;
  text-decoration: none;
}

.menu .submenu li a:hover {
  background: #7b42a8;
}
/* --- Portal topnav refinements --- */
.topnav ul.menu {
  flex: 1;
  justify-content: center;   /* center menu items */
  gap: 1.5rem;                /* more spacing between links */
  padding: 0.5rem 0;          /* vertical padding */
}

.topnav ul.menu li a,
.topnav ul.menu span.menu-parent {
  font-size: 1.1rem;          /* bigger text */
  font-weight: 600;
  color: #fff;
  padding: 0.5rem 1rem;
  text-decoration: none;
  display: block;
}

.topnav ul.menu span.menu-parent {
  cursor: pointer;            /* so it feels like a link */
}

.topnav ul.menu li a:hover,
.topnav ul.menu span.menu-parent:hover {
  background: #642f82;
  border-radius: 4px;
}

/* Dashboard Logo Card */
.logo-card {
  max-width: 500px;
  margin: 1rem auto;
  text-align: center;
  border: 2px solid #b388d6; /* lavender border */
  border-radius: 0.75rem;
  box-shadow: 0 4px 10px rgba(75,30,99,0.15);
  padding: 1rem;
  background: #fff;
}

/* Dashboard Logo Card */
.logo-card {
  width: 300px;
  height: 300px;
  margin: 1rem auto;
  text-align: center;
  border: 2px solid #b388d6; /* lavender border */
  border-radius: 0.75rem;
  box-shadow: 0 4px 10px rgba(75,30,99,0.15);
  padding: 1rem;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-card .logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Force single column on smaller screens */
@media (max-width: 600px) {
  .grid-buttons {
    grid-template-columns: 1fr !important;  /* stack buttons full-width */
  }
}


