:root {
  --green-900: #0a2e1a;
  --green-800: #0f3d22;
  --green-700: #1a5c34;
  --green-600: #206e3d;
  --green-500: #2a8c50;
  --green-400: #3aaa64;
  --green-300: #5cc882;
  --green-200: #a8e6be;
  --green-100: #dff5e8;
  --green-50:  #f2faf5;
  --gold: #f5a623;
  --red: #e53935;
  --red-light: #ffebee;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --white: #ffffff;
  --sidebar-w: 220px;
  --header-h: 60px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'SF Mono', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font); background: var(--gray-50); color: var(--gray-900); min-height: 100vh; overflow: hidden; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }

/* ── LOGIN ── */
#login-screen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 50%, var(--green-800) 100%);
  display: none; align-items: center; justify-content: center; z-index: 1000;
}
#login-screen.visible{display:flex;}
.login-card {
  background: var(--white); border-radius: 18px; padding: 44px 48px;
  width: 100%; max-width: 420px; box-shadow: 0 24px 80px rgba(0,0,0,.3);
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.login-logo-icon {
  width: 44px; height: 44px; background: var(--green-700); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 20px; font-weight: 700;
}
.login-logo-text { line-height: 1.2; }
.login-logo-text strong { display: block; font-size: 15px; font-weight: 700; color: var(--green-800); }
.login-logo-text span { font-size: 12px; color: var(--gray-500); letter-spacing: .02em; }
.login-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; color: var(--gray-900); }
.login-card p { font-size: 13px; color: var(--gray-500); margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; letter-spacing: .04em; text-transform: uppercase; }
.form-group input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); font-family: var(--font); font-size: 14px;
  outline: none; transition: border-color .15s; background: var(--white);
}
.form-group input:focus { border-color: var(--green-500); }
.btn-login {
  width: 100%; padding: 12px; background: var(--green-700); color: white;
  border: none; border-radius: var(--radius-sm); font-family: var(--font);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s, transform .1s; margin-top: 8px;
}
.btn-login:hover { background: var(--green-600); transform: translateY(-1px); }
.login-hint { font-size: 11px; color: var(--gray-400); text-align: center; margin-top: 18px; }

/* ── APP SHELL ── */
#app { display: none; height: 100vh; flex-direction: row; }
#app.visible { display: flex; }

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar-w); background: var(--green-900);
  display: flex; flex-direction: column; flex-shrink: 0; height: 100vh; overflow: hidden;
}
.sidebar-header { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; }
.sidebar-brand-icon {
  width: 34px; height: 34px; background: var(--green-500); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px; font-weight: 800; letter-spacing: -.5px;
}
.sidebar-brand-text strong { display: block; color: white; font-size: 13px; font-weight: 700; }
.sidebar-brand-text span { color: var(--green-300); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--green-400); padding: 8px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: var(--radius-sm); color: rgba(255,255,255,.65); font-size: 13px;
  font-weight: 500; cursor: pointer; transition: background .12s, color .12s;
  margin-bottom: 2px; user-select: none;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .75; }
.nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { background: var(--green-700); color: white; }
.nav-item.active svg { opacity: 1; }
.sidebar-footer { padding: 12px 8px; border-top: 1px solid rgba(255,255,255,.08); }
.user-pill { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); }
.user-pill:hover { background: rgba(255,255,255,.06); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--green-500);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.user-info strong { display: block; color: white; font-size: 12px; font-weight: 600; }
.user-info span { color: var(--green-300); font-size: 10px; }
.logout-btn {
  margin-top: 6px; width: 100%; padding: 7px; background: transparent;
  border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.5);
  border-radius: var(--radius-sm); font-family: var(--font); font-size: 11px;
  cursor: pointer; transition: all .15s;
}
.logout-btn:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.8); }

/* ── MAIN ── */
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#topbar {
  height: var(--header-h); background: white; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; flex-shrink: 0;
}
.topbar-title { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.btn {
  padding: 8px 16px; border-radius: var(--radius-sm); font-family: var(--font);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s;
  border: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--green-700); color: white; }
.btn-primary:hover { background: var(--green-600); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--red-light); color: var(--red); }
.btn-danger:hover { background: #ffcdd2; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-ghost { background: transparent; color: var(--gray-600); border: 1px solid var(--gray-200); }
.btn-ghost:hover { background: var(--gray-50); }
#content { flex: 1; overflow-y: auto; padding: 24px; }
.view { display: none; }
.view.active { display: block; }

/* ── CALENDAR ── */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1.5px solid var(--gray-200);
  background: white; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .12s; color: var(--gray-600);
}
.cal-nav-btn:hover { border-color: var(--green-400); color: var(--green-700); background: var(--green-50); }
.cal-current-label { font-size: 15px; font-weight: 700; color: var(--gray-900); min-width: 200px; text-align: center; }
.view-tabs { display: flex; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); overflow: hidden; background: white; }
.view-tab {
  padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
  color: var(--gray-500); transition: all .12s; border-right: 1.5px solid var(--gray-200);
}
.view-tab:last-child { border-right: none; }
.view-tab.active { background: var(--green-700); color: white; }
.view-tab:not(.active):hover { background: var(--gray-50); color: var(--gray-700); }

