/* public/assets/css/app.css — TamNGO Manager */

:root {
  --sidebar-width: 240px;
  --sidebar-bg: #1a1f2e;
  --sidebar-text: #b0b8cc;
  --sidebar-active-bg: rgba(255,255,255,.08);
  --sidebar-active-text: #fff;
  --topbar-height: 52px;
  --brand-color: #0d6efd;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand { color: var(--sidebar-active-text) !important; }
.sidebar-brand i { font-size: 1.25rem; color: var(--brand-color); }

.sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: 6px;
  font-size: .875rem;
  padding: .45rem .75rem;
  transition: background .15s, color .15s;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}

.sidebar-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #5a6474;
  padding: .25rem .75rem;
}

.sidebar-user { color: var(--sidebar-text); padding: .5rem .25rem; }
.sidebar-user:hover { color: #fff; }

.avatar-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-color);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 600;
  flex-shrink: 0;
}

/* ── Main content ── */
.main-content { min-height: 100vh; background: #f5f6fa; }
.topbar { height: var(--topbar-height); background: #fff; }
.page-content { margin-top: 1rem; }
.x-small { font-size: .7rem; }

/* ── KPI cards ── */
.kpi-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.kpi-card .kpi-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.kpi-card .kpi-label { font-size: .8rem; color: #6c757d; margin-top: .25rem; }
.kpi-blue   { border-color: #0d6efd; } .kpi-blue   .kpi-value { color: #0d6efd; }
.kpi-green  { border-color: #198754; } .kpi-green  .kpi-value { color: #198754; }
.kpi-amber  { border-color: #fd7e14; } .kpi-amber  .kpi-value { color: #fd7e14; }
.kpi-red    { border-color: #dc3545; } .kpi-red    .kpi-value { color: #dc3545; }
.kpi-purple { border-color: #6f42c1; } .kpi-purple .kpi-value { color: #6f42c1; }
.kpi-teal   { border-color: #20c997; } .kpi-teal   .kpi-value { color: #20c997; }

/* ── Status badges ── */
.badge-status { font-size: .72rem; font-weight: 500; padding: .25em .6em; border-radius: 4px; }
.status-active     { background:#d1fae5; color:#065f46; }
.status-draft      { background:#f3f4f6; color:#374151; }
.status-completed  { background:#dbeafe; color:#1e40af; }
.status-suspended  { background:#fef3c7; color:#92400e; }
.status-terminated { background:#fee2e2; color:#991b1b; }
.status-pending    { background:#fef9c3; color:#854d0e; }
.status-approved   { background:#d1fae5; color:#065f46; }
.status-rejected   { background:#fee2e2; color:#991b1b; }
.status-submitted  { background:#dbeafe; color:#1e40af; }
.status-reviewed   { background:#ede9fe; color:#5b21b6; }
.status-notstarted { background:#f3f4f6; color:#374151; }
.status-inprogress { background:#fef9c3; color:#854d0e; }
.status-delayed    { background:#fed7aa; color:#9a3412; }
.status-cancelled  { background:#fee2e2; color:#991b1b; }

/* ── Tables ── */
.table-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  overflow: hidden;
}
.table-card .table { margin-bottom: 0; }
.table-card .table thead th {
  background: #f8f9fa;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6c757d;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
}

/* ── Progress bar ── */
.budget-bar { height: 6px; border-radius: 3px; background: #e9ecef; }
.budget-bar-fill { height: 100%; border-radius: 3px; background: #0d6efd; transition: width .3s; }
.budget-bar-fill.over { background: #dc3545; }

/* ── Chart containers ── */
.chart-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ── Login page ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
}
.login-card {
  width: 100%; max-width: 420px;
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* ── Responsive sidebar ── */
.sidebar-toggle { color: var(--sidebar-bg); line-height: 1; text-decoration: none; }
.sidebar-toggle:hover { color: var(--brand-color); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1035;
}
.sidebar-backdrop.show { display: block; }

@media (min-width: 768px) {
  /* never show the overlay on desktop, even if a stale class lingers */
  .sidebar-backdrop { display: none !important; }
}

@media (max-width: 767.98px) {
  .sidebar { position: fixed; z-index: 1040; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { width: 100%; }

  /* Wide tables: scroll horizontally inside their card instead of being
     clipped (the card normally has overflow:hidden for rounded corners). */
  .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-card .table { white-space: nowrap; margin-bottom: 0; }

  /* Tighter padding so cards/tables use the limited width better */
  .page-content { padding-left: .75rem !important; padding-right: .75rem !important; }
  .topbar { padding-left: .75rem !important; padding-right: .75rem !important; }
  .kpi-card { padding: 1rem 1.1rem; }
}
