:root {
  --border: #d0d7de;
  --text: #1f2937;
  --muted: #6b7280;
  --bg: #f6f8fa;
  --accent: #0f766e;
}

* { box-sizing: border-box; }

body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

h1 { margin: 0 0 4px; font-size: 20px; }
.subtitle { margin: 0 0 20px; color: var(--muted); font-size: 13px; }

label { font-weight: 700; font-size: 13px; margin-bottom: 5px; display: block; }

input {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  background: var(--accent);
  color: white;
  width: 100%;
  font-size: 14px;
}

button:disabled { opacity: .6; cursor: default; }

.error {
  color: #991b1b;
  font-size: 13px;
  margin: -6px 0 14px;
  min-height: 16px;
}

body.dashboard-page {
  display: block;
  min-height: 100vh;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  flex-wrap: wrap;
}

.app-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header .brand img {
  height: 44px;
  width: auto;
}

.app-header .brand-text b {
  display: block;
  font-size: 17px;
}

.app-header .brand-text span {
  font-size: 12px;
  color: var(--muted);
}

.app-header .session {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}

.app-header .session button {
  width: auto;
  padding: 8px 14px;
  background: #e5e7eb;
  color: var(--text);
}

.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 28px;
}

.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  width: auto;
  background: none;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px 8px 0 0;
  border-bottom: 3px solid transparent;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--accent);
  background: #f0fdfa;
  border-bottom: 3px solid var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.list-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.list-toolbar .search-input {
  flex: 1;
  margin-bottom: 0;
}

.list-toolbar .sort-btn {
  width: auto;
  flex: none;
  padding: 9px 14px;
  background: #e5e7eb;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: white;
  font-size: 13px;
  line-height: 1.4;
}

.item-card-clickable {
  cursor: pointer;
}

.item-card-clickable:hover {
  border-color: var(--accent);
  background: #f0fdfa;
}

.hidden {
  display: none !important;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.overlay-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.overlay-header h2 {
  margin: 0;
  font-size: 18px;
}

.gray-btn {
  width: auto;
  padding: 8px 14px;
  background: #e5e7eb;
  color: var(--text);
}

.danger-btn {
  width: auto;
  padding: 6px 10px;
  font-size: 12px;
  background: #fee2e2;
  color: #991b1b;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 13px;
}

.users-table th,
.users-table td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.add-user-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.add-user-form button {
  margin-top: 4px;
}
