* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0a0c10;
  color: white;
}
a { color: #60a5fa; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.layout {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}
.sidebar {
  width: 250px;
  height: 100vh;
  background: #0b0d11;
  border-right: 1px solid rgba(255,255,255,0.05);
  border-radius: 0 24px 24px 0;
  padding: 20px 16px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}
.top { margin-bottom: 24px; overflow-y: auto; padding-right: 4px; }
.logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; }
.logo-row img { width: 40px; height: 40px; }
.divider { opacity: 0.4; font-size: 22px; }
.title { font-weight: bold; font-size: 22px; }
.section-title { font-size: 14px; font-weight: bold; margin-bottom: 12px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: block; background: none; border: none; color: rgba(255,255,255,0.85); font-weight: 600; font-size: 13px;
  cursor: pointer; padding: 2px 0; text-align: left; position: relative; margin: 0;
}
.nav-item span { position: relative; display: inline-block; }
.nav-item span::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: white; transition: width 0.25s ease;
}
.nav-item:hover span::after, .nav-item.active span::after { width: 100%; }
.nav-item.active { color: white; }
.nav-group { margin-top: 18px; }
.bottom {
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); border-radius: 16px 16px 0 0;
  padding: 6px 10px 12px; display: flex; flex-direction: column; gap: 10px; margin-bottom: -6px;
}
.user-bar { display: flex; align-items: center; gap: 8px; background: #11141a; padding: 8px; border-radius: 12px; width: 100%; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: gray; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-info .name { font-size: 13px; font-weight: bold; line-height: 1.1; }
.user-info .role { font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 3px; line-height: 1.1; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08); background: #0c0f14;
  color: rgba(255,255,255,0.72); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s ease; flex-shrink: 0;
}
.icon-btn:hover { color: white; border-color: rgba(255,255,255,0.16); background: #151922; }
.icon-btn svg { width: 16px; height: 16px; fill: currentColor; }
.logout { margin-left: auto; }
.timestamp-box { font-size: 12px; color: rgba(255,255,255,0.62); padding: 2px 4px 0; }
.timestamp-box .time { font-size: 14px; font-weight: bold; color: white; }
.timestamp-box .date { margin-top: 3px; }
.main { flex: 1; padding: 40px 50px; overflow-y: auto; }
.page-header { margin-bottom: 24px; }
h1 { font-size: 42px; margin: 0 0 12px 0; }
p.lead { font-size: 18px; max-width: 700px; margin: 0; color: rgba(255,255,255,0.8); }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.stat-card, .card { background: #11141a; border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 18px; }
.stat-card { min-height: 110px; display: flex; flex-direction: column; justify-content: center; }
.stat-title { font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 8px; }
.stat-value { font-size: 30px; font-weight: bold; line-height: 1; }
.chart-card { margin-top: 24px; min-height: 360px; }
.chart-title, .card-title { font-size: 15px; font-weight: bold; margin-bottom: 16px; }
.chart-wrap { position: relative; width: 100%; height: 280px; }
.copyright { margin-top: 36px; text-align: center; font-size: 11px; color: rgba(255,255,255,0.35); letter-spacing: 0.4px; padding-bottom: 8px; }
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: url('./background.jpg') center/cover no-repeat; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); }
.auth-box { position: relative; width: 380px; max-width: calc(100% - 24px); padding: 30px; border-radius: 20px; background: #0b0d11; box-shadow: 0 20px 60px rgba(0,0,0,0.6); z-index: 1; display: flex; flex-direction: column; align-items: center; }
.auth-box img { width: 60px; height: 60px; object-fit: contain; margin-bottom: 15px; }
.auth-title { font-size: 20px; font-weight: bold; margin-bottom: 20px; color: white; }
.input { width: 100%; margin-bottom: 12px; }
.input input, .input select, .input textarea { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); background: #11141a; color: white; outline: none; font-size: 13px; }
.input input::placeholder, .input textarea::placeholder { color: rgba(255,255,255,0.4); }
.auth-btn, .primary-btn { width: 100%; padding: 10px; border-radius: 10px; border: none; background: #3b82f6; color: white; font-weight: bold; cursor: pointer; transition: 0.2s ease; }
.auth-btn:hover, .primary-btn:hover { background: #2563eb; }
.secondary-btn { padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08); background: #0c0f14; color: white; cursor: pointer; }
.helper-links, .message, .remember { width: 100%; }
.helper-links { margin-top: 14px; text-align: center; font-size: 12px; color: rgba(255,255,255,0.65); }
.message { min-height: 18px; margin-top: 12px; font-size: 12px; color: #fca5a5; text-align: center; }
.success { color: #86efac; }
.remember { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 10px 0 15px; color: rgba(255,255,255,0.7); }
.remember input { accent-color: #3b82f6; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 16px; }
.toolbar .input { margin: 0; max-width: 320px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 14px; vertical-align: top; }
th { color: rgba(255,255,255,0.65); font-weight: 600; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: rgba(59,130,246,0.18); color: #bfdbfe; font-size: 12px; }
.role-list { display: grid; gap: 16px; }
.role-card { display: grid; gap: 14px; }
.permissions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.permission-item { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.85); font-size: 14px; }
.muted { color: rgba(255,255,255,0.55); }
.hidden { display: none !important; }
.topbar { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.topbar-search { width: 100%; max-width: 320px; height: 44px; border-radius: 14px; background: #11141a; border: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.topbar-search svg { width: 16px; height: 16px; fill: rgba(255,255,255,0.55); flex-shrink: 0; }
.topbar-search input { width: 100%; background: transparent; border: none; outline: none; color: white; font-size: 13px; }
.topbar-search input::placeholder { color: rgba(255,255,255,0.4); }
.info-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:16px; }
.data-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap:16px; }
.data-card { background:#11141a; border:1px solid rgba(255,255,255,0.08); border-radius:16px; padding:18px; }
.data-card h3 { margin:0 0 10px 0; font-size:16px; }
.data-list { display:grid; gap:8px; }
.data-item { font-size:13px; color:rgba(255,255,255,0.8); }
.data-item strong { color:white; }
.empty-state { padding:18px; border:1px dashed rgba(255,255,255,0.14); border-radius:14px; color:rgba(255,255,255,0.65); background:rgba(255,255,255,0.02); }
.toolbar-actions { display:flex; gap:10px; align-items:center; flex-wrap: wrap; }
.small { font-size:12px; color:rgba(255,255,255,0.55); }
.storage-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(320px,1fr)); gap:16px; }
.storage-card { background:#11141a; border:1px solid rgba(255,255,255,0.08); border-radius:16px; padding:18px; display:grid; gap:12px; }
.storage-meta { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:10px; }
.storage-meta .data-item { background:rgba(255,255,255,0.02); border-radius:10px; padding:10px; }
.storage-actions { display:flex; justify-content:space-between; gap:10px; align-items:center; }
.pager { display:flex; justify-content:flex-end; align-items:center; gap:10px; margin-top:18px; }
.pager button { width:auto; padding:8px 14px; }
.code-block { white-space:pre-wrap; word-break:break-word; background:#0c0f14; border:1px solid rgba(255,255,255,0.08); padding:12px; border-radius:12px; font-size:12px; color:rgba(255,255,255,0.8); max-height:220px; overflow:auto; }
.history-table { max-height:300px; overflow:auto; border:1px solid rgba(255,255,255,0.06); border-radius:12px; }
.split-grid { display:grid; grid-template-columns: 1fr 1fr; gap:16px; }
@media (max-width: 1100px) {
  .layout { flex-direction: column; overflow: auto; }
  .sidebar { width: calc(100% - 32px); height: auto; margin: 16px; border-radius: 24px; padding: 20px 16px; }
  .bottom { margin-bottom: 10px; border-radius: 16px; }
  .main { padding: 24px 20px 40px; }
  h1 { font-size: 36px; }
  p.lead { font-size: 16px; max-width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .stats-grid, .permissions-grid, .split-grid, .storage-meta, .info-grid { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 32px; }
  h1 { font-size: 30px; line-height: 1.15; }
  p.lead { font-size: 15px; line-height: 1.5; }
  .chart-wrap { height: 240px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .topbar { justify-content: stretch; }
  .topbar-search { max-width: 100%; }
  .storage-grid { grid-template-columns: 1fr; }
}
