@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  --surface: #ffffff;
  --surface-alt: #f9fafb;
  --bg: #f3f4f6;
  --border: #e5e7eb;
  --primary: #0d6efd;
  --primary-hover: #0b5ed7;
  --text-dark: #111827;
  --text-muted: #6b7280;
  --radius: 12px;
}

* {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text-dark);
  overflow-x: hidden;
}

/* ========= Layout ========= */
.layout {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  background: #111827;
  color: #fff;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  font-weight: 600;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.nav-section {
  margin-top: 10px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #d1d5db;
  border-radius: var(--radius);
  padding: 10px 12px;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-link.active {
  background: var(--primary);
  color: #fff;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ========= Cards ========= */
.card {
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  background: var(--surface);
}

.card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.card .card-footer {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
}

/* ========= Tables ========= */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table thead th {
  background: var(--surface-alt);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border);
}

.table td {
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background: #f9fafc;
}

.table td.text-truncate {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========= Badges ========= */
.badge {
  font-weight: 500;
  font-size: 0.8rem;
  padding: 0.4em 0.75em;
  border-radius: 999px;
}

/* ========= Forms ========= */
.input-group-text {
  background: var(--surface);
  border-right: 0;
}

.form-control, .form-select {
  border-radius: var(--radius);
}

/* ========= Buttons ========= */
.btn {
  border-radius: var(--radius);
  font-weight: 500;
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}

.btn-success {
  background: #16a34a;
  border: none;
}

.btn-success:hover {
  background: #15803d;
}

/* ========= Responsive ========= */
@media (max-width: 992px) {
  .sidebar {
    display: none;
  }
  .layout {
    flex-direction: column;
  }
}
/* Offcanvas (mobile sidebar) styling */
.offcanvas {
  background: #111827; /* same as desktop sidebar */
  color: #fff;
  width: 250px;
}

.offcanvas-header {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.offcanvas-title {
  color: #fff;
  font-weight: 600;
}

.offcanvas .btn-close {
  filter: invert(1); /* make the close button white */
}

.offcanvas .nav-link {
  color: #d1d5db;
  border-radius: 12px;
  padding: 10px 14px;
  margin: 2px 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.offcanvas .nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.offcanvas .nav-link.active {
  background: #0d6efd;
  color: #fff;
}
