* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0a0a0a;
  --card: #141414;
  --input: #1f1f1f;
  --text: #fff;
  --muted: #666;
  --accent: #ff6b35;
  --green: #22c55e;
  --red: #ef4444;
  --border: #2a2a2a;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.screen { display: none !important; }
.screen.active { display: block !important; }
#login-screen { position: fixed; inset: 0; z-index: 1000; background: var(--bg); }
#dashboard { z-index: 1; }

/* Login */
#login-screen.active {
  min-height: 100vh;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #0a0a0a 0%, #141414 100%);
}
.login-box {
  background: var(--card);
  padding: 40px;
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.logo { font-size: 48px; margin-bottom: 8px; }
.login-box h1 { font-size: 20px; font-weight: 600; margin-bottom: 32px; }
.login-box input {
  width: 100%;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
}
.login-box input:focus { outline: none; border-color: var(--accent); }
.login-box button {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
.login-box button:hover { opacity: 0.9; }
.error-msg { color: var(--red); margin-top: 16px; font-size: 14px; }

/* Header */
.header {
  background: var(--card);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.header-left { font-size: 18px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 16px; }
#user-name { color: var(--muted); }
.btn-logout {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* Layout */
.layout { display: flex; min-height: calc(100vh - 60px); }
.sidebar {
  width: 200px;
  background: var(--card);
  padding: 20px 0;
  border-right: 1px solid var(--border);
}
.nav-link {
  display: block;
  padding: 12px 24px;
  color: var(--muted);
  text-decoration: none;
}
.nav-link:hover { background: var(--input); color: var(--text); }
.nav-link.active { background: var(--accent); color: #fff; }
.content { flex: 1; padding: 24px; overflow-y: auto; }

/* Pages */
.page { display: none; }
.page.active { display: block; }
.page h2 { margin-bottom: 24px; font-weight: 500; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card {
  background: var(--card);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.card-title { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.card-value { font-size: 28px; font-weight: 600; }

/* Sections */
.section { background: var(--card); padding: 20px; border-radius: 12px; margin-bottom: 20px; }
.section h3 { margin-bottom: 16px; font-weight: 500; }

/* Forms */
input {
  width: 100%;
  padding: 12px;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 12px;
}
input:focus { outline: none; border-color: var(--accent); }
.inline-form { display: flex; gap: 12px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 150px; margin-bottom: 0; }
button { cursor: pointer; }
.btn { padding: 12px 24px; background: var(--input); border: 1px solid var(--border); color: var(--text); border-radius: 8px; }
.btn-green { padding: 12px 24px; background: var(--green); border: none; color: #fff; border-radius: 8px; font-weight: 500; }
.btn-red { padding: 12px 24px; background: var(--red); border: none; color: #fff; border-radius: 8px; font-weight: 500; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* Two columns */
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 20px; }
.box { background: var(--card); padding: 20px; border-radius: 12px; }
.box h3 { margin-bottom: 16px; font-weight: 500; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--input); color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; }
.table td { font-size: 14px; }
.table tr:hover { background: var(--input); }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); align-items: center; justify-content: center; z-index: 100; }
.modal.active { display: flex; }
.modal-box { background: var(--card); padding: 30px; border-radius: 16px; width: 100%; max-width: 360px; }
.modal-box h3 { margin-bottom: 20px; }
.modal-btns { display: flex; gap: 12px; margin-top: 16px; }
.modal-btns button { flex: 1; }

/* Result messages */
.success { color: var(--green); margin-top: 12px; }
.fail { color: var(--red); margin-top: 12px; }

/* Responsive */
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; display: flex; overflow-x: auto; padding: 10px; }
  .nav-link { white-space: nowrap; padding: 10px 16px; }
  .cards { grid-template-columns: 1fr 1fr; }
}
