body { background: #f6f7fb; color: #1f2937; }
.app-shell { min-height: 100vh; display: flex; }
.app-sidebar { width: 270px; min-height: 100vh; position: sticky; top: 0; flex-direction: column; background: linear-gradient(160deg, #0f766e 0%, #2563eb 52%, #db2777 100%); border-right: 0; box-shadow: 12px 0 28px rgba(15,23,42,.16); }
.sidebar-brand { min-height: 68px; display: flex; align-items: center; gap: 10px; padding: 0 20px; color: #ffffff; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.18); }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.95); color: #0d6efd; box-shadow: 0 8px 22px rgba(15,23,42,.18); }
.brand-mark img { width: 28px; height: 28px; object-fit: contain; }
.sidebar-nav { padding: 14px 12px; overflow-y: auto; }
.app-sidebar .sidebar-nav { max-height: calc(100vh - 68px); }
.sidebar-nav.mobile { padding-top: 0; }
.sidebar-link { min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin-bottom: 4px; border-radius: 8px; color: rgba(255,255,255,.88); text-decoration: none; font-size: .94rem; transition: background-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease; }
.sidebar-link i { width: 20px; text-align: center; font-size: 1rem; color: rgba(255,255,255,.96); }
.sidebar-link:hover { background: rgba(255,255,255,.16); color: #ffffff; transform: translateX(2px); }
.sidebar-link.active { background: #ffffff; color: #0f766e; font-weight: 700; box-shadow: 0 10px 24px rgba(15,23,42,.18); }
.sidebar-link.active i { color: #2563eb; }
.sidebar-toggle { width: 100%; border: 0; background: transparent; }
.sidebar-sublink { margin-left: 12px; min-height: 38px; font-size: .9rem; background: rgba(255,255,255,.08); }
.app-sidebar .border-top { border-color: rgba(255,255,255,.18) !important; }
.app-sidebar .text-danger { color: #fee2e2 !important; }
.offcanvas-start { background: linear-gradient(160deg, #0f766e 0%, #2563eb 52%, #db2777 100%); color: #fff; }
.offcanvas-start .offcanvas-header { border-bottom: 1px solid rgba(255,255,255,.18); }
.offcanvas-start .sidebar-brand { border-bottom: 0; padding: 0; color: #fff; }
.offcanvas-start .border-top { border-color: rgba(255,255,255,.18) !important; }
.offcanvas-start .btn-close { filter: invert(1) grayscale(1) brightness(2); opacity: .9; }
.app-main { flex: 1; min-width: 0; }
.app-topbar { min-height: 68px; position: sticky; top: 0; z-index: 1010; display: flex; align-items: center; gap: 14px; padding: 0 24px; background: rgba(255,255,255,.96); border-bottom: 1px solid #e5e7eb; backdrop-filter: blur(8px); }
.app-content { padding: 24px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(to bottom, #0d6efd 0 42%, #ffffff 42% 100%); }
.auth-card { width: min(440px, 100%); background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 28px; box-shadow: 0 18px 45px rgba(15,23,42,.08); }
.auth-card .text-center { text-align: center; }
.auth-card .text-muted { color: #6b7280; }
.auth-card .mb-1 { margin-bottom: .25rem; }
.auth-card .mb-2 { margin-bottom: .5rem; }
.auth-card .mb-3 { margin-bottom: 1rem; }
.auth-card .mb-4 { margin-bottom: 1.5rem; }
.auth-card .mt-2 { margin-top: .5rem; }
.auth-card .mt-3 { margin-top: 1rem; }
.auth-card .h4 { font-size: 1.5rem; line-height: 1.2; }
.auth-card .form-label { display: inline-block; margin-bottom: .5rem; font-weight: 500; }
.auth-card .form-control,
.auth-card .form-select { display: block; width: 100%; min-height: 40px; padding: .45rem .75rem; border: 1px solid #ced4da; border-radius: 6px; background-color: #fff; color: #212529; font: inherit; }
.auth-card .form-control:focus,
.auth-card .form-select:focus { border-color: #86b7fe; outline: 0; box-shadow: 0 0 0 .2rem rgba(13,110,253,.18); }
.auth-card .input-group { display: flex; align-items: stretch; width: 100%; }
.auth-card .input-group > .form-control { width: 1%; }
.auth-card .input-group .form-control { flex: 1 1 auto; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.auth-card .input-group .btn { flex: 0 0 46px; width: 46px; border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.auth-card .form-check { display: flex; align-items: center; gap: .5rem; min-height: 24px; }
.auth-card .form-check-input { width: 1rem; height: 1rem; margin: 0; }
.auth-card .form-check-label { cursor: pointer; }
.auth-card .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: .45rem .75rem; border: 1px solid transparent; border-radius: 6px; text-decoration: none; cursor: pointer; font: inherit; }
.auth-card .btn-primary { background: #0d6efd; border-color: #0d6efd; color: #fff; }
.auth-card .btn-outline-secondary { background: #fff; border-color: #6c757d; color: #6c757d; }
.auth-card .w-100 { width: 100%; }
.page-title { display:flex; justify-content:space-between; gap:16px; align-items:center; margin-bottom:18px; }
.table-wrap { background:#fff; border:1px solid #e5e7eb; border-radius:8px; overflow:auto; }
.table thead th { background:#f1f3f5; color:#374151; border-bottom-color:#d8dee6; }
.stat-card { position: relative; overflow: hidden; background:#fff; border:0; border-radius:8px; padding:18px; height:100%; box-shadow: 0 12px 28px rgba(15,23,42,.08); }
.stat-card:after { content:""; position:absolute; right:-28px; top:-28px; width:92px; height:92px; border-radius:50%; background:rgba(255,255,255,.22); }
.stat-card .text-muted { color: #64748b !important; font-weight: 600; }
.stat-card .h4 { position: relative; color:#0f172a; font-weight: 800; letter-spacing: 0; }
.stat-card i { color: #2563eb; }
.stat-card-1 { background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%); }
.stat-card-2 { background: linear-gradient(135deg, #16a34a 0%, #14b8a6 100%); }
.stat-card-3 { background: linear-gradient(135deg, #f97316 0%, #e11d48 100%); }
.stat-card-4 { background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%); }
.stat-card-1 .text-muted,
.stat-card-2 .text-muted,
.stat-card-3 .text-muted,
.stat-card-4 .text-muted { color: rgba(255,255,255,.84) !important; }
.stat-card-1 .h4,
.stat-card-2 .h4,
.stat-card-3 .h4,
.stat-card-4 .h4 { color:#fff; }
.stat-card-1 i,
.stat-card-2 i,
.stat-card-3 i,
.stat-card-4 i { color: rgba(255,255,255,.94); }
.form-section { background:#fff; border:1px solid #e5e7eb; border-radius:8px; padding:20px; }
.required:after { content:" *"; color:#dc3545; }
.badge-soft { background:#eef2ff; color:#3730a3; }
.app-footer { margin-top: 28px; padding: 16px 0 4px; color:#6b7280; font-size:.88rem; text-align:center; }
.chart-box { position: relative; min-height: 280px; }
.dashboard-page { display: block !important; visibility: visible !important; opacity: 1 !important; min-height: 300px; }
.dashboard-chart-fallback { display: block; }
.chart-box canvas[data-chart-ready="1"] + .dashboard-chart-fallback { display: none; }
@media (max-width: 991px) {
  .app-shell { display: block; }
  .app-topbar { padding: 0 14px; }
  .app-content { padding: 16px; }
  .page-title { align-items: flex-start; flex-direction: column; }
  .table { min-width: 760px; }
  .btn-group { display: inline-flex; flex-wrap: nowrap; }
  .modal-dialog { margin: 8px; }
  .auth-card { padding: 22px; }
  .stat-card .h4 { font-size: 1.1rem; }
}
