@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Share+Tech+Mono&family=Exo+2:wght@300;400;600;700;800&display=swap');

:root {
  --gold:        #ff9800;
  --gold-hover:  #ffb300;
  --red:         #ff3b55;
  --green:       #00e676;
  --blue:        #ff9800;
  --purple:      #b06cff;
  --bg:          #06070d;
  --bg2:         #090c14;
  --panel:       #0d1020;
  --panel2:      #111428;
  --border:      rgba(255,152,0,0.15);
  --border2:     rgba(255,255,255,0.07);
  --text:        #c4cde8;
  --text-dim:    #3d4466;
  --text-mid:    #7880a8;
  --font:    'Exo 2', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono:    'Share Tech Mono', 'Courier New', monospace;
  --display: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --radius:      10px;
  --sidebar-w:   260px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(255,152,0,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,152,0,0.028) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  top: -300px; right: -200px;
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(255,152,0,0.06) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,152,0,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,152,0,0.4); }

.app-layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }


.sidebar-logo-img {
  height: 36px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 8px rgba(255,152,0,0.35));
}
.sidebar-logo:hover .sidebar-logo-img {
  filter: drop-shadow(0 1px 16px rgba(255,152,0,0.65));
}

.sidebar {
  width: var(--sidebar-w);
  background: rgba(11,13,21,0.98);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

.sidebar-logo {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.logo-hex { display: none !important; }

.sidebar-logo::after { display: none; }

@keyframes hex-pulse {
  0%,100% { box-shadow: 0 0 14px rgba(255,152,0,0.45); }
  50%      { box-shadow: 0 0 34px rgba(255,152,0,0.8); }
}
.logo-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}
.logo-label-main {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 3px;
  text-transform: uppercase;
}
.logo-label span { color: var(--gold); }

.sidebar-user {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,152,0,0.03); flex-shrink: 0;
}
.user-avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255,152,0,0.35); object-fit: cover; flex-shrink: 0; background: var(--panel2); }
.user-info { min-width: 0; flex: 1; }
.user-name { font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-level { font-size: 10px; color: var(--text-dim); letter-spacing: 1.5px; text-transform: uppercase; font-family: var(--mono); margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 8px 0; overflow-y: auto; }

.nav-section-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); padding: 12px 18px 5px; font-weight: 700; font-family: var(--mono); }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 18px; text-decoration: none;
  color: var(--text-mid); font-size: 14px; font-weight: 600;
  transition: all 0.15s; position: relative; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { color: #e8eaf5; background: rgba(255,255,255,0.04); }
.nav-item.active { color: var(--gold); background: rgba(255,152,0,0.07); }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; background: transparent; border-radius: 0 3px 3px 0; }
.nav-item.disabled { opacity: 0.3; pointer-events: none; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge { margin-left: auto; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 4px; letter-spacing: 0.5px; text-transform: uppercase; }
.badge-admin { background: rgba(255,152,0,0.12); color: var(--gold); }
.badge-expert { background: rgba(0,180,255,0.12); color: var(--blue); }
.badge-owner { background: rgba(176,108,255,0.15); color: var(--purple); }
.badge-helper { background: rgba(0,230,118,0.12); color: var(--green); }

.sidebar-footer { padding: 14px 18px; border-top: 1px solid var(--border); flex-shrink: 0; }
.logout-btn { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 13px; font-weight: 600; text-decoration: none; transition: color 0.2s; padding: 6px 0; }
.logout-btn:hover { color: var(--red); }

.main-content { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }

.page-header {
  padding: 22px 32px 16px;
  border-bottom: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(7,8,12,0.7);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 10;
}
.page-title { font-family: var(--display); font-size: 24px; font-weight: 700; color: #fff; letter-spacing: 0.5px; line-height: 1; }
.page-subtitle { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.page-body { padding: 28px 32px; flex: 1; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; position: relative; overflow: hidden; }
.card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,152,0,0.2), transparent); }
.card-title { font-family: var(--display); font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-mid); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); font-family: var(--mono); }
.field label span { color: var(--gold); }

.input, .textarea, .select {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px; padding: 11px 14px; color: #e8eaf5;
  font-family: var(--font); font-size: 14px; outline: none;
  transition: all 0.2s; width: 100%;
}
.input:focus, .textarea:focus, .select:focus { border-color: rgba(255,152,0,0.45); background: rgba(255,152,0,0.03); box-shadow: 0 0 0 3px rgba(255,152,0,0.07); }
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }
.textarea { resize: vertical; min-height: 100px; font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.select option { background: #1a1d2e; color: #e8eaf5; }
.input-hint { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 8px; border: none; font-family: var(--font); font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.18s; text-decoration: none; white-space: nowrap; line-height: 1; }
.btn-gold { background: linear-gradient(135deg, #ff9800 0%, #e65c00 100%); color: #fff; border: none; box-shadow: 0 4px 20px rgba(255,152,0,0.3); }
.btn-gold:hover { background: linear-gradient(135deg, #ffb300 0%, #ff7000 100%); transform: translateY(-1px); box-shadow: 0 6px 28px rgba(255,152,0,0.5); }
.btn-gold:active { transform: translateY(0); }
.btn-outline { background: transparent; color: var(--text-mid); border: 1px solid var(--border2); }
.btn-outline:hover { border-color: rgba(255,255,255,0.2); color: #fff; }
.btn-danger { background: rgba(255,50,50,0.1); color: var(--red); border: 1px solid rgba(255,50,50,0.2); }
.btn-danger:hover { background: rgba(255,50,50,0.2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: 13px 28px; font-size: 15px; }

#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { background: #1a1d2e; border: 1px solid var(--border2); border-radius: 10px; padding: 14px 18px; min-width: 280px; max-width: 360px; display: flex; align-items: flex-start; gap: 12px; animation: toastIn 0.3s cubic-bezier(.4,0,.2,1); box-shadow: 0 12px 40px rgba(0,0,0,0.6); pointer-events: all; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }
.toast.warning { border-left: 3px solid var(--gold); }
.toast-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.toast-msg { font-size: 13px; color: #e8eaf5; line-height: 1.5; font-weight: 500; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse-dot 2s infinite; }
.dot-red { background: var(--red); }
.dot-gold { background: transparent; }
.dot-blue { background: var(--blue); }
@keyframes pulse-dot { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

.divider { height: 1px; background: var(--border2); margin: 18px 0; }

#sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 49; }
#sidebar-overlay.visible { display: block; }

@media (max-width: 960px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; box-shadow: 8px 0 32px rgba(0,0,0,0.6); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-body { padding: 18px; }
  .page-header { padding: 16px 18px 12px; }
  .mob-menu-btn { display: flex !important; }
}
@media (max-width: 600px) { .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; } }

.mob-menu-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--border2);
  cursor: pointer; font-size: 18px; color: var(--text);
  flex-shrink: 0;
}