.cal-grid-wrap { background: white; border-radius: var(--radius); border: 1px solid var(--gray-200); overflow: hidden; box-shadow: var(--shadow); }
.cal-grid-header { display: flex; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 10; background: var(--gray-50); }
.cal-time-hdr { width: 70px; flex-shrink: 0; background: var(--gray-50); }
.cal-rooms-hdr { flex: 1; display: grid; }
.cal-room-hdr {
  padding: 10px 8px; text-align: center; font-size: 11px; font-weight: 700;
  color: var(--gray-700); text-transform: uppercase; letter-spacing: .04em;
  border-left: 1px solid var(--gray-200); background: var(--gray-50);
}
.cal-grid-body { display: flex; }
.cal-scroll { overflow-x: auto; overflow-y: auto; max-height: calc(100vh - 160px); }
.cal-time-col { width: 70px; flex-shrink: 0; }
.cal-time-slot {
  height: 48px; display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 4px 10px 0 0; font-size: 11px; color: var(--gray-400);
  font-family: var(--mono); border-bottom: 1px solid var(--gray-100);
}
.cal-rooms-col { flex: 1; display: grid; position: relative; }
.cal-room-col { border-left: 1px solid var(--gray-200); position: relative; }
.cal-slot { height: 48px; border-bottom: 1px solid var(--gray-100); cursor: pointer; transition: background .1s; }
.cal-slot:hover { background: var(--green-50); }
.cal-booking {
  position: absolute; left: 3px; right: 3px; border-radius: 5px; padding: 4px 7px;
  font-size: 11px; font-weight: 600; overflow: hidden; cursor: pointer; z-index: 2;
  border-left: 3px solid; line-height: 1.3;
}
.cal-booking:hover { filter: brightness(.92); }

/* ── MONTH VIEW ── */
.month-grid { background: white; border-radius: var(--radius); border: 1px solid var(--gray-200); overflow: hidden; box-shadow: var(--shadow); }
.month-hdr { display: grid; grid-template-columns: repeat(7,1fr); background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.month-dow { padding: 10px 0; text-align: center; font-size: 11px; font-weight: 700; color: var(--gray-500); letter-spacing: .06em; text-transform: uppercase; }
.month-body { display: grid; grid-template-columns: repeat(7,1fr); }
.month-cell { min-height: 90px; padding: 8px; border-right: 1px solid var(--gray-100); border-bottom: 1px solid var(--gray-100); cursor: pointer; }
.month-cell:hover { background: var(--green-50); }
.month-cell.other .month-date { color: var(--gray-300); }
.month-cell.today { background: var(--green-50); }
.month-cell.today .month-date {
  background: var(--green-700); color: white; width: 24px; height: 24px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.month-date { font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.month-evt { font-size: 10px; padding: 2px 5px; border-radius: 3px; margin-bottom: 2px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.month-more { font-size: 10px; color: var(--gray-400); padding: 1px 5px; }

/* ── LIST VIEW ── */
.list-wrap { background: white; border-radius: var(--radius); border: 1px solid var(--gray-200); box-shadow: var(--shadow); overflow: hidden; }
.list-date-hdr { padding: 10px 20px; background: var(--gray-50); font-size: 12px; font-weight: 700; color: var(--gray-600); border-bottom: 1px solid var(--gray-200); text-transform: uppercase; letter-spacing: .06em; }
.list-row { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--gray-100); cursor: pointer; transition: background .1s; }
.list-row:hover { background: var(--gray-50); }
.list-color { width: 4px; height: 40px; border-radius: 2px; flex-shrink: 0; }
.list-time { font-size: 12px; font-family: var(--mono); color: var(--gray-600); min-width: 110px; }
.list-info { flex: 1; min-width: 0; }
.list-title { font-size: 13px; font-weight: 600; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.list-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; flex-shrink: 0; }
.empty { text-align: center; padding: 48px 0; color: var(--gray-400); }
.empty svg { width: 48px; height: 48px; margin: 0 auto 12px; display: block; opacity: .4; }
.empty p { font-size: 14px; }

/* ── ROOMS ── */
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 4px; }
.room-card { background: white; border-radius: var(--radius); border: 1px solid var(--gray-200); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.room-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.room-card-hdr { padding: 16px 16px 12px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; gap: 8px; }
.room-card-name { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.room-card-body { padding: 14px 16px; }
.room-attr { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--gray-600); margin-bottom: 8px; }
.room-attr svg { width: 14px; height: 14px; color: var(--gray-400); flex-shrink: 0; }
.room-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.room-card-footer { padding: 10px 16px; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: 6px; }

/* ── USERS TABLE ── */
.table-wrap { background: white; border-radius: var(--radius); border: 1px solid var(--gray-200); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--gray-50); }
th { padding: 11px 16px; text-align: left; font-size: 11px; font-weight: 700; color: var(--gray-500); letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--gray-200); }
td { padding: 12px 16px; font-size: 13px; color: var(--gray-800); border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-av { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: white; flex-shrink: 0; }
.role-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; letter-spacing: .04em; }
.role-owner { background: #fff3e0; color: #e65100; }
.role-admin  { background: #e3f2fd; color: #1565c0; }
.role-user   { background: var(--gray-100); color: var(--gray-600); }
.actions { display: flex; gap: 6px; }

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4);
  backdrop-filter: blur(2px); z-index: 900; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: 14px; width: 100%; max-width: 520px;
  box-shadow: 0 24px 80px rgba(0,0,0,.2); max-height: 90vh; overflow-y: auto;
  animation: modalIn .18s ease;
}
@keyframes modalIn { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { width: 28px; height: 28px; border-radius: 50%; background: var(--gray-100); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--gray-500); transition: background .12s; }
.modal-close:hover { background: var(--gray-200); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 8px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; letter-spacing: .04em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); font-family: var(--font); font-size: 13px;
  outline: none; transition: border-color .12s; background: white;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-500); }
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 10px; border-radius: 99px; border: 1.5px solid var(--gray-200);
  cursor: pointer; font-size: 11px; font-weight: 600; color: var(--gray-600);
  transition: all .12s; user-select: none;
}
.chip:hover { border-color: var(--green-400); color: var(--green-700); }
.chip.on { background: var(--green-700); border-color: var(--green-700); color: white; }

