@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --bg-base: #06090e;
  --bg-surface: #0b111a;
  --bg-card: rgba(15, 23, 36, 0.72);
  --bg-card-hover: rgba(22, 32, 49, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 254, 0.28);
  
  --text-main: #f1f5f9;
  --text-muted: #8e9db3;
  --text-dim: #64748b;
  
  --accent-primary: #00f2fe;
  --accent-secondary: #4facfe;
  --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  
  --violet-glow: #7f00ff;
  --violet-gradient: linear-gradient(135deg, #7f00ff 0%, #e100ff 100%);
  
  --ok: #10b981;
  --ok-bg: rgba(16, 185, 129, 0.14);
  --danger: #f43f5e;
  --danger-bg: rgba(244, 63, 94, 0.14);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.14);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.14);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Global Dark Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(6, 9, 14, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Dynamic Background Ambient Orbs */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.28;
  animation: floatOrb 18s ease-in-out infinite alternate;
}
.bg-orb-a {
  width: 50vw;
  height: 50vw;
  top: -15vw;
  left: -10vw;
  background: radial-gradient(circle, #00f2fe 0%, transparent 70%);
}
.bg-orb-b {
  width: 45vw;
  height: 45vw;
  bottom: -15vw;
  right: -10vw;
  background: radial-gradient(circle, #7f00ff 0%, transparent 70%);
  animation-delay: -6s;
}
.bg-orb-c {
  width: 35vw;
  height: 35vw;
  top: 40%;
  left: 30%;
  background: radial-gradient(circle, #00b09b 0%, transparent 70%);
  opacity: 0.15;
  animation-delay: -12s;
}
@keyframes floatOrb {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(3%, 5%, 0) scale(1.08); }
  100% { transform: translate3d(-3%, -2%, 0) scale(0.95); }
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--accent-secondary);
}

/* Shell Layout */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Mobile Header */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 9, 14, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.9rem 1.25rem;
  justify-content: space-between;
  align-items: center;
}
.mobile-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-brand span { color: var(--accent-primary); }
.mobile-menu-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 85;
}

/* Sidebar */
.sidebar {
  background: rgba(11, 17, 26, 0.85);
  border-right: 1px solid var(--border-subtle);
  padding: 1.75rem 1.2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 90;
  overflow-x: hidden;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.brand span {
  color: var(--accent-primary);
  text-shadow: 0 0 12px rgba(0, 242, 254, 0.5);
}
.brand img {
  height: 32px;
  max-width: 140px;
  object-fit: contain;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.nav::-webkit-scrollbar {
  width: 4px;
}
.nav::-webkit-scrollbar-track {
  background: transparent;
}
.nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
.nav::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.nav-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 1.2rem 0.75rem 0.4rem;
  font-weight: 700;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.nav a svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
  stroke: currentColor;
  flex-shrink: 0;
  transition: transform 0.2s ease, stroke 0.2s ease;
}
.nav a:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
}
.nav a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(0, 242, 254, 0.16), rgba(0, 242, 254, 0.03));
  border-left: 3px solid var(--accent-primary);
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.08);
}
.nav a.active svg {
  stroke: var(--accent-primary);
  filter: drop-shadow(0 0 5px rgba(0, 242, 254, 0.6));
}

.sidebar .user-profile-pill {
  margin-top: auto;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.user-avatar-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #000;
  font-family: var(--font-display);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}
.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Area */
.main {
  padding: 2rem 2.5rem 4rem;
  min-width: 0;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 2rem;
  animation: riseIn 0.45s ease both;
}
.page-head h1 {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.1;
}
.page-head p {
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* Panels & Cards */
.panel, .stat {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
  animation: riseIn 0.4s ease both;
}
.panel:hover, .stat:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-card), 0 0 20px rgba(0, 242, 254, 0.08);
}

