:root {
  --bg: #0f1115;
  --panel: #161922;
  --panel-2: #1d2230;
  --border: #262b3a;
  --text: #e7e9ee;
  --muted: #9aa3b2;
  --accent: #7c5cff;
  --accent-2: #5a3fff;
  --green: #2bd576;
  --yellow: #ffb84d;
  --red: #ff5b6b;
  --blue: #4da3ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); padding: 10px 12px; border-radius: 8px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[disabled] { opacity: 0.6; }

.btn { background: var(--accent); color: white; border: none; padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.btn:hover { background: var(--accent-2); }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: #232838; }
.btn.danger { background: var(--red); }
.btn.warning { background: var(--yellow); color: #1b1500; }
.btn.success { background: var(--green); color: #052915; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 6px; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--panel); border-right: 1px solid var(--border); padding: 20px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.brand-logo { width: 36px; height: 36px; background: linear-gradient(135deg, var(--accent), #b794ff); border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: white; }
.brand-name { font-weight: 700; font-size: 16px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--muted); margin-bottom: 4px; cursor: pointer; font-size: 14px; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--panel-2); color: var(--text); }
.nav-item .ic { width: 18px; text-align: center; }

.main { flex: 1; padding: 24px 32px; overflow: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 700; margin: 0; }
.page-subtitle { color: var(--muted); margin: 4px 0 0 0; font-size: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--border); padding: 6px 12px 6px 6px; border-radius: 999px; font-size: 14px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: white; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.toolbar input[type="search"] { flex: 1; min-width: 220px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.card-img { aspect-ratio: 16/10; background: #0a0c12 center / cover no-repeat; position: relative; }
.card-img.placeholder { display: grid; place-items: center; color: var(--muted); font-size: 36px; }
.badge { position: absolute; top: 10px; left: 10px; padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.badge.available { background: rgba(43,213,118,0.15); color: var(--green); }
.badge.reserved { background: rgba(255,184,77,0.15); color: var(--yellow); }
.badge.checked-out { background: rgba(77,163,255,0.15); color: var(--blue); }
.badge.blocked { background: rgba(255,91,107,0.15); color: var(--red); }
.card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-weight: 700; font-size: 15px; margin: 0; }
.card-cat { color: var(--muted); font-size: 12px; }
.card-actions { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-bg.show { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 560px; padding: 24px; max-height: 90vh; overflow: auto; }
.modal h2 { margin: 0 0 16px; font-size: 18px; }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row label { color: var(--muted); font-size: 13px; }
.form-row input, .form-row select, .form-row textarea { width: 100%; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
tr:last-child td { border-bottom: none; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 30px; width: 100%; max-width: 400px; }
.login-card h1 { margin: 0 0 8px; font-size: 22px; }
.login-card p { margin: 0 0 24px; color: var(--muted); font-size: 14px; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.pill { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pill.green { background: rgba(43,213,118,0.15); color: var(--green); }
.pill.yellow { background: rgba(255,184,77,0.15); color: var(--yellow); }
.pill.blue { background: rgba(77,163,255,0.15); color: var(--blue); }
.pill.red { background: rgba(255,91,107,0.15); color: var(--red); }
.pill.muted { background: var(--panel-2); color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 6px; }

.filter-chip { padding: 6px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: white; }

.item-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.img-upload { display: flex; align-items: center; gap: 10px; }
.img-upload .preview { width: 80px; height: 60px; border-radius: 6px; background: var(--panel-2); border: 1px dashed var(--border); display: grid; place-items: center; color: var(--muted); font-size: 22px; background-size: cover; background-position: center; }

.toast { position: fixed; bottom: 20px; right: 20px; background: var(--panel); border: 1px solid var(--border); padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.4); transform: translateY(20px); opacity: 0; transition: 0.25s; z-index: 999; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; display: flex; flex-wrap: wrap; gap: 4px; padding: 12px; }
  .brand { width: 100%; margin-bottom: 8px; }
  .nav-item { flex: 1; justify-content: center; min-width: 100px; }
  .main { padding: 16px; }
}
