/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ── Base font size ──────────────────────────────────────── */
html {
  font-size: 14px;
}

.form-control, .form-select, .form-check-input, .input-group-text, .btn {
  font-size: 0.875rem;
}

/* ── Variables ───────────────────────────────────────────── */
:root {
  --sidebar-width: 230px;
  --sidebar-bg: #1a1f2e;
  --sidebar-hover: #252b3b;
  --sidebar-active: #2d3550;
  --sidebar-text: #a0aec0;
  --sidebar-text-active: #ffffff;
  --sidebar-accent: #6366f1;
  --body-bg: #f0f2f5;
}

/* ── Auth layout (login page) ────────────────────────────── */
body.layout-auth {
  background: linear-gradient(135deg, #1a1f2e 0%, #2d3550 100%);
  min-height: 100vh;
}

/* ── Sidebar layout ──────────────────────────────────────── */
body.layout-sidebar {
  background: var(--body-bg);
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 0.5rem;
}

.sidebar-brand-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  list-style: none;
  padding: 0 0.75rem;
  margin: 0;
  flex: 1;
}

.sidebar-nav-item {
  margin-bottom: 2px;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4a5568;
  padding: 1rem 0.5rem 0.35rem;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.sidebar-nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.sidebar-nav-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  border-left: 3px solid var(--sidebar-accent);
  padding-left: calc(0.75rem - 3px);
}

.sidebar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.8;
}

.sidebar-badge {
  margin-left: auto;
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  min-width: 1.25rem;
  text-align: center;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── Main content area ───────────────────────────────────── */
.sidebar-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

/* ── Summary cards ───────────────────────────────────────── */
.summary-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.summary-card .label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 0.4rem;
}

.summary-card .amount {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.summary-card .sub {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 0.2rem;
}

/* ── Cards / panels ──────────────────────────────────────── */
.panel {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
}

.panel-body {
  padding: 1.25rem;
}

/* ── Tables ──────────────────────────────────────────────── */
.table {
  font-size: 0.875rem;
}

.table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

/* ── Mobile sidebar ──────────────────────────────────────── */
.sidebar-overlay {
  display: none;
}

@media (max-width: 767.98px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
  }

  .sidebar-content {
    margin-left: 0;
  }

  .table td, .table th {
    font-size: 0.8rem;
  }
}
