/* Global Design System - Modern light SaaS */
:root {
  --bg: #f4f7f6 !important;
  --panel: #ffffff !important;
  --panel-2: #ffffff !important;
  --text: #233446 !important;
  --muted: #6f8092 !important;
  --border: #d9e2ea !important;
  --heading: #1d2e40 !important;
  --link: #1368a3 !important;
  --note: #6f8092 !important;
  --time: #4f6176 !important;
  --dev: #2f4f6d !important;
  --ok: #1f8f58 !important;
  --warn: #b88318 !important;
  --err: #c2372f !important;
  --info: #246a93 !important;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
}

.container-fluid {
  width: 100%;
  max-width: 1900px;
  margin-inline: auto;
  padding: 16px clamp(10px, 1.2vw, 22px) 24px !important;
}

h1,
h2,
h3,
h4,
h5,
.section-title,
.card-title {
  color: var(--heading) !important;
}

.subtitle,
.text-muted,
.small.text-muted,
.note,
.helper,
.form-text {
  color: var(--muted) !important;
}

a,
a:hover {
  color: var(--link);
}

/* Header / top bar */
body .dashboard-topbar {
  background: #ffffff !important;
  border: 0 !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
  padding: 12px 14px !important;
}

body .dashboard-topbar h1 {
  color: var(--heading) !important;
  margin-bottom: 2px !important;
}

body .dashboard-topbar .subtitle {
  color: var(--muted) !important;
}

body .topbar-actions {
  gap: 0.5rem !important;
}

/* Surfaces */
body .card,
body .section-block,
body .status-card,
body .today-card,
body .model-card,
body .log-card,
body .progress-card,
body .app-item,
body .modal-box,
body .list-group-item,
body .transfer-pane,
body .nav-card {
  background: #ffffff !important;
  border: 0 !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

body .section-block {
  padding: 14px !important;
}

/* Chips / quick nav buttons */
body .chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff !important;
  color: #32465c !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

body .chip:hover {
  transform: translateY(-1px);
  background: #f8fafc !important;
  border-color: #c8d4e0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

body .chip-danger {
  background: #fff6f5 !important;
  border-color: #f2c5c2 !important;
  color: #ac2e28 !important;
}

body .chip-danger:hover {
  background: #ffeceb !important;
  border-color: #e9afab !important;
}

body .user-pill {
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  color: #41586f !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

/* Dashboard navigation cards/buttons */
body .module-grid .btn {
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

body .module-grid .btn:hover {
  transform: translateY(-1px);
  background: #f8fafc !important;
  border-color: #c8d4e0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

body .module-grid .modtxt strong {
  color: #203449 !important;
}

body .module-grid .modtxt small {
  color: #6f8092 !important;
}

/* Status cards */
body .status-grid .status-card {
  color: var(--text) !important;
}

body .status-grid .status-card .label {
  color: var(--muted) !important;
}

/* Tables */
body .table {
  --bs-table-bg: transparent !important;
  color: var(--text) !important;
}

body .table > :not(caption) > * > * {
  background-color: transparent !important;
}

body .table thead th {
  background: #f8fafc !important;
  color: #2e4358 !important;
  border-bottom: 1px solid #dce5ee !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

body .table tbody tr td {
  border-top: 1px solid #e8eef4 !important;
}

body .table td,
body .table th {
  color: var(--text) !important;
}

body .table-light > :not(caption) > * > * {
  --bs-table-bg: #f8fafc !important;
  color: #2e4358 !important;
}

/* Buttons */
body .btn {
  border-radius: 6px !important;
  transition: all 0.16s ease !important;
}

body .btn-primary {
  background: #0f7fb7 !important;
  border-color: #0b6a98 !important;
}

body .btn-primary:hover {
  background: #0d709f !important;
  border-color: #095d87 !important;
}

body .btn-success {
  border-radius: 6px !important;
}

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

body .btn-secondary,
body .btn-outline-secondary {
  background: transparent !important;
  border: 1px solid #c5cfda !important;
  color: #4d6177 !important;
}

body .btn-secondary:hover,
body .btn-outline-secondary:hover {
  background: #eef3f8 !important;
  border-color: #b4c1cf !important;
  color: #2f445a !important;
}

/* Table actions: ghost style */
body .table .btn-action,
body table .btn-action {
  background: transparent !important;
  border: 0 !important;
  color: #50657b !important;
  box-shadow: none !important;
  min-width: 34px !important;
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border-radius: 6px !important;
}

body .table .btn-primary.btn-action,
body table .btn-primary.btn-action {
  color: #2c6aa3 !important;
}

body .table .btn-danger.btn-action,
body table .btn-danger.btn-action {
  color: #c2372f !important;
}

body .table .btn-action:hover,
body table .btn-action:hover {
  background: #eef3f8 !important;
  color: #27455f !important;
}

/* Inputs */
body .form-control,
body .form-select,
body textarea,
body .searchbox,
body .search-input,
body .filter-input {
  background: #ffffff !important;
  color: var(--text) !important;
  border: 1px solid #d2dce6 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}

body .form-control::placeholder,
body textarea::placeholder,
body .searchbox::placeholder,
body .search-input::placeholder,
body .filter-input::placeholder {
  color: #8b9bad !important;
}

body .form-control:focus,
body .form-select:focus,
body textarea:focus,
body .searchbox:focus,
body .search-input:focus,
body .filter-input:focus {
  border-color: #0f7fb7 !important;
  box-shadow: 0 0 0 0.14rem rgba(15, 127, 183, 0.2) !important;
  background: #ffffff !important;
}

body .form-check-input {
  border: 1px solid #9fb2c5 !important;
}

body .form-check-input:checked {
  background-color: #0f7fb7 !important;
  border-color: #0f7fb7 !important;
}

/* Utility badges/pills */
body .tag,
body .status-pill,
body .role-badge,
body .os-pill,
body .badge-pill,
body .metric-pill,
body .app-order-badge {
  background: #edf3f8 !important;
  color: #2f4d63 !important;
  border: 1px solid #d1dce7 !important;
}

body .st-ok,
body .log-ok {
  color: #1f8f58 !important;
}

body .st-fail,
body .log-err {
  color: #c2372f !important;
}

body .st-run,
body .log-warn {
  color: #b88318 !important;
}

body .st-unk,
body .log-info {
  color: #246a93 !important;
}

body code,
body .device-code,
body .log-time,
body .time,
body .meta-code {
  color: #2f4f6d !important;
}

body .copy-btn {
  background: #ffffff !important;
  color: #587085 !important;
  border: 1px solid #c7d4df !important;
}

body .copy-btn:hover {
  color: #2f4d63 !important;
  border-color: #9fb3c4 !important;
}

body .progress {
  background: #e4edf5 !important;
  border: 1px solid #d0dce7 !important;
}

body .progress .progress-bar {
  color: #ffffff !important;
}

@media (max-width: 768px) {
  .container-fluid {
    padding: 12px !important;
  }
}
