/* ================================================================
   SISPED — Go Web Edition
   Dark professional theme — inspired by the original Clipper UI
   ================================================================ */

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3352;
  --accent: #3b82f6;
  --accent-hov: #2563eb;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --font: 'Segoe UI', system-ui, sans-serif;
  --radius: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── App Layout ── */
.app-container {
  display: flex;
  min-height: 100vh;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-width: 0;
  /* Important for flex child overflow */
}

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0, 0, 0, .2);
}

.sidebar-brand {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  font-size: 2rem;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .05em;
  line-height: 1.2;
}

.brand-sub {
  font-size: .65rem;
  color: var(--muted);
  white-space: nowrap;
}

.sidebar-nav {
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  overflow-y: auto;
  flex: 1;
}

.nav-item {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--accent);
}

.nav-item.active {
  background: var(--surface2);
  color: var(--accent);
  font-weight: 600;
}

.nav-section-title {
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 1.5rem 1rem .5rem;
}

.sub-item {
  padding-left: 2.75rem;
  font-size: .85rem;
  color: var(--muted);
}

/* ── Content ── */
.content {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Media Queries ── */
@media (max-width: 900px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-brand {
    padding: 0.75rem 1rem;
  }

  .sidebar-nav {
    flex-direction: row;
    padding: 0.5rem;
    overflow-x: auto;
    gap: 0.25rem;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .nav-section-title,
  .sub-item {
    display: none;
    /* Hide complex navigation on condensed mobile topbar */
  }

  .content {
    padding: 1.5rem 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .page-actions {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .page-actions .btn {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .card {
    padding: 1.25rem;
  }

  .stat-value {
    font-size: 2.25rem;
  }
}

@media print {

  .sidebar,
  .no-print {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .main-wrapper {
    display: block;
  }

  table {
    border-collapse: collapse;
  }

  th,
  td {
    border: 1px solid #ccc;
  }
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 1.5rem;
  font-size: .75rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: auto;
}