/* Zabbix-like Dense Styled Variables (AdminKit colors) */
:root {
  --bs-blue: #3b7ddd;
  --bs-indigo: #6610f2;
  --bs-purple: #6f42c1;
  --bs-pink: #d63384;
  --bs-red: #dc3545;
  --bs-orange: #fd7e14;
  --bs-yellow: #fcb92c;
  --bs-green: #1cbb8c;
  --bs-teal: #20c997;
  --bs-cyan: #0ea5e9;
  --bs-white: #fff;
  --bs-gray: #6c757d;
  --bs-gray-dark: #343a40;
  --bs-primary: #0ea5e9;
  --bs-secondary: #6c757d;
  --bs-success: #1cbb8c;
  --bs-info: #0ea5e9;
  --bs-warning: #fcb92c;
  --bs-danger: #dc3545;
  --bs-light: #f8f9fa;
  --bs-dark: #343a40;
  --sidebar-bg: #222e3c;
  --sidebar-color: #e9ecef;
  --card-bg: #ffffff;
  --card-border: #dee2e6;
  --card-shadow: none;
  --body-bg: #f5f7fb;
  --body-color: #343a40;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--body-bg);
  color: var(--body-color);
  font-size: 0.8125rem;
  /* Zabbix uses smaller text ~13px */
  margin: 0;
}

/* Layout */
.wrapper {
  display: flex;
  width: 100%;
  align-items: stretch;
  overflow-x: hidden;
}

.main {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  transition: margin-left .35s ease-in-out, left .35s ease-in-out, margin-right .35s ease-in-out, right .35s ease-in-out;
}

.content {
  padding: 1.5rem 1.5rem 1.5rem;
  flex: 1;
  direction: ltr;
}

/* Sidebar */
.sidebar {
  min-width: 260px;
  max-width: 260px;
  direction: ltr;
  background: var(--sidebar-bg);
  min-height: 100vh;
  z-index: 1000;
}

.sidebar-content {
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.sidebar-brand {
  font-weight: 600;
  font-size: 1.15rem;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  color: #f8f9fa;
  text-decoration: none;
  border-bottom: 1px solid #1c2631;
}

.sidebar-brand:hover {
  color: #f8f9fa;
  text-decoration: none;
}

.sidebar-nav {
  padding-left: 0;
  list-style: none;
}

.sidebar-header {
  background: transparent;
  padding: 1.5rem 1.5rem .375rem;
  font-size: .65rem;
  color: #ced4da;
  text-transform: uppercase;
}

.sidebar-item.active .sidebar-link {
  color: #e9ecef;
  background: #1c2631;
  border-left-color: var(--bs-primary);
}

.sidebar-link,
a.sidebar-link {
  display: block;
  padding: .475rem 1.5rem;
  font-weight: 400;
  transition: background .1s ease-in-out;
  position: relative;
  text-decoration: none;
  cursor: pointer;
  color: rgba(233, 236, 239, 0.5);
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: rgba(233, 236, 239, 0.75);
  background: #222e3c;
  outline: 0;
}

.sidebar-link svg,
.sidebar-link .feather {
  margin-right: .5rem;
  color: rgba(233, 236, 239, 0.5);
  width: 16px;
  height: 16px;
}

/* Navbar */
.navbar-bg {
  background: var(--bs-white);
}

.navbar-expand {
  flex-wrap: nowrap;
  justify-content: flex-start;
  padding: .5rem 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  /* very subtle */
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Breadcrumb Zabbix Style */
.breadcrumb-container {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
}

.breadcrumb {
  margin-bottom: 0;
  font-size: 0.85rem;
  font-weight: 500;
}

.breadcrumb-item+.breadcrumb-item::before {
  content: "»";
  /* slightly sharper separator */
}

.breadcrumb-item a {
  color: var(--bs-primary);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-title {
  margin-top: 0.2rem;
  font-size: 1.35rem;
  font-weight: 600;
  color: #343a40;
}

/* In-app messages */
#app-message-region {
  margin-bottom: 1rem;
}

.app-message {
  border: 1px solid var(--card-border);
  border-left-width: 4px;
  background: #fff;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  box-shadow: none;
}

.app-message-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.app-message-body {
  font-size: 0.8125rem;
  color: #495057;
}

.app-message-info {
  border-left-color: var(--bs-info);
  background: #f4fbfd;
}

.app-message-success {
  border-left-color: var(--bs-success);
  background: #f3fcf8;
}

.app-message-warning {
  border-left-color: var(--bs-warning);
  background: #fff9ee;
}

.app-message-danger {
  border-left-color: var(--bs-danger);
  background: #fff5f5;
}

/* Cards (Zabbix Data Widgets) */
.card {
  box-shadow: var(--card-shadow);
  margin-bottom: 1.25rem;
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  background-clip: border-box;
  border-radius: 2px;
  /* extremely small border radius */
  display: flex;
  flex-direction: column;
}

.card-header {
  background-color: #fcfcfc;
  border-bottom: 1px solid var(--card-border);
  padding: .5rem .75rem;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--body-color);
  margin-bottom: 0;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(180deg, #eef3fb 0%, #f7f9fc 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--card-border);
  background: #fff;
}

.auth-brand {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--bs-primary);
}

.card-body {
  flex: 1 1 auto;
  padding: .75rem .75rem;
}

/* Forms & Buttons Zabbix-compact */
.form-control,
.btn {
  border-radius: 2px;
  font-size: 0.8125rem;
}

.btn-sm {
  padding: 0.2rem 0.5rem;
}

.form-control {
  padding: 0.35rem 0.6rem;
}

/* Zabbix Matrices (Tables) */
.table {
  font-size: 0.8125rem;
  margin-bottom: 0;
}

.table> :not(caption)>*>* {
  padding: .35rem .5rem;
}

.table-bordered th,
.table-bordered td {
  border: 1px solid #e9ecef;
}

.table thead th {
  background-color: #f4f5f8;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: #495057;
}

tbody tr {
  transition: background-color 0.15s ease-in-out;
}

/* Zabbix Problem Severity Tags (Badges) */
.badge {
  border-radius: 2px !important;
  /* Force square */
  font-weight: 500;
  padding: 0.25em 0.45em;
  font-size: 10px;
  text-transform: uppercase;
}

/* Tunnels and Dashboard specific elements */
.stat {
  align-items: center;
  background: transparent;
  border: 1px solid #dee2e6;
  border-radius: 2px;
  display: flex;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.stat svg {
  height: 18px;
  width: 18px;
  color: var(--bs-primary);
}

.stat.success {
  border-color: var(--bs-success);
  background: #f0fdf4;
}

.stat.success svg {
  color: var(--bs-success);
}

.stat.warning {
  border-color: var(--bs-warning);
  background: #fffbeb;
}

.stat.warning svg {
  color: var(--bs-warning);
}

/* Timeline/Events */
.list-group-flush>.list-group-item {
  border-width: 0 0 1px;
}

.list-group-item {
  background-color: transparent;
  border: 1px solid rgba(0, 0, 0, .125);
  display: block;
  padding: .35rem .75rem;
  /* Tighter padding */
  text-decoration: none;
}

/* Utilities */
.fade-in {
  animation: fadeIn ease 0.5s;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}