
/**
 * Premium white UI for Group of Institutions management demo.
 */

.gim-body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.5;
}

.gim-app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.gim-sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.gim-sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.gim-sidebar-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f7cff, #6366f1);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.gim-sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}

.gim-sidebar-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.gim-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.gim-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}

.gim-nav a i {
  width: 18px;
  text-align: center;
  font-size: 15px;
}

.gim-nav a:hover {
  background: #f8fafc;
  color: #334155;
}

.gim-nav a.is-active {
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.12), rgba(99, 102, 241, 0.08));
  color: #4f46e5;
}

.gim-sidebar-foot {
  padding: 14px 16px;
  border-top: 1px solid #f1f5f9;
  font-size: 11px;
  color: #94a3b8;
}

.gim-sidebar-user {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
}

.gim-sidebar-user:hover {
  color: #4f46e5;
}

.gim-sidebar-foot-links {
  display: flex;
  gap: 10px;
  margin: 6px 0 10px;
}

.gim-sidebar-foot-links a {
  color: #94a3b8;
  font-size: 11px;
  text-decoration: none;
}

.gim-sidebar-foot-links a:hover {
  color: #4f46e5;
}

.gim-btn-logout {
  width: 85%;
  margin-top: 4px;
  justify-content: center;
  font-size: 12px;
  color: #64748b;
  border-color: #e2e8f0;
}

.gim-btn-logout:hover {
  color: #dc2626;
  border-color: #fecaca;
  background: #fef2f2;
}

.gim-user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 10px;
  border-left: 1px solid #e2e8f0;
}

.gim-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gim-btn-logout-top {
  color: #64748b;
}

.gim-btn-logout-top:hover {
  color: #dc2626;
  border-color: #fecaca;
  background: #fef2f2;
}

@media (max-width: 768px) {
  .gim-logout-label {
    display: none;
  }
  .gim-user-name {
    display: none;
  }
  .gim-user-menu {
    border-left: none;
    padding-left: 0;
  }
}

.gim-demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 8px;
}

/* Main */
.gim-main {
  flex: 1;
  margin-left: 260px;
  min-width: 0;
}

.gim-topbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
}

.gim-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gim-menu-btn {
  display: none;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 18px;
  color: #475569;
}

.gim-page-heading {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

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

.gim-school-filter {
  min-width: 200px;
  height: 38px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  background: #fafafa;
  color: #334155;
  outline: none;
}

.gim-school-filter:focus {
  border-color: #4f7cff;
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.12);
}

