:root {
  --ui-primary: #1f5fbf;
  --ui-primary-strong: #184d9e;
  --ui-primary-soft: #eaf2ff;
  --ui-bg: #f4f7fc;
  --ui-surface: #ffffff;
  --ui-border: #d9e2ef;
  --ui-text: #10243a;
  --ui-muted: #60758d;
  --ui-success: #178451;
  --ui-warning: #b7791f;
  --ui-danger: #bf3b3b;
  --ui-radius: 12px;
  --ui-shadow: 0 8px 22px rgba(16, 42, 73, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  background: linear-gradient(180deg, #f8faff 0%, var(--ui-bg) 38%, #eef3fa 100%);
  color: var(--ui-text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  margin: 0;
}

a {
  color: var(--ui-primary);
}

a:hover {
  color: var(--ui-primary-strong);
}

.container,
.container-fluid {
  padding-left: 18px;
  padding-right: 18px;
}

.custom-navbar {
  background: var(--ui-surface) !important;
  border-bottom: 1px solid var(--ui-border);
  box-shadow: 0 4px 16px rgba(17, 44, 77, 0.1) !important;
  backdrop-filter: saturate(1.15);
}

.custom-navbar .logo-img {
  max-height: 38px;
}

.custom-navbar .nav-link {
  border-radius: 10px;
  font-weight: 600;
  color: #294461 !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.custom-navbar .nav-link:hover,
.custom-navbar .nav-link:focus,
.custom-navbar .nav-link.active {
  background: var(--ui-primary-soft);
  color: var(--ui-primary) !important;
}

.custom-navbar .dropdown-menu {
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--ui-shadow);
}

.custom-navbar .dropdown-item {
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #314a63;
}

.custom-navbar .dropdown-item:hover,
.custom-navbar .dropdown-item:focus {
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
}

.tenant-badge {
  border-color: #bed2f4 !important;
  background: #eaf2ff !important;
  color: var(--ui-primary-strong) !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #122b44;
  letter-spacing: -0.01em;
}

p,
label,
small,
.text-muted {
  color: var(--ui-muted) !important;
}

.card,
.panel,
.widget,
.box,
.module-card,
.form-card,
.ex-card,
.sb-card,
.bc,
.table-wrap,
.dashboard-wrap > .panel,
.dashboard-wrap > .card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border) !important;
  border-radius: var(--ui-radius) !important;
  box-shadow: var(--ui-shadow);
}

.card-header,
.panel-heading,
.form-card-header,
.ex-card-header,
.fsec-head,
.panel-head,
.ch {
  background: linear-gradient(180deg, #f8fbff, #f1f6fd) !important;
  border-bottom: 1px solid var(--ui-border) !important;
}

.table,
table.tbl,
table.ptbl,
table.wtable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th,
table.tbl thead th,
table.ptbl thead th,
table.wtable thead th,
th {
  background: #eef4fc;
  color: #3e5873;
  border-bottom: 1px solid var(--ui-border) !important;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}

.table td,
table.tbl td,
table.ptbl td,
table.wtable td,
td {
  border-bottom: 1px solid #e7edf6;
  vertical-align: middle;
}

.table tbody tr:hover,
table.tbl tbody tr:hover,
table.ptbl tbody tr:hover,
table.wtable tbody tr:hover {
  background: #f7fbff;
}

.table-responsive,
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="password"],
textarea,
select {
  border: 1.5px solid var(--ui-border) !important;
  border-radius: 10px !important;
  background: #fbfdff;
  min-height: 40px;
  color: var(--ui-text);
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--ui-primary) !important;
  box-shadow: 0 0 0 3px rgba(31, 95, 191, 0.14) !important;
  background: #fff;
}

.btn,
button,
.mini-btn,
.mtab {
  border-radius: 10px;
  font-weight: 700;
}

.btn-primary,
.bb,
.bg,
.btn-send.blue,
.btn-send.green,
.mini-btn:not([style*="background:#ef4444"]) {
  background: var(--ui-primary) !important;
  border-color: var(--ui-primary) !important;
  color: #fff !important;
}

.btn-primary:hover,
.bb:hover,
.bg:hover,
.btn-send.blue:hover,
.btn-send.green:hover,
.mini-btn:hover {
  background: var(--ui-primary-strong) !important;
  border-color: var(--ui-primary-strong) !important;
}

.btn-outline-primary,
.bo {
  color: var(--ui-primary) !important;
  border-color: #adc4e8 !important;
  background: #fff !important;
}

.btn-outline-primary:hover,
.bo:hover {
  background: var(--ui-primary-soft) !important;
  border-color: var(--ui-primary) !important;
}

.badge,
.chip,
.stb,
.ls {
  border-radius: 999px !important;
}

.alert {
  border-radius: 10px;
}

.footer {
  margin-top: 28px;
  border-top: 1px solid var(--ui-border);
  background: #f7fafe !important;
}

img,
svg,
canvas,
video {
  max-width: 100%;
  height: auto;
}

@media (max-width: 992px) {
  .container,
  .container-fluid {
    padding-left: 14px;
    padding-right: 14px;
  }

  .custom-navbar .navbar-collapse {
    max-height: 78vh;
    overflow-y: auto;
    padding-bottom: 10px;
  }

  .custom-navbar .navbar-nav .nav-link {
    margin-bottom: 4px;
  }

  .card,
  .panel,
  .widget,
  .box,
  .module-card,
  .form-card,
  .ex-card,
  .sb-card {
    border-radius: 10px !important;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.35rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  h3 {
    font-size: 1.08rem;
  }

  .btn,
  .form-control,
  .form-select,
  input,
  select,
  textarea {
    min-height: 42px;
  }
}

@media (max-width: 576px) {
  .container,
  .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }
}
