:root {
  --brand-deep: #12324a;
  --brand-mid: #0f766e;
  --brand-accent: #c2410c;
  --ink: #1f3444;
  --muted: #5f7484;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-border: #d4e2ec;
  --surface: #eef3f7;
  --shadow-soft: 0 10px 22px rgba(12, 35, 54, 0.1);
}

html,
body {
  min-height: 100%;
}

body.app-shell {
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Segoe UI', sans-serif;
  color: var(--ink);
  background: linear-gradient(150deg, #f7fbff 0%, #edf4fa 46%, #f7f4ee 100%);
}

#app.app-frame {
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Georgia', 'Palatino Linotype', serif;
  color: var(--brand-deep);
  letter-spacing: 0.2px;
}

.app-topbar {
  background:
    linear-gradient(115deg, rgba(18, 50, 74, 0.94), rgba(15, 118, 110, 0.9)),
    url('../img/nav1.jpeg') center/cover;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f4fbff !important;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand-avatar {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 18px rgba(8, 20, 34, 0.35);
}

.brand-title {
  font-size: 1.03rem;
}

.app-toggler {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.15);
}

.app-user-nav .nav-link {
  color: #f3f9ff !important;
}

.app-user-nav .dropdown-menu {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.45);
}

.app-date {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
  letter-spacing: 0.2px;
}

.app-content {
  padding: 0.8rem 0.9rem 1.6rem;
}

.app-content .container-fluid {
  padding-left: 0.8rem;
  padding-right: 0.8rem;
}

.app-sidebar-wrap {
  margin-bottom: 0.9rem;
}

#sidebarMenu.app-sidebar {
  position: sticky;
  top: 84px;
  height: calc(100vh - 96px);
  overflow-y: auto;
  border-radius: 18px;
  background: linear-gradient(170deg, rgba(20, 48, 74, 0.93), rgba(10, 97, 90, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.17);
  box-shadow: 0 16px 36px rgba(12, 35, 54, 0.2);
  padding-top: 0;
}

#sidebarMenu .position-sticky {
  padding: 1rem 0.75rem 1.2rem;
}

.sidebar-label {
  margin: 0.4rem 0.85rem 0.9rem;
  color: rgba(240, 251, 255, 0.78);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  font-weight: 700;
}

#sidebarMenu .nav-link {
  margin: 0.12rem 0.38rem;
  border-radius: 12px;
  color: rgba(244, 251, 255, 0.86);
  padding: 0.64rem 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.08s linear, color 0.08s linear;
}

#sidebarMenu .nav-link .feather {
  color: rgba(181, 230, 220, 0.95);
}

#sidebarMenu .nav-link:hover,
#sidebarMenu .nav-link.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  text-decoration: none;
}

#sidebarMenu .dropdown-menu {
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-soft);
}

.app-content .row > main[class*='col-'] {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 1.35rem !important;
}

.card {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(15, 37, 55, 0.1);
  overflow: hidden;
}

