:root {
  /* Color System */
  --bg-primary: #080c14;
  --bg-secondary: #0f1522;
  --panel-bg: rgba(18, 25, 41, 0.65);
  --panel-border: rgba(255, 255, 255, 0.06);
  --border-focus: #ff7e5f;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #475569;
  
  /* Neon Accents */
  --accent-orange: #ff7e5f;
  --accent-rose: #feb47b;
  --accent-cyan: #00f2fe;
  
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

  /* Fonts */
  --font-main: 'Noto Sans KR', 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-neon: 0 0 20px rgba(255, 126, 95, 0.25);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Background Glowing Orbs */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.1;
  pointer-events: none;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-orange) 0%, var(--accent-rose) 100%);
  top: -100px;
  right: -50px;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, #3b82f6 100%);
  bottom: -50px;
  left: -50px;
}

.app-container {
  width: 100%;
  max-width: 1200px;
  padding: 2rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Glass Panel Template */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

/* Auth Cards (Login/Setup) */
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: cardFadeIn 0.5s ease-out forwards;
}

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

.auth-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.auth-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.text-orange {
  color: var(--accent-orange);
  filter: drop-shadow(0 0 10px rgba(255, 126, 95, 0.4));
}

.text-cyan {
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.4));
}

.auth-header h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}

.auth-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Forms & Inputs */
form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 1.15rem;
  color: var(--text-dark);
  transition: var(--transition-smooth);
}

input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 1rem 1rem 1rem 2.85rem;
  background-color: rgba(10, 14, 23, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
}

input:focus {
  border-color: var(--border-focus);
  background-color: rgba(10, 14, 23, 0.7);
  box-shadow: 0 0 15px rgba(255, 126, 95, 0.15);
}

input:focus + i {
  color: var(--accent-orange);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-rose) 100%);
  color: #000000;
  box-shadow: var(--shadow-neon);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 0 25px rgba(255, 126, 95, 0.45);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--accent-orange);
  border-color: var(--accent-orange);
}

.btn-save {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, #2563eb 100%);
  color: #000000;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.25);
  font-size: 1rem;
  padding: 1.1rem 2.5rem;
}

.btn-save:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.55);
}

/* Dashboard Panel Layout */
.dashboard-panel {
  width: 100%;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: cardFadeIn 0.5s ease-out forwards;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.back-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  transform: translateX(-2px);
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px rgba(255, 126, 95, 0.4));
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 50%, var(--accent-orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.engine-sub {
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.header-right {
  display: flex;
  gap: 0.75rem;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-action:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.logout-btn:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

/* Dashboard Controls */
.dashboard-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  flex-grow: 1;
  max-width: 450px;
}

.search-bar i {
  position: absolute;
  left: 1.15rem;
  color: var(--text-muted);
}

.search-bar input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.85rem;
  border-radius: 12px;
  background: rgba(10, 14, 23, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-smooth);
}

.search-bar input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

.status-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
}

.status-summary strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.status-summary .divider {
  color: rgba(255, 255, 255, 0.08);
}

.text-green { color: var(--color-success); }
.text-red { color: var(--color-danger); }
.text-yellow { color: var(--color-warning); }

/* App Table Grid */
.app-list-container {
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
}

.app-list-container::-webkit-scrollbar {
  width: 6px;
}

.app-list-container::-webkit-scrollbar-track {
  background: transparent;
}

.app-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.app-list-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.1);
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.app-table th,
.app-table td {
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.app-table th {
  background-color: rgba(15, 21, 36, 0.6);
  color: var(--text-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.app-table tbody tr {
  transition: var(--transition-smooth);
}

.app-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.015);
}

.app-name {
  font-weight: 600;
  color: var(--text-main);
}

.app-tag-id {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
}

.app-icon-display {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.app-category {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Status Selector Radio Button Group */
.status-selector {
  display: flex;
  background: rgba(10, 14, 23, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.25rem;
  gap: 0.25rem;
  width: fit-content;
}

.status-option {
  padding: 0.45rem 1rem;
  border-radius: 9px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  background: none;
  color: var(--text-muted);
}

.status-option:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.03);
}

.status-option[data-status="active"].selected {
  background-color: rgba(16, 185, 129, 0.14) !important;
  color: #10b981 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.status-option[data-status="inactive"].selected {
  background-color: rgba(239, 68, 68, 0.14) !important;
  color: #ef4444 !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}

.status-option[data-status="coming-soon"].selected {
  background-color: rgba(245, 158, 11, 0.14) !important;
  color: #f59e0b !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

/* Footer Action Bar */
.dashboard-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.status-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-tip i {
  color: var(--accent-cyan);
  margin-right: 0.25rem;
}

/* Modal Overlay & Card */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 12, 20, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 90%;
  max-width: 440px;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  transition: var(--transition-smooth);
}

.btn-close:hover {
  color: var(--accent-orange);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

.modal-footer .btn {
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
}

/* Toast styling */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
}

.toast {
  background: rgba(15, 21, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 320px;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
}

.toast-success::before { background-color: var(--color-success); }
.toast-success i { color: var(--color-success); }

.toast-warning::before { background-color: var(--color-warning); }
.toast-warning i { color: var(--color-warning); }

.toast-error::before { background-color: var(--color-danger); }
.toast-error i { color: var(--color-danger); }

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.fade-out {
  animation: slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.hidden {
  display: none !important;
}
