:root {
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-muted: #eef2f7;
  --line: #d9e0ea;
  --text: #182230;
  --muted: #667085;
  --blue: #2563eb;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --indigo: #4f46e5;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

body {
  background: var(--surface-soft);
  color: var(--text);
  letter-spacing: 0;
}

.content-wrapper {
  background: var(--surface-soft);
  padding: 22px;
}

.main-header,
.main-header .navbar,
.main-header .logo {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

.main-header .logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-header .logo img {
  margin-top: 0 !important;
  max-width: 150px;
  object-fit: contain;
}

.navbar-custom-menu .top-nav > li > a {
  min-width: 42px;
  text-align: center;
}

.notification-menu {
  width: 340px;
  max-height: 380px;
  overflow-y: auto;
  padding: 8px 0;
}

.notification-menu > li > a {
  white-space: normal;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
}

.main-sidebar .sidebar-menu > li > a {
  border-left: 3px solid transparent;
  font-weight: 600;
}

.main-sidebar .sidebar-menu > li.active > a,
.main-sidebar .sidebar-menu > li > a.active {
  border-left-color: var(--green);
}

.page-title {
  min-height: 0;
  margin: 0 0 18px;
  padding: 0;
  border-bottom: 0;
}

.page-title h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.card,
.panel,
.module-card,
.module-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.card {
  padding: 18px;
  margin-bottom: 18px;
}

.panel {
  overflow: hidden;
}

.panel-heading {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 6px 6px 0 0;
  padding: 14px 18px;
}

.panel-title,
.card h4,
.module-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.panel-body {
  padding: 18px;
}

.module-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.module-shell-wide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.module-panel {
  padding: 18px;
}

.module-panel-muted {
  background: #fbfcfe;
}

.module-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.module-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.module-title-row h3,
.module-title-row h4 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}

.module-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.module-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.module-stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.module-stat b {
  display: block;
  font-size: 20px;
  color: var(--text);
}

.module-stat span {
  color: var(--muted);
  font-size: 12px;
}

.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-control {
  min-height: 38px;
  border-color: #cfd8e3;
  border-radius: 4px;
  box-shadow: none;
  color: var(--text);
}

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea.form-control {
  min-height: 86px;
  resize: vertical;
}

.m-b-10 {
  margin-bottom: 10px;
}

.m-t-20 {
  margin-top: 20px;
}

.btn {
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: none;
}

.btn-primary {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
}

.btn-success {
  background: var(--green) !important;
  border-color: var(--green) !important;
}

.btn-warning {
  background: var(--amber) !important;
  border-color: var(--amber) !important;
}

.btn-danger {
  background: var(--red) !important;
  border-color: var(--red) !important;
}

.btn-info {
  background: var(--indigo) !important;
  border-color: var(--indigo) !important;
}

.btn-icon,
.btn-xs,
.btn-sm {
  border-radius: 4px;
}

.table {
  background: var(--surface);
  border-collapse: separate;
  border-spacing: 0;
}

.table > thead > tr > th {
  background: #f2f5f9;
  border-bottom: 1px solid var(--line);
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.table > tbody > tr > td {
  border-top: 1px solid #edf1f6;
  color: #344054;
  vertical-align: middle;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #fbfcfe;
}

.table-hover > tbody > tr:hover,
.table > tbody > tr.info > td {
  background: #eef6ff;
}

.label {
  border-radius: 4px;
  font-weight: 700;
  padding: 5px 8px;
}

.label-info {
  background: #dbeafe;
  color: #1d4ed8;
}

.label-success {
  background: #dcfce7;
  color: #047857;
}

.label-warning {
  background: #fef3c7;
  color: #b45309;
}

.label-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.dataTables_wrapper {
  padding: 0;
}

.dataTables_filter input,
.inventory-search,
.warranty-filter {
  border-radius: 4px;
  border: 1px solid #cfd8e3;
  min-height: 36px;
}

.dt-buttons .btn {
  margin-right: 6px;
  margin-bottom: 8px;
}

.widget-small {
  min-height: 104px;
  border-radius: 6px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  overflow: hidden;
}

.widget-small .icon {
  min-width: 88px;
}

.widget-small .info h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.widget-small .info p {
  font-size: 26px;
  color: var(--text);
}

.alert {
  border-radius: 6px;
  border-width: 1px;
}

code,
pre {
  white-space: normal;
  word-break: break-word;
  border-radius: 4px;
}

.barcode-label {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 18px;
  border: 2px solid #111827;
  font-family: "Courier New", monospace;
  font-size: 24px;
  letter-spacing: 3px;
  background: repeating-linear-gradient(90deg, #111827 0, #111827 2px, #fff 2px, #fff 5px);
  color: transparent;
  text-shadow: 0 38px 0 #111827;
  min-height: 62px;
}

.label-preview {
  padding: 22px;
  border: 1px dashed #98a2b3;
  border-radius: 6px;
  background: #fbfcfe;
}

.quick-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.quick-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.quick-list li:last-child {
  border-bottom: 0;
}

.compact-panel {
  box-shadow: none;
  margin-bottom: 0;
  padding: 12px 14px;
}

.setting-toggle {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  margin: 0 18px 10px 0;
  font-weight: 600;
}

.grouped-sidebar .nav-section {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 18px 22px 6px;
  text-transform: uppercase;
}

.grouped-sidebar > li > a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
}

.grouped-sidebar > li > a > i:first-child {
  flex: 0 0 22px;
  text-align: center;
}

.sidebar-collapse .grouped-sidebar .nav-section {
  display: none;
}

.global-search {
  position: relative;
  margin-top: 9px;
  width: 360px;
}

.topbar-search-wrap {
  color: #fff;
  margin-top: 0;
}

.global-search > i {
  color: var(--muted);
  left: 13px;
  position: absolute;
  top: 11px;
  z-index: 2;
}

.global-search input {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  color: var(--text);
  height: 38px;
  outline: 0;
  padding: 0 12px 0 38px;
  width: 100%;
}

#global-search-results {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  display: none;
  left: 0;
  margin-top: 8px;
  max-height: 360px;
  overflow-y: auto;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 1035;
}

#global-search-results a,
.empty-search {
  display: block;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

#global-search-results a {
  color: var(--text);
}

#global-search-results a:hover {
  background: var(--surface-soft);
}