.grid { display: grid; gap: 1.25rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.stat {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent-gradient);
  opacity: 0.8;
}
.stat .label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.stat .value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.3rem;
  line-height: 1;
}
.stat .hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  background: var(--accent-gradient);
  color: #04121a;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.3);
}
.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  color: #04121a;
  box-shadow: 0 8px 28px rgba(0, 242, 254, 0.45);
  text-decoration: none;
}
.btn:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  color: var(--text-main);
  box-shadow: none;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.15);
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.3);
}
.btn-danger:hover {
  color: #fff;
  box-shadow: 0 8px 28px rgba(244, 63, 94, 0.45);
}

.btn-pulse {
  animation: pulseButton 2s ease-in-out infinite;
}
@keyframes pulseButton {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 242, 254, 0.3); }
  50% { box-shadow: 0 0 35px rgba(0, 242, 254, 0.7); }
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
}

/* Form Controls */
.form-row { margin-bottom: 1.2rem; }
label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
}
input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
  width: 100%;
  background: rgba(6, 9, 14, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.18);
  background: rgba(6, 9, 14, 0.95);
}
.help {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-top: 0.4rem;
}

/* Custom Checkboxes & Radio Cards */
.choice {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.2s ease;
}
.choice:hover {
  border-color: var(--border-glow);
  background: rgba(0, 242, 254, 0.04);
}
.choice.is-on {
  border-color: var(--accent-primary);
  background: rgba(0, 242, 254, 0.08);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.12);
}
.choice input[type="radio"], .choice input[type="checkbox"] {
  margin-top: 0.25rem;
  accent-color: var(--accent-primary);
  width: 18px;
  height: 18px;
}

/* Account Pick Row */
.pick-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
}
.pick-row:hover {
  background: rgba(255, 255, 255, 0.02);
}
.pick-row:last-child { border-bottom: 0; }

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
th, td {
  text-align: left;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.92rem;
}
th {
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 0.75rem;
}
tr { transition: background 0.15s ease; }
tr:hover td { background: rgba(255, 255, 255, 0.025); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-err { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-info { background: var(--info-bg); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-mute { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); border: 1px solid var(--border-subtle); }

/* Pulsing Status Dot */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.pulse-dot-ok {
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseDot 1.8s infinite;
}
@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Flash Messages */
.flash-wrap { margin-bottom: 1.25rem; }
.flash {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.65rem;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
  animation: riseIn 0.35s ease both;
}
.flash-success { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.4); color: #34d399; }
.flash-error { background: rgba(244, 63, 94, 0.15); border-color: rgba(244, 63, 94, 0.4); color: #f87171; }
.flash-info { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.4); color: #60a5fa; }

/* Feature Cards & Hero Boxes */
.posting-hero {
  border-color: rgba(0, 242, 254, 0.35);
  background: radial-gradient(800px 300px at 0% 0%, rgba(0, 242, 254, 0.12), transparent 70%), var(--bg-card);
}
.posting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.muted { color: var(--text-muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.85rem; word-break: break-all; }

/* Grid Views (Cards) */
.caption-grid, .nf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}
.caption-card, .nf-card, .tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  transition: all 0.25s ease;
}
.caption-card:hover, .nf-card:hover, .tool-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card), 0 0 20px rgba(0, 242, 254, 0.1);
}

/* Auth Page Layout */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: min(450px, 100%);
  background: rgba(15, 23, 36, 0.88);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.2rem;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 242, 254, 0.15);
  backdrop-filter: blur(20px);
  animation: authIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes authIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-card h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 0.4rem;
}
.auth-card h1 span {
  color: var(--accent-primary);
  text-shadow: 0 0 15px rgba(0, 242, 254, 0.6);
}

/* Responsive Rules */
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .mobile-topbar { display: flex; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 270px;
    transform: translateX(-100%);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.8);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-overlay.is-open {
    display: block;
  }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 1.5rem 1.25rem 3rem; }
}

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
  .posting-row { flex-direction: column; align-items: flex-start; }
}