/* ── TOAST ── */
#toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  padding: 12px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 8px; max-width: 320px;
  animation: toastIn .2s ease, toastOut .2s ease 2.8s forwards;
}
.toast-success { background: var(--green-800); color: white; }
.toast-error   { background: var(--red); color: white; }
.toast-info    { background: var(--gray-800); color: white; }
@keyframes toastIn  { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(24px); } }

/* ── MISC ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-header h2 { font-size: 20px; font-weight: 700; }
.page-title { font-size: 24px; font-weight: 800; color: var(--gray-900); margin-bottom: 4px; }
.page-subtitle { font-size: 13px; color: var(--gray-500); margin-bottom: 24px; }
.badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.divider { height: 1px; background: var(--gray-200); margin: 16px 0; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: var(--radius); border: 1px solid var(--gray-200); padding: 16px 20px; box-shadow: var(--shadow); }
.stat-label { font-size: 11px; font-weight: 700; color: var(--gray-500); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-sub { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* Room & event color system (1–6) */
.bg-1{background:#1565c0} .bg-2{background:#6a1b9a} .bg-3{background:#00695c}
.bg-4{background:#bf360c} .bg-5{background:#e65100} .bg-6{background:#1a237e}
.eb-1{background:#dbeafe;color:#1565c0;border-color:#1565c0}
.eb-2{background:#f3e8ff;color:#6a1b9a;border-color:#6a1b9a}
.eb-3{background:#d1fae5;color:#00695c;border-color:#00695c}
.eb-4{background:#fee2e2;color:#bf360c;border-color:#bf360c}
.eb-5{background:#ffedd5;color:#e65100;border-color:#e65100}
.eb-6{background:#e0e7ff;color:#1a237e;border-color:#1a237e}
.tc-1{color:#1565c0;background:#e3f2fd;border-color:#1565c0}
.tc-2{color:#6a1b9a;background:#f3e5f5;border-color:#6a1b9a}
.tc-3{color:#00695c;background:#e0f2f1;border-color:#00695c}
.tc-4{color:#bf360c;background:#fbe9e7;border-color:#bf360c}
.tc-5{color:#e65100;background:#fff3e0;border-color:#e65100}
.tc-6{color:#1a237e;background:#e8eaf6;border-color:#1a237e}
.tag{font-size:10px;font-weight:700;padding:2px 8px;border-radius:99px;letter-spacing:.03em}

/* Confirm dialog */
.confirm-dialog { text-align: center; padding: 8px 0; }
.confirm-dialog svg { width: 44px; height: 44px; color: var(--gold); margin: 0 auto 14px; display: block; }
.confirm-dialog h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.confirm-dialog p { font-size: 13px; color: var(--gray-500); }

.topbar-left{display:flex;align-items:center;gap:12px;}