.gim-date-stamp {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.gim-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.gim-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.gim-btn-primary {
  background: linear-gradient(135deg, #4f7cff, #6366f1);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 124, 255, 0.3);
}

.gim-btn-primary:hover {
  opacity: 0.95;
  color: #fff;
}

.gim-btn-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.gim-btn-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.gim-btn-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.gim-content {
  padding: 24px;
  max-width: 1600px;
}

/* KPI cards */
.gim-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.gim-kpi {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  border: 1px solid #f1f5f9;
  transition: box-shadow 0.2s;
}

.gim-kpi:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.gim-kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.gim-kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.gim-kpi-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
}

.gim-kpi-sub.positive { color: #059669; }
.gim-kpi-sub.negative { color: #dc2626; }

.gim-kpi-icon {
  float: right;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.gim-kpi-icon.blue { background: #eff6ff; color: #2563eb; }
.gim-kpi-icon.green { background: #ecfdf5; color: #059669; }
.gim-kpi-icon.amber { background: #fffbeb; color: #d97706; }
.gim-kpi-icon.red { background: #fef2f2; color: #dc2626; }
.gim-kpi-icon.purple { background: #f5f3ff; color: #7c3aed; }

/* Charts */
.gim-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.gim-chart-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.gim-chart-card.full {
  grid-column: 1 / -1;
}

.gim-chart-head {
  margin-bottom: 16px;
}

.gim-chart-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 4px;
}

.gim-chart-sub {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

.gim-chart-wrap {
  position: relative;
  height: 260px;
}

.gim-chart-wrap.tall { height: 320px; }
.gim-chart-wrap.short { height: 200px; }

/* Widget panels */
.gim-widget-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.gim-widget {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.gim-widget-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.gim-widget-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.gim-widget-link {
  font-size: 12px;
  color: #4f7cff;
  text-decoration: none;
  font-weight: 600;
}

.gim-list-item {
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.gim-list-item:last-child { border-bottom: none; }

.gim-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.gim-badge.critical { background: #fef2f2; color: #b91c1c; }
.gim-badge.high { background: #fff7ed; color: #c2410c; }
.gim-badge.medium { background: #fef9c3; color: #a16207; }
.gim-badge.low { background: #f1f5f9; color: #64748b; }
.gim-badge.pending { background: #eff6ff; color: #1d4ed8; }
.gim-badge.approved { background: #ecfdf5; color: #047857; }
.gim-badge.rejected { background: #fef2f2; color: #b91c1c; }
.gim-badge.resent { background: #fffbeb; color: #b45309; }
.gim-badge.under_review { background: #f5f3ff; color: #6d28d9; }

.gim-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.gim-health-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gim-health-card:hover {
  border-color: #4f7cff;
  box-shadow: 0 4px 12px rgba(79, 124, 255, 0.1);
}

.gim-health-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.gim-health-name {
  font-weight: 700;
  font-size: 13px;
  color: #1e293b;
}

.gim-health-city {
  font-size: 11px;
  color: #94a3b8;
}

.gim-health-score {
  font-size: 22px;
  font-weight: 800;
  color: #4f46e5;
}

.gim-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.gim-status-dot.healthy { background: #22c55e; }
.gim-status-dot.warning { background: #f59e0b; }
.gim-status-dot.offline { background: #ef4444; }

/* Tables */
.gim-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.gim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.gim-table th {
  background: #f8fafc;
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid #e2e8f0;
}

.gim-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.gim-table tr:hover td {
  background: #fafafa;
}

.gim-table tr.clickable {
  cursor: pointer;
}

/* Filters bar */
.gim-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

.gim-input, .gim-select {
  height: 38px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  background: #fff;
  outline: none;
  width: 94%;
}

.gim-input:focus, .gim-select:focus {
  border-color: #4f7cff;
}

/* Modal / drawer */
.gim-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.gim-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.gim-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100%);
  height: 100%;
  background: #fff;
  z-index: 210;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.gim-drawer.is-open {
  transform: translateX(0);
}

.gim-drawer-head {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.gim-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.gim-drawer-foot {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.gim-close-btn {
  border: none;
  background: #f1f5f9;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  color: #64748b;
}

.gim-field {
  margin-bottom: 16px;
}

.gim-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.gim-textarea {
  width: 100%;
  min-height: 90px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  resize: vertical;
  box-sizing: border-box;
}

.gim-timeline {
  border-left: 2px solid #e2e8f0;
  padding-left: 16px;
  margin: 16px 0;
}

.gim-timeline-item {
  margin-bottom: 14px;
  position: relative;
}

.gim-timeline-item::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4f7cff;
}

.gim-attach-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.gim-attach-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

/* Toast */
.gim-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.25s;
  pointer-events: none;
}

.gim-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Presentation page */
.gim-pres-hero {
  text-align: center;
  padding: 48px 24px;
  background: linear-gradient(135deg, #4f7cff 0%, #6366f1 50%, #8b5cf6 100%);
  color: #fff;
  border-radius: 20px;
  margin-bottom: 32px;
}

.gim-pres-hero h1 {
  font-size: 32px;
  margin: 0 0 12px;
  font-weight: 800;
}

.gim-pres-section {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}

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

.gim-pres-card {
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-align: center;
}

.gim-pres-card i {
  font-size: 28px;
  color: #4f7cff;
  margin-bottom: 10px;
}

/* School profile */
.gim-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.gim-profile-stat {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.gim-profile-stat .val {
  font-size: 20px;
  font-weight: 800;
  color: #1e293b;
}

.gim-profile-stat .lbl {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 1100px) {
  .gim-chart-grid { grid-template-columns: 1fr; }
  .gim-widget-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .gim-sidebar {
    transform: translateX(-100%);
  }
  .gim-sidebar.is-open {
    transform: translateX(0);
  }
  .gim-main { margin-left: 0; }
  .gim-menu-btn { display: flex; align-items: center; justify-content: center; }
  .gim-content { padding: 16px; }
  .gim-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .gim-school-layout { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .gim-kpi-grid { grid-template-columns: 1fr; }
}

/* Accounts module visibility (default off) */
.gim-accounts-off .gim-accounts-only {
  display: none !important;
}

.gim-accounts-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.gim-accounts-toggle-row h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.gim-accounts-toggle-row p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

.gim-pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.gim-pill-label {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.gim-pill-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.gim-pill-slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.gim-pill-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.gim-pill-toggle input:checked + .gim-pill-slider {
  background: #4f7cff;
}

.gim-pill-toggle input:checked + .gim-pill-slider::before {
  transform: translateX(20px);
}

.gim-pill-toggle input:focus-visible + .gim-pill-slider {
  outline: 2px solid #4f7cff;
  outline-offset: 2px;
}
