/* ==========================================================================
   Base & Reset Styles
   ========================================================================== */
:root {
  --bg-main: #0a0d14;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(26, 34, 52, 0.95);
  --bg-input: #0f172a;
  --bg-modal: #111827;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  --border-accent: rgba(59, 130, 246, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --accent-glow: rgba(59, 130, 246, 0.35);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-card: 0 16px 36px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 25px -5px rgba(59, 130, 246, 0.4);

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.06) 0%, transparent 45%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.main-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 13, 20, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-badge {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.server-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon svg {
  width: 17px;
  height: 17px;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout svg {
  width: 15px;
  height: 15px;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   Section 1: Login Form
   ========================================================================== */
.section-login {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
}

.login-wrapper {
  position: relative;
  width: 100%;
  max-width: 440px;
}

.login-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 340px;
  height: 340px;
  background: var(--accent-gradient);
  filter: blur(100px);
  opacity: 0.22;
  border-radius: 50%;
  pointer-events: none;
}

.login-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-icon {
  width: 52px;
  height: 52px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.login-icon svg {
  width: 26px;
  height: 26px;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.login-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ==========================================================================
   Form Components
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.label-req {
  color: var(--accent-cyan);
  margin-left: 0.25rem;
}

.label-optional {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
}

.label-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

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

.input-icon {
  position: absolute;
  left: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-icon svg {
  width: 17px;
  height: 17px;
}

.form-input, .form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.72rem 1rem;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text-primary);
  transition: all 0.2s ease;
  outline: none;
}

.form-input.with-icon, .form-select.with-icon {
  padding-left: 2.75rem;
}

.form-input:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: #111a30;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 16px;
  cursor: pointer;
}

.form-select option {
  background-color: #0f172a;
  color: var(--text-primary);
  padding: 8px;
}

.btn-toggle-eye {
  position: absolute;
  right: 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
}

.btn-toggle-eye:hover {
  color: var(--text-primary);
}

.btn-toggle-eye svg {
  width: 18px;
  height: 18px;
}

.field-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Custom Checkbox */
.form-options {
  display: flex;
  align-items: center;
  margin: 0.2rem 0;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.custom-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-box {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  background: var(--bg-input);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.custom-checkbox input[type="checkbox"]:checked + .checkbox-box {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.custom-checkbox input[type="checkbox"]:checked + .checkbox-box::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary {
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-submit {
  width: 100%;
  padding: 0.85rem;
  margin-top: 0.5rem;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert-box {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1.4;
}

.alert-box.alert-error {
  background: var(--danger-bg);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-box.alert-success {
  background: var(--success-bg);
  color: #86efac;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   Section 2: Dashboard & Create Key Form
   ========================================================================== */
.section-keys {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.page-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
}

.badge-accent {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-outline {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.card-form-wrapper {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.create-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Fixed Default Parameters Summary Box */
.fixed-params-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.fixed-params-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fixed-params-title svg {
  width: 15px;
  height: 15px;
}

.fixed-params-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  background: rgba(16, 185, 129, 0.12);
  color: #86efac;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9999px;
}

.fixed-params-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.6rem 1rem;
}

.param-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
}

.param-key {
  color: var(--text-muted);
  font-weight: 500;
}

.param-val {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #7dd3fc;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 1.75rem;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-create {
  padding: 0.85rem 2rem;
  font-size: 0.98rem;
}

.btn-create svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Section 2.1: Session Creation History
   ========================================================================== */
.history-wrapper {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.history-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.history-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.history-icon svg {
  width: 18px;
  height: 18px;
}

.history-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.history-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.history-list-box {
  display: flex;
  flex-direction: column;
}

.history-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.history-empty svg {
  width: 36px;
  height: 36px;
  opacity: 0.4;
  margin-bottom: 0.25rem;
}

.history-empty p {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.history-empty span {
  font-size: 0.8rem;
  max-width: 440px;
  line-height: 1.4;
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  cursor: pointer;
}

.history-item:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.history-badge-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.history-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.history-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.history-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.history-tag {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.history-tag.tag-keys {
  background: rgba(6, 182, 212, 0.12);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.25);
  font-weight: 600;
}

.history-item-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-history-view {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-history-view svg {
  width: 15px;
  height: 15px;
}

.btn-history-view:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

/* ==========================================================================
   Popup Modal: License Keys List
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
  animation: fadeIn 0.25s ease-out;
}

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

.modal-box {
  background: var(--bg-modal);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-small {
  max-width: 480px;
}

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

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
}

.modal-icon-badge svg {
  width: 22px;
  height: 22px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.text-accent {
  color: var(--accent-cyan);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-close-modal svg {
  width: 18px;
  height: 18px;
}

/* Modal Actions Bar */
.modal-actions-bar {
  padding: 0.85rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-copy-all {
  padding: 0.6rem 1.25rem;
  font-size: 0.86rem;
}

.modal-actions-bar .btn-secondary {
  padding: 0.6rem 1rem;
  font-size: 0.86rem;
}

.modal-actions-bar svg {
  width: 16px;
  height: 16px;
}

/* Modal Body & Keys List */
.modal-body {
  padding: 1rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.keys-list-container {
  display: flex;
  flex-direction: column;
}

.keys-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.key-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(59, 130, 246, 0.3);
}

.key-info-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.key-index {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  width: 32px;
  flex-shrink: 0;
}

.key-code {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  color: #7dd3fc;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: all;
}

.btn-copy-single {
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 0.75rem;
}

.btn-copy-single svg {
  width: 14px;
  height: 14px;
}

.btn-copy-single:hover {
  background: rgba(59, 130, 246, 0.22);
  color: #ffffff;
  border-color: rgba(59, 130, 246, 0.45);
}

.btn-copy-single.copied {
  background: rgba(16, 185, 129, 0.18);
  color: #86efac;
  border-color: rgba(16, 185, 129, 0.4);
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 13, 20, 0.5);
}

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

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 200;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s ease;
}

.toast.toast-success {
  border-left: 3px solid var(--success);
}

.toast.toast-error {
  border-left: 3px solid var(--danger);
}

.toast.toast-info {
  border-left: 3px solid var(--accent-primary);
}

.toast svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.toast.toast-success svg {
  color: var(--success);
}

.toast.toast-error svg {
  color: var(--danger);
}

.toast.toast-info svg {
  color: var(--accent-primary);
}

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

.toast.toast-out {
  transform: translateX(100%);
  opacity: 0;
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

