/* ============================================================
   ITA Accounts - Admin theme
   ============================================================ */
:root {
  --sidebar-w: 250px;
  --sidebar-bg: #0f172a;
  --sidebar-bg-2: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-text-muted: #64748b;
  --sidebar-active: #3b82f6;
  --sidebar-hover: #1e293b;
  --topbar-h: 60px;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --body-bg: #f1f5f9;
  --card-border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--body-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  font-size: 14px;
  margin: 0;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 1030;
  box-shadow: 2px 0 8px rgba(0,0,0,0.08);
}
.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--sidebar-bg-2);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
}
.sidebar-brand i { font-size: 22px; color: var(--brand); }
.sidebar-brand:hover { color: #fff; text-decoration: none; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.7);
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
}
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: #ffffff; }
.sidebar-nav { scrollbar-color: rgba(255,255,255,0.7) rgba(255,255,255,0.05); scrollbar-width: thin; }

.nav-section {
  padding: 14px 20px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-text-muted);
}
.sidebar a.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.sidebar a.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.sidebar a.nav-item.active {
  background: var(--sidebar-hover);
  color: #fff;
  border-left-color: var(--sidebar-active);
}
.sidebar a.nav-item i {
  font-size: 16px;
  width: 18px;
  text-align: center;
  opacity: 0.85;
}

.sidebar-footer {
  border-top: 1px solid var(--sidebar-bg-2);
  padding: 14px 20px;
  font-size: 12px;
  color: var(--sidebar-text-muted);
}

/* ===== MAIN AREA ===== */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.topbar h1 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.topbar h1 small { color: var(--text-muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 13px;
}
.topbar-user .name { font-weight: 600; font-size: 13.5px; line-height: 1.1; }
.topbar-user .role { font-size: 11.5px; color: var(--text-muted); }

.content { padding: 24px; flex: 1; }

/* ===== CARDS ===== */
.card {
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  background: #fff;
}
.card-body { padding: 20px; }

/* KPI cards */
.stat-card { display: flex; align-items: center; gap: 16px; }
.stat-card .icon {
  width: 52px; height: 52px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-card .icon.bg-primary-soft   { background: #dbeafe; color: #2563eb; }
.stat-card .icon.bg-success-soft   { background: #d1fae5; color: #059669; }
.stat-card .icon.bg-warning-soft   { background: #fef3c7; color: #d97706; }
.stat-card .icon.bg-danger-soft    { background: #fee2e2; color: #dc2626; }
.stat-card .icon.bg-info-soft      { background: #cffafe; color: #0891b2; }
.stat-card .icon.bg-purple-soft    { background: #ede9fe; color: #7c3aed; }
.stat-card .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.stat-card .value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-card .sub { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

/* ===== TABLES ===== */
.table { color: var(--text); margin-bottom: 0; border-color: #cbd5e1; }
.table thead th {
  background: #eef2f7;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #94a3b8;
  border-top: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
  padding: 11px 12px;
}
.table thead th:last-child { border-right: none; }
.table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  vertical-align: middle;
}
.table tbody td:last-child { border-right: none; }
.table tbody tr:last-child td { border-bottom: 1px solid #94a3b8; }
.table tfoot th, .table tfoot td {
  background: #eef2f7;
  border-top: 2px solid #94a3b8;
  border-right: 1px solid #cbd5e1;
  font-weight: 700;
  padding: 11px 12px;
}
.table tfoot th:last-child, .table tfoot td:last-child { border-right: none; }
.table-hover tbody tr:hover { background: #f1f5f9; }
.table-bordered, .table-bordered td, .table-bordered th { border: 1px solid #cbd5e1; }
.table-sm td, .table-sm th { padding: 7px 10px; font-size: 13px; }
.money { text-align: right; font-variant-numeric: tabular-nums; }

/* ===== FORMS ===== */
.form-label { font-size: 12.5px; font-weight: 500; color: var(--text); margin-bottom: 5px; }
.form-control, .form-select {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13.5px;
  padding: 7px 11px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== BUTTONS ===== */
.btn { font-size: 13.5px; font-weight: 500; border-radius: 6px; padding: 7px 14px; }
.btn-sm { font-size: 12.5px; padding: 4px 10px; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

/* ===== BADGES ===== */
.badge { font-weight: 500; padding: 4px 9px; border-radius: 5px; font-size: 11.5px; }

/* ===== PAGE TITLE ===== */
.page-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.page-title h2 { font-size: 20px; font-weight: 600; margin: 0; color: var(--text); }
.page-title h2 small { font-size: 13px; color: var(--text-muted); font-weight: 400; margin-left: 8px; }

/* ===== LOGIN PAGE ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  background: #0f172a;
}
.login-side {
  flex: 1;
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}
.login-side::before {
  content: "";
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 50%;
}
.login-side h1 { font-size: 36px; font-weight: 700; margin-bottom: 16px; position: relative; }
.login-side p  { font-size: 16px; opacity: 0.85; max-width: 420px; line-height: 1.6; position: relative; }
.login-form-side {
  flex: 0 0 460px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-form-side .inner { width: 100%; max-width: 360px; }
.login-form-side h3 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.login-form-side .lead { color: var(--text-muted); margin-bottom: 28px; font-size: 14px; }

/* ===== PRINT ===== */
@media print {
  .sidebar, .topbar, .d-print-none { display: none !important; }
  .main-wrap { margin-left: 0; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { border: none; box-shadow: none; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .login-side { display: none; }
  .login-form-side { flex: 1; }
}

/* utility: subtle row hover for cards listing */
.list-row { padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.list-row:last-child { border-bottom: none; }

/* DataTables overrides for professional look */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}
.dataTables_wrapper .dataTables_filter input {
  width: 240px;
  margin-left: 6px;
}
.dataTables_wrapper .dt-buttons .btn { margin-left: 4px; }
.dataTables_wrapper .dataTables_info { color: var(--text-muted); font-size: 12.5px; }
.dataTables_wrapper .pagination { margin: 0; }
.dataTables_wrapper .page-link {
  color: var(--text);
  font-size: 13px;
  border-color: #e2e8f0;
}
.dataTables_wrapper .page-item.active .page-link {
  background: var(--brand);
  border-color: var(--brand);
}
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
  cursor: pointer;
  background-position: right 8px center !important;
}
table.dataTable.no-footer { border-bottom: none; }
.dt-buttons .btn { background: #f8fafc; border: 1px solid #e2e8f0; color: var(--text); }
.dt-buttons .btn:hover { background: #e2e8f0; }

/* Filter card on reports */
.filter-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.filter-card label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; }