#global-search-results strong {
  display: block;
}

#global-search-results span,
.empty-search {
  color: var(--muted);
  font-size: 12px;
}

.kanban-toolbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.kanban-board {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.kanban-column {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 320px;
  padding: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.kanban-column.is-over {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.kanban-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kanban-header h4 {
  font-size: 13px;
  font-weight: 800;
  margin: 0;
  text-transform: uppercase;
}

.kanban-count {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  cursor: grab;
  margin-bottom: 10px;
  padding: 12px;
}

.kanban-card.is-dragging {
  opacity: 0.55;
}

.kanban-card h5 {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 8px;
}

.kanban-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 8px;
  margin-bottom: 10px;
}

.kanban-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timeline {
  border-left: 2px solid var(--line);
  margin: 18px 0 0 12px;
  padding-left: 22px;
}

.timeline-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  margin-bottom: 12px;
  padding: 13px 14px;
  position: relative;
}

.timeline-dot {
  background: var(--blue);
  border: 3px solid var(--surface-soft);
  border-radius: 50%;
  height: 14px;
  left: -30px;
  position: absolute;
  top: 16px;
  width: 14px;
}

.timeline-dot.service {
  background: var(--amber);
}

.timeline-dot.assignment {
  background: var(--green);
}

.timeline-dot.document {
  background: var(--indigo);
}

.timeline-dot.maintenance {
  background: var(--red);
}

.timeline-item h4 {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 6px;
}

.timeline-item p {
  color: var(--muted);
  margin: 0;
}

.fa-handshake-o:before {
  content: "\f0ea";
}

.fa-calendar-check-o:before {
  content: "\f073";
}

body[data-theme="dark"] {
  --surface: #111827;
  --surface-soft: #0b1220;
  --surface-muted: #1f2937;
  --line: #273449;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --blue: #60a5fa;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --indigo: #a78bfa;
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}

body[data-theme="dark"] .main-header .navbar,
body[data-theme="dark"] .main-header .logo,
body[data-theme="dark"] .main-sidebar,
body[data-theme="dark"] .left-side {
  background: #0f172a !important;
}

body[data-theme="dark"] .sidebar-menu > li > a,
body[data-theme="dark"] .treeview-menu > li > a,
body[data-theme="dark"] .main-header .navbar .sidebar-toggle,
body[data-theme="dark"] .top-nav > li > a {
  color: #dbe4f0 !important;
}

body[data-theme="dark"] .sidebar-menu > li.active > a,
body[data-theme="dark"] .sidebar-menu > li > a:hover,
body[data-theme="dark"] .treeview-menu {
  background: #111827 !important;
}

body[data-theme="dark"] .form-control,
body[data-theme="dark"] .select2-choice,
body[data-theme="dark"] .select2-container .select2-choice,
body[data-theme="dark"] .global-search input {
  background: #0f172a;
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="dark"] .table > thead > tr > th {
  background: #182338;
  color: #dbe4f0;
}

body[data-theme="dark"] .table > tbody > tr > td {
  border-top-color: var(--line);
  color: #d1d5db;
}

body[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd),
body[data-theme="dark"] .quick-list li,
body[data-theme="dark"] .barcode-label {
  background-color: #101827;
}

body[data-theme="dark"] .table-hover > tbody > tr:hover,
body[data-theme="dark"] .table > tbody > tr.info > td,
body[data-theme="dark"] #global-search-results a:hover {
  background: #182338;
}

body[data-theme="dark"] .dropdown-menu,
body[data-theme="dark"] .modal-content,
body[data-theme="dark"] .panel-color .panel-heading {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

body[data-theme="dark"] .label-info {
  background: rgba(96, 165, 250, 0.18);
  color: #bfdbfe;
}

body[data-theme="dark"] .label-success {
  background: rgba(52, 211, 153, 0.18);
  color: #bbf7d0;
}

body[data-theme="dark"] .label-warning {
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
}

body[data-theme="dark"] .label-danger {
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
}

.login-content .login-box,
.wrapper-page .card-box {
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.login-form .form-control,
.forget-form .form-control {
  border-radius: 4px;
}

@media (max-width: 991px) {
  .module-shell,
  .module-shell-wide {
    grid-template-columns: 1fr;
  }

  .kanban-board {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 767px) {
  .content-wrapper {
    padding: 12px;
  }

  .page-title h1 {
    font-size: 19px;
  }

  .card,
  .panel-body,
  .module-panel {
    padding: 14px;
  }

  .module-stat-grid {
    grid-template-columns: 1fr;
  }

  .table {
    display: block;
    width: 100%;
    overflow-x: auto;
  }

  .btn-group,
  .btn {
    margin-bottom: 4px;
  }

  .widget-small {
    margin-bottom: 10px;
  }

  .notification-menu {
    width: 290px;
  }

  .global-search {
    margin: 8px 10px;
    width: calc(100vw - 92px);
  }

  .kanban-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .kanban-board {
    grid-template-columns: 1fr;
  }
}
