/* Shared CSS Variables, Reset and Animations */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-base: #050b14;
  --bg-card: rgba(13, 22, 38, 0.85);
  --bg-panel: rgba(18, 30, 52, 0.7);
  --border: rgba(255, 255, 255, 0.07);
  --accent-ruby: #d8226c;
  --accent-cyan: #00f5ff;
  --accent-gold: #f5c542;
  --accent-green: #00e676;
  --text-main: #e8eaf0;
  --text-muted: #7a8299;
  --font: 'Inter', sans-serif;
  --radius: 12px;
  --transition: all 0.2s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-main);
  overflow: hidden; /* Prevent body scroll, let main handle it */
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 15% 20%, rgba(216, 34, 108, 0.1) 0%, transparent 70%),
    radial-gradient(ellipse 60% 45% at 85% 75%, rgba(0, 245, 255, 0.07) 0%, transparent 70%);
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-thumb {
  background: rgba(216, 34, 108, 0.3);
  border-radius: 3px;
}

/* ===================== AUTH ===================== */
.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px;
  width: 100%;
  max-width: 440px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
  position: relative;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.auth-logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.auth-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.4;
}

/* TABS */
.tab-row {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.1);
}

.tab-btn.on-ruby {
  background: linear-gradient(135deg, #d8226c, #a0184f);
  color: #fff;
  border-color: transparent;
}

.tab-btn.on-cyan {
  background: linear-gradient(135deg, var(--accent-cyan), #0088cc);
  color: #fff;
  border-color: transparent;
}

.tab-btn.off {
  background: transparent;
  color: var(--text-muted);
}

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font);
  font-size: 13px;
  transition: var(--transition);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control option {
  background: #0d1626;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.chk-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.chk-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.chk-item input {
  accent-color: var(--accent-ruby);
}

.btn-submit {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 6px;
}

.btn-ruby {
  background: linear-gradient(135deg, #d8226c, #a0184f);
  color: #fff;
  box-shadow: 0 4px 15px rgba(216,34,108,0.25);
}

.btn-ruby:hover {
  transform: translateY(-1px);
}

.btn-cyan {
  background: linear-gradient(135deg, var(--accent-cyan), #0088cc);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0,245,255,0.2);
}

.btn-cyan:hover {
  transform: translateY(-1px);
}

.link-sm {
  text-align: center;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.link-sm a {
  color: var(--accent-cyan);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

/* ===================== DASHBOARD SYSTEM ===================== */
.dash-page {
  position: relative;
  z-index: 1;
  display: none;
  height: 100vh;
  overflow: hidden;
}

.dash-page.shown {
  display: grid;
  grid-template-columns: 200px 1fr; /* Compact sidebar width */
}

.sidebar {
  background: rgba(13, 22, 38, 0.95);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  backdrop-filter: blur(20px);
}

.sb-logo {
  padding: 16px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sb-profile {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.sb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.sb-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-meta {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-menu {
  padding: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-item.active {
  font-weight: 600;
}

.nav-item i {
  width: 14px;
  font-size: 12px;
  text-align: center;
}

.sb-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}

.btn-logout {
  width: 100%;
  padding: 8px;
  background: transparent;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* MAIN CONTENT - COMPACT */
.main {
  padding: 16px 20px;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

.ph {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.ph-title {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ph-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
  display: block;
}

.action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-act {
  padding: 7px 12px;
  border-radius: 8px;
  border: none;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

.bp {
  color: #fff;
}

.bs {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.bs:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* CARDS - COMPACT */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 99999;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  backdrop-filter: blur(20px);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.t-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 1px;
}

.t-msg {
  font-size: 11px;
  color: var(--text-muted);
}

/* MOBILE NAV */
.m-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(13, 22, 38, 0.97);
  border-top: 1px solid var(--border);
  padding: 6px 4px;
  justify-content: space-around;
  backdrop-filter: blur(20px);
}

.m-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: var(--font);
}

.m-btn i {
  font-size: 14px;
}

/* ===================== RESPONSIVE SYSTEM ===================== */
@media (max-width: 768px) {
  .dash-page.shown {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none !important;
  }
  .m-nav {
    display: flex !important;
  }
  .main {
    padding: 12px 14px;
    padding-bottom: 70px;
    height: calc(100vh - 50px);
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}
