/**
 * Admin Modern UI Overrides
 * Keeps all functionality; updates look only.
 */
:root {
  --admin-primary: #2563eb;
  --admin-primary-hover: #1d4ed8;
  --admin-sidebar-bg: #0f172a;
  --admin-sidebar-text: #e2e8f0;
  --admin-sidebar-hover: #1e293b;
  --admin-card-radius: 12px;
  --admin-card-shadow: 0 1px 3px rgba(0,0,0,.08);
  --admin-input-radius: 8px;
  --admin-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Typography */
body {
  font-family: var(--admin-font) !important;
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
}

/* Header */
.admin-modern .main-header {
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  border-bottom: none !important;
}
.admin-modern .main-header .navbar {
  min-height: 56px;
  background: #fff !important;
  border: none !important;
}
.admin-modern .main-header .logo {
  background: var(--admin-sidebar-bg) !important;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.admin-modern .main-header .logo .logo-mini,
.admin-modern .main-header .logo .logo-lg {
  color: #fff !important;
}
.admin-modern .main-header .logo .logo-mini {
  font-size: 16px;
}
.admin-modern .main-header .logo .logo-lg {
  font-size: 18px;
}
.admin-modern .main-header .sidebar-toggle {
  color: #64748b;
  padding: 18px 15px;
}
.admin-modern .main-header .user-image {
  border-radius: 10px;
}
.admin-modern .main-header .dropdown-toggle .hidden-xs {
  font-weight: 500;
  color: #334155;
}
.admin-modern .main-header .navbar-custom-menu > .navbar-nav > li > a {
  color: #475569;
}

/* Sidebar - modern dark */
.admin-modern .main-sidebar {
  background: var(--admin-sidebar-bg) !important;
  box-shadow: 2px 0 12px rgba(0,0,0,.08);
}
.admin-modern .sidebar-menu > li > a {
  color: var(--admin-sidebar-text) !important;
  padding: 12px 15px 12px 15px;
  border-radius: 8px;
  margin: 2px 10px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.admin-modern .sidebar-menu > li > a:hover {
  background: var(--admin-sidebar-hover) !important;
  color: #fff !important;
}
.admin-modern .sidebar-menu > li.active > a {
  background: var(--admin-primary) !important;
  color: #fff !important;
}
.admin-modern .sidebar-menu > li > a .fa {
  width: 20px;
  text-align: center;
  margin-right: 10px;
  opacity: .9;
}
.admin-modern .user-panel {
  padding: 16px 15px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-modern .user-panel .info a {
  color: var(--admin-sidebar-text) !important;
  font-weight: 500;
  font-size: 13px;
}
.admin-modern .sidebar-form,
.admin-modern .sidebar .sidebar-menu .treeview-menu {
  background: rgba(0,0,0,.15) !important;
}

/* Content area */
.admin-modern .content-main {
  background: #f1f5f9;
  min-height: calc(100vh - 100px);
}
.content-wrapper {
  background: transparent;
  min-height: 0;
}
.content-header {
  margin-bottom: 20px;
}
.content-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}
.breadcrumb {
  background: transparent !important;
  padding: 0;
  margin: 4px 0 0 0;
  font-size: 13px;
  color: #64748b;
}
.breadcrumb > li + li:before {
  color: #94a3b8;
}

/* Boxes / Cards */
.box {
  border: none !important;
  border-radius: var(--admin-card-radius);
  box-shadow: var(--admin-card-shadow);
  margin-bottom: 24px;
  overflow: hidden;
}
.box-warning {
  border-top: none !important;
}
.box .box-header {
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 18px;
  background: #fff;
}
.box .box-header .box-title {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}
.box .box-body {
  padding: 18px;
  background: #fff;
}
.box .box-body .form-group {
  margin-bottom: 16px;
}
.box .box-body .form-group label {
  font-weight: 500;
  color: #475569;
  margin-bottom: 6px;
  font-size: 13px;
}

/* Form controls */
.form-control {
  border-radius: var(--admin-input-radius) !important;
  border: 1px solid #e2e8f0 !important;
  padding: 8px 12px !important;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  border-color: var(--admin-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12) !important;
  outline: none !important;
}
select.form-control {
  appearance: auto;
  padding-right: 28px;
}

/* Buttons */
.btn {
  border-radius: var(--admin-input-radius) !important;
  font-weight: 500;
  padding: 8px 16px;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--admin-primary) !important;
  border-color: var(--admin-primary) !important;
}
.btn-primary:hover {
  background: var(--admin-primary-hover) !important;
  border-color: var(--admin-primary-hover) !important;
}
.btn-default {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
}
.btn-default:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}
.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px !important;
}

