
:root {
  --fl-primary: #2563eb;
  --fl-primary-dark: #1d4ed8;
  --fl-accent: #10b981;
  --fl-bg: #f4f7fb;
  --fl-surface: #ffffff;
  --fl-text: #172033;
  --fl-muted: #64748b;
  --fl-border: #e5eaf2;
  --fl-radius: 14px;
  --fl-shadow: 0 10px 30px rgba(15, 23, 42, .07);
}

html, body {
  background: var(--fl-bg);
  color: var(--fl-text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.main-header .logo {
  background: #0f172a !important;
  font-weight: 700;
  letter-spacing: .2px;
}

.main-header .navbar {
  background: #ffffff !important;
  border-bottom: 1px solid var(--fl-border);
}

.main-header .sidebar-toggle {
  color: #334155 !important;
}

.skin-blue .main-header .navbar .nav > li > a {
  color: #334155;
}

.skin-blue .main-header .navbar .nav > li > a:hover {
  background: #f8fafc;
  color: var(--fl-primary);
}

.main-sidebar,
.left-side {
  background: #0f172a !important;
}

.skin-blue .sidebar-menu > li.header {
  background: transparent;
  color: #94a3b8;
  font-size: 11px;
  letter-spacing: .08em;
  padding: 16px 15px 8px;
}

.skin-blue .sidebar-menu > li > a {
  color: #cbd5e1;
  border-left: 3px solid transparent;
  transition: all .18s ease;
}

.skin-blue .sidebar-menu > li:hover > a,
.skin-blue .sidebar-menu > li.active > a {
  background: rgba(255,255,255,.06);
  color: #fff;
  border-left-color: var(--fl-accent);
}

.skin-blue .sidebar-menu .treeview-menu {
  background: rgba(0,0,0,.12);
}

.skin-blue .sidebar-menu .treeview-menu > li > a {
  color: #94a3b8;
}

.skin-blue .sidebar-menu .treeview-menu > li > a:hover {
  color: #fff;
}

.content-wrapper {
  background: var(--fl-bg) !important;
}

.content-header {
  padding-top: 24px;
}

.content-header > h1 {
  color: var(--fl-text);
  font-size: 28px;
  font-weight: 700;
}

.box,
.small-box,
.info-box {
  border: 1px solid var(--fl-border);
  border-radius: var(--fl-radius);
  box-shadow: var(--fl-shadow);
  overflow: hidden;
}

.box {
  background: var(--fl-surface);
}

.box-header {
  border-bottom: 1px solid var(--fl-border);
  padding: 18px 20px;
}

.box-header .box-title {
  color: var(--fl-text);
  font-weight: 700;
}

.table {
  background: #fff;
}

.table > thead > tr > th {
  background: #f8fafc;
  color: #475569;
  border-bottom: 1px solid var(--fl-border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.table > tbody > tr > td {
  border-color: #eef2f7;
  vertical-align: middle;
}

.table > tbody > tr:hover {
  background: #f8fbff;
}

.form-control {
  border: 1px solid #d8dee9;
  border-radius: 9px;
  box-shadow: none;
  min-height: 38px;
}

.form-control:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.btn {
  border-radius: 9px;
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--fl-primary);
  border-color: var(--fl-primary);
}

.btn-primary:hover {
  background: var(--fl-primary-dark);
  border-color: var(--fl-primary-dark);
}

.main-footer {
  background: #fff;
  border-top: 1px solid var(--fl-border);
  color: var(--fl-muted);
}

.fl-dashboard {
  padding: 24px;
}

.fl-dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.fl-dashboard-title {
  margin: 0;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.fl-dashboard-subtitle {
  color: var(--fl-muted);
  margin: 7px 0 0;
}

.fl-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.fl-stat {
  position: relative;
  min-height: 150px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--fl-border);
  border-radius: var(--fl-radius);
  box-shadow: var(--fl-shadow);
  overflow: hidden;
}

.fl-stat::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  right: -28px;
  top: -28px;
  background: rgba(37,99,235,.08);
}

.fl-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: var(--fl-primary);
  margin-bottom: 18px;
}

.fl-stat-value {
  font-size: 30px;
  line-height: 1;
  font-weight: 750;
  margin-bottom: 8px;
}

.fl-stat-label {
  color: var(--fl-muted);
  font-size: 13px;
  font-weight: 600;
}

.fl-stat-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--fl-primary);
  font-size: 12px;
  font-weight: 700;
}

.fl-stat-success .fl-stat-icon { background: #ecfdf5; color: #059669; }
.fl-stat-warning .fl-stat-icon { background: #fffbeb; color: #d97706; }
.fl-stat-danger .fl-stat-icon { background: #fef2f2; color: #dc2626; }

.user-panel {
  padding: 15px;
}

@media (max-width: 1100px) {
  .fl-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .fl-dashboard { padding: 15px; }
  .fl-dashboard-title { font-size: 24px; }
  .fl-stat-grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 991px) {
  .content .box-body:has(> .table),
  .content .table-responsive:has(> .table) {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
}

.fl-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  width: 100%;
  max-width: 100%;
  margin-top: 12px;
}

.fl-pager .fl-pager-meta,
.fl-pager .pagination {
  float: none !important;
  margin: 0;
}

.fl-pager .pagination {
  display: flex;
  flex-wrap: wrap;
}

.fl-pager .pagination > li,
.fl-pager .pagination > li > a,
.fl-pager .pagination > li > span {
  float: none;
}

.fl-page-loader {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20000;
  align-items: center;
  justify-content: center;
  background: rgba(244, 247, 251, 0.9);
}

.fl-page-loader.is-active {
  display: flex;
}

.fl-page-loader-card {
  min-width: 180px;
  padding: 22px 28px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--fl-border);
  border-radius: var(--fl-radius);
  box-shadow: var(--fl-shadow);
}

.fl-page-loader-card p {
  margin: 0;
  color: var(--fl-text);
  font-weight: 700;
}

.fl-page-loader-spin {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border: 3px solid #e5eaf2;
  border-top-color: var(--fl-primary);
  border-radius: 50%;
  animation: fl-spin 0.7s linear infinite;
}

@keyframes fl-spin {
  to { transform: rotate(360deg); }
}

@media print {
  .main-header, .main-sidebar, .main-footer, .content-header button, .box-tools, .fl-page-loader {
    display: none !important;
  }
  .content-wrapper {
    margin-left: 0 !important;
    background: #fff !important;
  }
  .content .table {
    width: 100% !important;
    min-width: 0 !important;
  }
  .content .table > thead > tr > th,
  .content .table > tbody > tr > th,
  .content .table > tfoot > tr > th,
  .content .table > thead > tr > td,
  .content .table > tbody > tr > td,
  .content .table > tfoot > tr > td {
    white-space: normal !important;
  }
  .content .box-body,
  .content .table-responsive {
    max-height: none !important;
    overflow: visible !important;
  }
  .content .table > thead > tr > th {
    position: static !important;
  }
}
