/* ─── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #f4f5f7;
}

/* ─── Login ────────────────────────────────────────────────────────────── */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; background: #17342a;
}
.login-card {
  background: #fff; border-radius: 12px; padding: 48px 40px; width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.login-logo { font-size: 28px; font-weight: 700; color: #17342a; text-align: center; }
.login-subtitle { text-align: center; color: #888; margin: 4px 0 32px; font-size: 13px; }
.login-card input {
  display: block; width: 100%; padding: 12px 14px; margin-bottom: 14px;
  border: 1px solid #ddd; border-radius: 8px; font-size: 14px; font-family: inherit;
  outline: none; transition: border .2s;
}
.login-card input:focus { border-color: #c27c40; }
.login-error { color: #d44; text-align: center; margin-top: 12px; font-size: 13px; }

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border: none; border-radius: 8px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; transition: .15s;
}
.btn-primary { background: #c27c40; color: #fff; }
.btn-primary:hover { background: #a96830; }
.btn-secondary { background: #e8e8e8; color: #333; }
.btn-secondary:hover { background: #ddd; }
.btn-danger { background: #d44; color: #fff; }
.btn-danger:hover { background: #b33; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 12px; }

/* ─── App Shell ────────────────────────────────────────────────────────── */
.app-shell { display: flex; height: 100vh; }
.hidden { display: none !important; }

/* ─── Sidebar ──────────────────────────────────────────────────────────── */
.sidebar {
  width: 240px; min-width: 240px; background: #17342a; color: #fff;
  display: flex; flex-direction: column; overflow-y: auto;
  transition: margin .25s;
}
.sidebar-header {
  padding: 24px 20px 20px; display: flex; align-items: baseline; gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo { font-size: 20px; font-weight: 700; }
.sidebar-tag { font-size: 11px; color: #c27c40; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: rgba(255,255,255,.65); text-decoration: none;
  font-size: 13px; font-weight: 500; transition: .15s; border-left: 3px solid transparent;
}
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.sidebar-nav a.active {
  color: #fff; background: rgba(194,124,64,.12); border-left-color: #c27c40;
}
.sidebar-nav a svg { opacity: .7; flex-shrink: 0; }
.sidebar-nav a.active svg { opacity: 1; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.btn-logout {
  background: none; border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.6);
  padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px;
  font-family: inherit; width: 100%; transition: .15s;
}
.btn-logout:hover { color: #fff; border-color: rgba(255,255,255,.3); }

/* ─── Topbar ───────────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 32px; background: #fff;
  border-bottom: 1px solid #e8e8e8;
}
.sidebar-toggle { background: none; border: none; cursor: pointer; color: #555; display: none; }
.page-title { font-size: 18px; font-weight: 700; color: #17342a; }

/* ─── Main ─────────────────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.main-content { flex: 1; overflow-y: auto; padding: 24px 32px; }

/* ─── Toolbar ──────────────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.search-input {
  padding: 9px 14px; border: 1px solid #ddd; border-radius: 8px;
  font-size: 13px; font-family: inherit; width: 260px; outline: none;
  transition: border .2s;
}
.search-input:focus { border-color: #c27c40; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ─── Data Table ───────────────────────────────────────────────────────── */
.data-table-wrap { overflow-x: auto; background: #fff; border-radius: 10px; border: 1px solid #e8e8e8; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table th {
  text-align: left; padding: 12px 16px; font-weight: 600; color: #555;
  background: #fafafa; border-bottom: 1px solid #e8e8e8;
  white-space: nowrap; font-size: 12px; text-transform: uppercase; letter-spacing: .3px;
}
.data-table td {
  padding: 11px 16px; border-bottom: 1px solid #f0f0f0;
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }
.actions-cell { display: flex; gap: 6px; }

/* ─── Modal ────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal {
  background: #fff; border-radius: 12px; width: 560px; max-width: 94vw;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid #eee;
}
.modal-header h2 { font-size: 16px; font-weight: 700; color: #17342a; }
.modal-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: #999; line-height: 1;
}
.modal-body { padding: 24px; overflow-y: auto; }

/* ─── Form ─────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; margin-bottom: 5px; font-size: 12px;
  font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: .3px;
}
.form-group input,
.form-group textarea,
.form-group select {
  display: block; width: 100%; padding: 10px 12px;
  border: 1px solid #ddd; border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none; transition: border .2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: #c27c40; }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ─── Empty State ──────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px; color: #999; font-size: 14px;
}

/* ─── CSV label ────────────────────────────────────────────────────────── */
.csv-label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; background: #e8e8e8; color: #333; transition: .15s;
}
.csv-label:hover { background: #ddd; }
.csv-label input { display: none; }

/* ─── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 900; height: 100%; margin-left: -240px; }
  .sidebar.open { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .topbar { padding: 16px 20px; }
  .main-content { padding: 16px 20px; }
  .search-input { width: 100%; }
}