/* Tables */
.table {
  font-size: 13px;
}
.table > thead > tr > th {
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
  color: #475569;
  padding: 12px 14px;
  background: #f8fafc;
}
.table > tbody > tr > td {
  padding: 12px 14px;
  vertical-align: middle !important;
  border-color: #f1f5f9;
}
.table-striped > tbody > tr:nth-of-type(odd) {
  background: #fafbfc;
}
.table-bordered {
  border-radius: var(--admin-card-radius);
  overflow: hidden;
}
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td {
  border-color: #e2e8f0;
}

/* Content section spacing */
.content > .row {
  margin-left: -10px;
  margin-right: -10px;
}
.content > .row > [class*="col-"] {
  padding-left: 10px;
  padding-right: 10px;
}

/* Footer */
.main-footer {
  padding: 14px 18px;
  font-size: 13px;
  color: #64748b;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

/* Editable / links in table */
.table a:not(.btn) {
  color: var(--admin-primary);
  text-decoration: none;
  transition: color .15s;
}
.table a:not(.btn):hover {
  color: var(--admin-primary-hover);
  text-decoration: underline;
}

/* Modals (if used) */
.modal-content {
  border: none;
  border-radius: var(--admin-card-radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.modal-header {
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 20px;
}
.modal-body {
  padding: 20px;
}
.modal-footer {
  border-top: 1px solid #e2e8f0;
  padding: 14px 20px;
}

/* Content header actions */
.content-header h1 .btn,
.content-header .btn {
  margin-left: 8px;
  vertical-align: middle;
}
.content-header small {
  color: #64748b;
  font-weight: 400;
  margin-left: 8px;
}

/* Small tweaks */
hr {
  margin-top: 12px;
  margin-bottom: 12px;
  border-color: #e2e8f0;
}
.box-tools .btn {
  margin-left: 4px;
}
.modified, .normal {
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

/* ========== Enhanced modern UI ========== */
.admin-modern .content-wrapper {
  padding-left: 0;
  background: #f1f5f9;
}
.admin-modern .content {
  padding: 24px 20px 32px;
}
.admin-modern .content-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  padding: 0 0 16px;
  border-bottom: 1px solid #e2e8f0;
}
.admin-modern .content-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.admin-modern .breadcrumb {
  margin: 0;
  padding: 0;
  background: none !important;
  font-size: 13px;
}
.admin-modern .breadcrumb a {
  color: var(--admin-primary);
  text-decoration: none;
}
.admin-modern .breadcrumb a:hover {
  text-decoration: underline;
}
.admin-modern .breadcrumb > .active {
  color: #64748b;
}

/* Filter / form bar as card */
.admin-modern .box-warning .box-body {
  padding: 20px 22px;
}
.admin-modern .box-warning .box-body .form-group {
  margin-bottom: 14px;
}
.admin-modern .box-warning .box-body .form-group label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 6px;
}
.admin-modern .box-warning .box-body .btn-primary {
  margin-right: 8px;
}
.admin-modern .box-warning .box-body .btn + .btn {
  margin-left: 0;
}

/* Table card */
.admin-modern .box .box-header.with-border {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #fafbfc;
}
.admin-modern .box .box-header .box-title {
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
}
.admin-modern .box .box-body .table {
  margin-bottom: 0;
}
.admin-modern .table > tbody > tr:hover {
  background: #f8fafc !important;
}
.admin-modern .table-bordered > tbody > tr > td {
  vertical-align: middle !important;
}

/* Status badges in table header */
.admin-modern .modified {
  background: #ea580c !important;
  color: #fff !important;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
}
.admin-modern .normal {
  background: #16a34a !important;
  color: #fff !important;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
}

/* User dropdown */
.admin-modern .main-header .dropdown-menu {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.12);
  padding: 0;
  overflow: hidden;
}
.admin-modern .main-header .user-header {
  padding: 20px;
  text-align: center;
  background: linear-gradient(135deg, var(--admin-sidebar-bg) 0%, #1e293b 100%);
  color: #fff;
}
.admin-modern .main-header .user-body {
  padding: 12px;
}
.admin-modern .main-header .user-footer {
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.admin-modern .main-header .user-footer .btn-flat {
  border-radius: 8px;
  font-weight: 500;
}

/* Main footer */
.admin-modern .main-footer {
  padding: 16px 20px;
  font-size: 13px;
  color: #64748b;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}

/* Sidebar small fix */
.admin-modern .main-sidebar .sidebar-menu > li > a {
  font-size: 14px;
}

/* Print button in box header */
.admin-modern .box-tools {
  margin-top: 0;
}
.admin-modern .box-tools .btn-default {
  border-radius: 8px;
  font-weight: 500;
}

/* Card variants */
.admin-modern .admin-card-filters .box-body {
  border-radius: var(--admin-card-radius);
}
.admin-modern .admin-card-table .box-header {
  border-radius: var(--admin-card-radius) var(--admin-card-radius) 0 0;
}

/* In-content hr (no layout/function change) */
.admin-modern hr {
  margin-top: 10px;
  margin-bottom: 10px;
  border: 0;
  border-top: 1px solid #e2e8f0;
}
