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

:root {
  --blue: #1976d2;
  --blue-dark: #115293;
  --bg: #f5f6fa;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e0e3ea;
  --text-main: #1f2933;
  --text-muted: #6b7280;
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --shadow-soft: 0 4px 10px rgba(15, 23, 42, 0.08);
  --radius-lg: 14px;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background: var(--bg);
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */

.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 16px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.sidebar-title {
  font-weight: 700;
  font-size: 18px;
}

.sidebar-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-nav {
  padding: 8px 0;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  margin: 2px 8px;
}

.nav-link:hover {
  background: #eef2ff;
  color: var(--blue-dark);
}

.nav-link.is-active {
  background: var(--blue);
  color: #ffffff;
}

.nav-icon {
  width: 20px;
  text-align: center;
}

/* MAIN */

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

/* TOPBAR */

.topbar {
  height: 56px;
  background: var(--blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.topbar-title {
  font-weight: 600;
  font-size: 18px;
}

.user-chip { text-align: right; margin-right: 12px; }
.user-name { font-size: 14px; font-weight: 600; }
.user-meta { font-size: 12px; opacity: 0.9; }

.topbar-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: #ffffff;
  color: var(--blue-dark);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.topbar-btn:hover { background: #e5f0ff; }

/* CONTENT */

.content {
  padding: 18px;
}

/* CARDS */

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.flex {
  display: flex;
}

.muted {
  font-size: 13px;
  color: var(--text-muted);
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 6px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

th {
  background: #f3f4f6;
  white-space: nowrap;
}

/* BUTTONS */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--blue-dark);
}

/* FORMS */

input[type="text"],
input[type="password"],
input[type="datetime-local"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  font-family: inherit;
}

label { font-size: 13px; color: var(--text-muted); }

/* AUTH PAGE */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  border-radius: 16px;
  padding: 24px 22px;
  box-shadow: var(--shadow-soft);
}

/* ADAPTIVE */

@media (max-width: 900px) {
  .sidebar { display: none; }
  .layout { flex-direction: column; }
  .main { min-height: 100vh; }
}

@media (max-width: 600px) {
  .content { padding: 12px; }
}
.badge-green {
  display:inline-block;
  padding:2px 6px;
  border-radius:999px;
  background:#dcfce7;
  color:#166534;
  font-size:12px;
}

.badge-red {
  display:inline-block;
  padding:2px 6px;
  border-radius:999px;
  background:#fee2e2;
  color:#991b1b;
  font-size:12px;
}