.card-header {
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(140deg, #f8fcff, #edf6f2);
  font-weight: 700;
  color: var(--brand-deep);
}

.card-body {
  background: rgba(255, 255, 255, 0.9);
}

.auth-screen {
  min-height: calc(100vh - 140px);
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.auth-screen .row {
  width: 100%;
}

.auth-screen [class*='col-'] {
  max-width: 560px;
}

.auth-card {
  width: 100%;
  border-radius: 20px;
}

.auth-subtitle {
  color: var(--muted);
  margin-bottom: 1rem;
}

.form-control,
.custom-select,
select,
textarea {
  border-radius: 12px;
  border: 1px solid #ccd9e4;
  background: #fcfeff;
  transition: border-color 0.08s linear, box-shadow 0.08s linear;
}

.fade,
.collapsing,
.modal.fade .modal-dialog {
  transition: none !important;
}

.form-control:focus,
.custom-select:focus,
select:focus,
textarea:focus {
  border-color: rgba(15, 118, 110, 0.6);
  box-shadow: 0 0 0 0.18rem rgba(15, 118, 110, 0.14);
}

.btn {
  border-radius: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 0.5rem 0.95rem;
}

.btn-primary {
  border-color: #0f766e;
  background: linear-gradient(120deg, #0f766e, #0c5d7a);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: #0c5d7a;
  background: linear-gradient(120deg, #0c5d7a, #0a4f69);
}

.btn-secondary {
  background: #315872;
  border-color: #315872;
}

.btn-warning {
  color: #fff;
  border-color: #c2410c;
  background: #c2410c;
}

.btn-warning:hover,
.btn-warning:focus {
  color: #fff;
  border-color: #a33609;
  background: #a33609;
}

.table-responsive {
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: #fff;
  padding: 0.35rem;
}

.table {
  margin-bottom: 0;
}

.table thead th {
  background: #eff5fb;
  border-bottom-width: 1px;
  color: #284559;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table td,
.table th {
  border-color: #e2ebf2;
  vertical-align: middle;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border-radius: 10px;
  border: 1px solid #ccd9e4;
  background: #fff;
  padding: 0.24rem 0.5rem;
}

.dropdown-menu {
  border-radius: 12px;
}

@media (max-width: 991.98px) {
  .app-content {
    padding: 0.65rem 0.5rem 1.2rem;
  }

  .app-content .container-fluid {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }

  #sidebarMenu.app-sidebar {
    position: fixed;
    top: 72px;
    left: 0.6rem;
    height: calc(100vh - 84px);
    width: min(82vw, 290px);
    z-index: 1040;
  }

  .app-content .row > main[class*='col-'] {
    margin-top: 0.3rem;
    border-radius: 14px;
    padding: 1rem !important;
  }

  .brand-title {
    font-size: 0.95rem;
  }
}

.crud-modal-frame {
  display: block;
  width: 100%;
  min-height: 78vh;
  border: 0;
}

body.embed-mode {
  background: #f4f8fb;
}

body.embed-mode .app-content {
  padding: 0.35rem 0.45rem 0.7rem !important;
}

body.embed-mode #sidebarMenu.app-sidebar,
body.embed-mode .app-topbar {
  display: none !important;
}

body.embed-mode .container,
body.embed-mode .container-fluid,
body.embed-mode .container-sm,
body.embed-mode .container-md,
body.embed-mode .container-lg,
body.embed-mode .container-xl,
body.embed-mode .container-xxl {
  max-width: 100% !important;
}

body.embed-mode .row.justify-content-center {
  justify-content: flex-start !important;
}

body.embed-mode .row > [class*='col-'] {
  flex: 0 0 100%;
  max-width: 100%;
}

body.embed-mode .app-content .row > main[class*='col-'] {
  flex: 0 0 100%;
  max-width: 100%;
  margin-left: 0;
}

.dash-kpis {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  margin-bottom: 0.95rem;
}

.dash-kpi {
  border: 1px solid #d8e4ee;
  border-radius: 14px;
  background: linear-gradient(150deg, #fafdff, #edf5fb);
  padding: 0.9rem 0.95rem;
}

.dash-kpi-label {
  margin: 0;
  color: #547187;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dash-kpi-value {
  margin: 0.28rem 0 0;
  font-family: 'Georgia', 'Palatino Linotype', serif;
  font-size: 1.55rem;
  line-height: 1.15;
  color: #12324a;
}

.dash-kpi-success .dash-kpi-value {
  color: #15803d;
}

.dash-kpi-info .dash-kpi-value {
  color: #0c5d7a;
}

.dash-kpi-warning .dash-kpi-value {
  color: #b45309;
}

.dash-kpi-danger .dash-kpi-value {
  color: #b91c1c;
}

.dash-grid {
  display: grid;
  gap: 0.95rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dash-panel {
  border: 1px solid #d8e4ee;
  border-radius: 14px;
  background: #ffffff;
  padding: 0.8rem;
}

.dash-panel-wide {
  grid-column: 1 / -1;
}

.dash-panel-header h3 {
  margin: 0;
  font-size: 1.02rem;
  color: #12324a;
}

.dash-panel-header p {
  margin: 0.18rem 0 0.6rem;
  color: #5f7484;
  font-size: 0.82rem;
}

.dash-chart {
  min-height: 330px;
}

.dash-chart-small {
  min-height: 300px;
}

.dash-mini-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 0.7rem;
  margin-top: 0.95rem;
}

.dash-mini-item {
  border: 1px dashed #c6d6e2;
  border-radius: 12px;
  padding: 0.62rem 0.72rem;
  background: #f9fcff;
}

.dash-mini-item span {
  display: block;
  color: #5f7484;
  font-size: 0.75rem;
}

.dash-mini-item strong {
  display: block;
  margin-top: 0.12rem;
  color: #12324a;
  font-size: 1rem;
}

@media (max-width: 991.98px) {
  .dash-kpis {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .dash-panel-wide {
    grid-column: auto;
  }

  .dash-chart,
  .dash-chart-small {
    min-height: 280px;
  }

  .dash-mini-summary {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }
}
