/* ============================================
   AEPHIA COMMAND CENTER - STYLES
   Star Atlas Guild Management System
   Professional Space Game UI
   ============================================ */

/* Import Orbitron font for futuristic headers */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Rajdhani:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Core Colors - Star Atlas Inspired */
  --bg-dark: #060612;
  --bg-darker: #030308;
  --bg-card: #0d0d1a;
  --bg-card-hover: #141428;
  --bg-card-elevated: #1a1a2e;
  --border-color: #1e1e3f;
  --border-glow: #2a2a5a;

  /* Text Colors */
  --text-primary: #e8e8f0;
  --text-secondary: #8888a8;
  --text-muted: #555570;
  --text-bright: #ffffff;

  /* Accent Colors - Cyan/Teal Primary */
  --accent-cyan: #00f0ff;
  --accent-blue: #00b4d8;
  --accent-purple: #a855f7;
  --accent-gold: #ffd700;
  --accent-green: #00ff88;
  --accent-red: #ff3366;
  --accent-orange: #ff8800;
  --accent-pink: #ff00aa;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #00f0ff 0%, #a855f7 100%);
  --gradient-gold: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
  --gradient-danger: linear-gradient(135deg, #ff3366 0%, #ff0066 100%);
  --gradient-success: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
  --gradient-card: linear-gradient(180deg, rgba(13, 13, 26, 0.95) 0%, rgba(6, 6, 18, 0.98) 100%);
  --gradient-bg: radial-gradient(ellipse at 50% 0%, rgba(0, 240, 255, 0.08) 0%, transparent 50%);

  /* Shadows & Glows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.3), 0 0 40px rgba(0, 240, 255, 0.1);
  --glow-purple: 0 0 20px rgba(168, 85, 247, 0.3), 0 0 40px rgba(168, 85, 247, 0.1);
  --glow-gold: 0 0 20px rgba(255, 215, 0, 0.3), 0 0 40px rgba(255, 215, 0, 0.1);
  --glow-green: 0 0 20px rgba(0, 255, 136, 0.3), 0 0 40px rgba(0, 255, 136, 0.1);

  /* Typography */
  --font-display: 'Orbitron', sans-serif;
  --font-ui: 'Rajdhani', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Animated background gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(0, 240, 255, 0.05) 0%, transparent 40%),
    radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.05) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 180, 216, 0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darker);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-glow);
  border-radius: 4px;
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Selection */
::selection {
  background: rgba(0, 240, 255, 0.3);
  color: var(--text-bright);
}

/* ============================================
   SCREENS
   ============================================ */

.screen {
  display: none !important;
}

.screen.active {
  display: flex !important;
}

#dashboard-screen.active {
  display: block !important;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */

#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-darker);
  position: relative;
  overflow: hidden;
}

#login-screen::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 30% 30%, rgba(0, 240, 255, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(168, 85, 247, 0.1) 0%, transparent 40%);
  animation: rotate-bg 60s linear infinite;
  pointer-events: none;
}

@keyframes rotate-bg {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.login-container {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(20px);
}

/* Glowing border effect */
.login-container::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  z-index: -1;
  opacity: 0.5;
  filter: blur(8px);
}

.logo {
  text-align: center;
  margin-bottom: 40px;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: var(--gradient-primary);
  border-radius: 16px;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--bg-darker);
  margin-bottom: 20px;
  box-shadow: var(--glow-cyan), var(--shadow-lg);
  position: relative;
}

.logo-badge::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: var(--gradient-primary);
  border-radius: 18px;
  z-index: -1;
  opacity: 0.5;
  filter: blur(10px);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}

.logo h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 8px;
  text-transform: uppercase;
}

.logo .subtitle {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 8px;
  margin-top: 8px;
  text-transform: uppercase;
}

.guild-motto {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.motto-item {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 3px;
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
}

.motto-divider {
  color: var(--accent-purple);
  font-weight: 300;
  font-size: 1.2rem;
}

.logo .tagline {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--accent-gold);
  margin-top: 8px;
  letter-spacing: 2px;
  font-weight: 600;
  text-transform: uppercase;
}

.guild-link {
  text-align: center;
  margin-top: 28px;
}

.guild-link p {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.guild-link a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.guild-link a:hover {
  color: var(--text-bright);
  text-shadow: 0 0 15px var(--accent-cyan);
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  background: rgba(6, 6, 18, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all var(--transition-normal);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15), var(--glow-cyan);
  background: rgba(6, 6, 18, 1);
}

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

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

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--bg-darker);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  filter: brightness(1.1);
}

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

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-danger {
  background: var(--gradient-danger);
  color: white;
}

.btn-danger:hover {
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.4);
}

.btn-success {
  background: var(--gradient-success);
  color: var(--bg-darker);
}

.btn-success:hover {
  box-shadow: var(--glow-green);
}

.btn-discord {
  background: #5865F2;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
}

.btn-discord:hover {
  background: #4752C4;
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(88, 101, 242, 0.5);
}

.btn-discord:active {
  transform: translateY(0);
}

.btn-discord svg {
  width: 24px;
  height: 24px;
}

.btn-warning {
  background: var(--gradient-gold);
  color: var(--bg-darker);
}

.btn-warning:hover {
  box-shadow: var(--glow-gold);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 32px;
  background: rgba(3, 3, 8, 0.95);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.main-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.5;
}

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

.header-logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  color: var(--bg-darker);
  box-shadow: var(--glow-cyan);
}

.header-title {
  display: flex;
  flex-direction: column;
}

.main-header h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 4px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.header-tagline {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-gold);
  letter-spacing: 3px;
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

#user-info {
  font-family: var(--font-ui);
  color: var(--text-secondary);
  font-weight: 500;
}

.role-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.role-badge.leader {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 140, 0, 0.2));
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.role-badge.officer {
  background: rgba(168, 85, 247, 0.2);
  color: var(--accent-purple);
  border: 1px solid var(--accent-purple);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

.role-badge.member {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
}

.main-nav {
  display: flex;
  gap: 4px;
  padding: 12px 32px;
  background: rgba(13, 13, 26, 0.95);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.nav-btn {
  padding: 12px 24px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  text-transform: uppercase;
}

.nav-btn:hover {
  background: rgba(0, 240, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(168, 85, 247, 0.1));
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
  padding: 32px;
  max-width: 1600px;
  margin: 0 auto;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

.tab-content.active {
  display: block;
}

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.tab-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tab-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--text-bright);
  text-transform: uppercase;
}

#refresh-work-orders-btn,
#refresh-map-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.1rem;
  border-radius: var(--radius-md);
}

/* ============================================
   FILTERS
   ============================================ */

.filters {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.filters select,
.filters input {
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  min-width: 160px;
  transition: all var(--transition-normal);
}

.filters select:focus,
.filters input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.filters input {
  min-width: 280px;
}

.checkbox-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.checkbox-filter:hover {
  border-color: var(--accent-cyan);
}

.checkbox-filter input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.checkbox-filter span {
  white-space: nowrap;
}

.stat-card.pending-review {
  border-color: var(--warning-orange);
}

.stat-card.pending-review .stat-value {
  color: var(--warning-orange);
}

/* ============================================
   ORDERS LIST (Work Orders & Commands)
   ============================================ */

.orders-list {
  display: grid;
  gap: 12px;
}

.order-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* Subtle gradient line on left */
.order-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.order-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateX(4px);
  box-shadow: var(--shadow-md), -4px 0 20px rgba(0, 240, 255, 0.1);
}

.order-card:hover::before {
  opacity: 1;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.order-title {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: 0.5px;
}

.order-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.order-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badge-status-open {
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 255, 136, 0.3);
}
.badge-status-assigned {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}
.badge-status-in_progress {
  background: rgba(255, 136, 0, 0.15);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 136, 0, 0.3);
}
.badge-status-pending_review {
  background: rgba(255, 215, 0, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
}
.badge-status-completed {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.badge-status-cancelled {
  background: rgba(255, 51, 102, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(255, 51, 102, 0.3);
}
.badge-status-active {
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.badge-priority-low {
  background: rgba(136, 136, 168, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(136, 136, 168, 0.3);
}
.badge-priority-normal {
  background: rgba(0, 180, 216, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 180, 216, 0.3);
}
.badge-priority-high {
  background: rgba(255, 136, 0, 0.15);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 136, 0, 0.3);
}
.badge-priority-urgent,
.badge-priority-critical {
  background: rgba(255, 51, 102, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(255, 51, 102, 0.3);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0); }
  50% { box-shadow: 0 0 10px 2px rgba(255, 51, 102, 0.3); }
}

.badge-type {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.order-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

.order-rewards {
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-weight: 600;
}

.reward-item.atlas {
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}
.reward-item.polis {
  color: var(--accent-purple);
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}
.reward-item.none {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
}

.order-items {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding: 8px 14px;
  background: rgba(6, 6, 18, 0.6);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--accent-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-items .items-label {
  color: var(--accent-cyan);
  font-family: var(--font-ui);
  font-weight: 600;
  margin-right: 8px;
}

.order-location {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.order-location .location-icon {
  font-size: 1rem;
}

.order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.order-footer-left,
.order-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-footer-left .assigned-info {
  color: var(--accent-green);
  font-weight: 500;
}

.order-footer-right .due-date {
  color: var(--accent-orange);
}

.order-footer-right .created-date {
  color: var(--text-muted);
}

/* ============================================
   GALAXY MAP
   ============================================ */

.map-controls {
  display: flex;
  gap: 12px;
}

.map-controls input,
.map-controls select {
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
}

.map-controls input {
  width: 220px;
}

.map-container {
  position: relative;
  width: 100%;
  height: 600px;
  background: linear-gradient(180deg, #050510 0%, #0a0a1a 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
}

/* Starfield effect */
.map-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 40px 70px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 50px 160px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 160px 120px, rgba(255, 255, 255, 0.2), transparent);
  background-size: 200px 200px;
  pointer-events: none;
  opacity: 0.5;
}

#galaxy-map {
  width: 100%;
  height: 100%;
  cursor: grab;
  position: relative;
  z-index: 1;
}

#galaxy-map:active {
  cursor: grabbing;
}

.map-tooltip {
  display: none;
  position: absolute;
  background: rgba(13, 13, 26, 0.95);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 100;
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  backdrop-filter: blur(10px);
}

.map-tooltip.visible {
  display: block;
}

.map-tooltip h4 {
  margin: 0 0 6px 0;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
}

.map-tooltip p {
  margin: 0;
  color: var(--text-secondary);
}

.map-legend {
  display: flex;
  gap: 24px;
  justify-content: center;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: relative;
}

.legend-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.4;
  filter: blur(3px);
}

.legend-dot.mud { background: #ef4444; }
.legend-dot.oni { background: #3b82f6; }
.legend-dot.ust { background: #f97316; }
.legend-dot.command {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}
.legend-dot.work-order {
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

.map-system-details {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 120px;
}

.map-system-details.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-ui);
}

.system-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.system-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 2px;
}

.system-faction {
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.system-faction.mud {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.system-faction.oni {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.system-faction.ust {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.system-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.system-info-item {
  font-size: 0.9rem;
}

.system-info-item label {
  color: var(--text-muted);
  display: block;
  font-size: 0.75rem;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.system-work-orders h4,
.system-commands h4 {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.system-work-orders h4 {
  color: var(--accent-green);
}

.system-commands h4 {
  color: #f59e0b;
}

.system-work-order-card,
.map-work-order-item,
.map-command-item {
  background: rgba(6, 6, 18, 0.6);
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
}

.map-work-order-item {
  border-left: 3px solid var(--accent-green);
}

.map-command-item {
  border-left: 3px solid #f59e0b;
}

.system-work-order-card:hover,
.map-work-order-item:hover,
.map-command-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color);
}

.system-work-order-card h5 {
  margin: 0 0 6px 0;
  font-size: 0.9rem;
}

.system-work-order-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Map Tooltip Styles */
.tooltip-title {
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 6px;
  font-size: 1rem;
}

.tooltip-faction {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tooltip-faction.mud { color: #ef4444; }
.tooltip-faction.oni { color: #3b82f6; }
.tooltip-faction.ust { color: #f97316; }

.tooltip-commands {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  color: #f59e0b;
  font-size: 0.8rem;
  font-weight: 500;
}

.tooltip-work-orders {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  color: var(--accent-green);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Map System Details Panel */
.map-system-details {
  display: none;
}

.map-system-details.active {
  display: block;
}

.faction-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.faction-badge.mud {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.faction-badge.oni {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.faction-badge.ust {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.system-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.system-planets {
  margin: 18px 0;
}

.system-planets h4 {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.planets-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.planet-item {
  background: rgba(6, 6, 18, 0.6);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.planet-item:hover {
  border-color: var(--accent-cyan);
}

.planet-name {
  color: var(--text-primary);
  font-weight: 500;
}

.planet-resources {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.planet-item.more {
  color: var(--text-muted);
  font-style: italic;
}

.system-work-orders,
.system-commands {
  margin: 18px 0;
}

.wo-title,
.cmd-title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.wo-meta,
.cmd-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.wo-assignee {
  font-size: 0.85rem;
  color: var(--accent-cyan);
}

.cmd-issuer {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* System Actions */
.system-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

/* Location Picker */
.location-picker {
  position: relative;
}

.location-picker input {
  width: 100%;
}

.location-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--accent-cyan);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.location-results.active {
  display: block;
}

.location-result-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  gap: 10px;
}

.location-result-item:last-child {
  border-bottom: none;
}

.location-result-item:hover {
  background: var(--bg-card-hover);
}

.location-result-item .system-name {
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--text-primary);
}

.location-result-item .system-faction {
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 12px;
}

.location-result-item .system-faction.mud {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.location-result-item .system-faction.oni {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.location-result-item .system-faction.ust {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.location-type-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.location-type-badge.system {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
}

.location-type-badge.planet {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
}

.location-selected {
  display: none;
  margin-top: 10px;
  padding: 12px 16px;
  background: rgba(6, 6, 18, 0.6);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-cyan);
}

.location-selected.active {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.location-selected .location-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.location-selected .clear-location {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.4rem;
  transition: color var(--transition-fast);
  line-height: 1;
}

.location-selected .clear-location:hover {
  color: var(--accent-red);
}

/* ============================================
   RESOURCES GRID
   ============================================ */

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.resource-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.resource-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at top right, rgba(0, 240, 255, 0.1), transparent 70%);
  pointer-events: none;
}

.resource-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.resource-name {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text-bright);
}

.resource-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.resource-tier {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 8px;
  text-transform: uppercase;
}

.tier-1 { background: rgba(136, 136, 168, 0.2); color: #aaa; }
.tier-2 { background: rgba(0, 255, 136, 0.15); color: var(--accent-green); }
.tier-3 { background: rgba(0, 240, 255, 0.15); color: var(--accent-cyan); }
.tier-4 { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }
.tier-5 { background: rgba(255, 215, 0, 0.15); color: var(--accent-gold); }

.category-raw { border-left: 4px solid #8B4513; }
.category-processed { border-left: 4px solid #4682B4; }
.category-component { border-left: 4px solid var(--accent-green); }
.category-advanced { border-left: 4px solid var(--accent-purple); }

.resource-card {
  cursor: pointer;
}

.resource-quantity {
  color: var(--accent-gold);
  margin-top: 4px;
}

.resource-quantity strong {
  color: var(--text-bright);
}

.resource-orders-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.order-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
}

.order-badge.work-order {
  background: rgba(0, 180, 216, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 180, 216, 0.3);
}

.order-badge.command {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Resource Orders Modal */
.resource-orders-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.resource-orders-header h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text-bright);
  margin: 0;
}

.resource-category {
  padding: 4px 12px;
  background: rgba(136, 136, 168, 0.15);
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.orders-section {
  margin-bottom: 24px;
}

.orders-section h4 {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-item {
  background: rgba(6, 6, 18, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.order-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateX(4px);
}

.order-item-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.order-title {
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--text-primary);
}

.order-status {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.order-item-details {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.order-type {
  text-transform: capitalize;
}

.order-qty {
  color: var(--accent-gold);
}

.order-due {
  color: var(--text-muted);
}

/* ============================================
   MEMBERS GRID
   ============================================ */

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all var(--transition-normal);
}

.member-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.member-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--bg-darker);
  box-shadow: var(--glow-cyan);
}

.member-info h3 {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.member-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ============================================
   REWARDS
   ============================================ */

.rewards-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

.reward-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.reward-stat::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

.reward-stat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.reward-stat h3 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.reward-stat p {
  font-family: var(--font-ui);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.reward-stat.atlas h3 {
  color: var(--accent-gold);
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
}

.reward-stat.atlas:hover {
  border-color: var(--accent-gold);
  box-shadow: var(--glow-gold);
}

.reward-stat.polis h3 {
  color: var(--accent-purple);
  text-shadow: 0 0 30px rgba(168, 85, 247, 0.4);
}

.reward-stat.polis:hover {
  border-color: var(--accent-purple);
  box-shadow: var(--glow-purple);
}

.rewards-list {
  display: grid;
  gap: 12px;
}

.reward-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 18px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.reward-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
}

/* ============================================
   BIDS
   ============================================ */

.bids-list {
  display: grid;
  gap: 14px;
}

.bid-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
}

.bid-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-sm);
}

.bid-card.my-bid {
  border-color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.08);
}

.bid-info h4 {
  font-family: var(--font-ui);
  margin-bottom: 10px;
  font-size: 1.05rem;
  font-weight: 600;
}

.bid-amounts {
  display: flex;
  gap: 18px;
  margin-bottom: 10px;
}

.bid-amount {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1rem;
}

.bid-amount.atlas {
  color: var(--accent-gold);
}

.bid-amount.polis {
  color: var(--accent-purple);
}

.bid-message {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-style: italic;
  margin-bottom: 10px;
}

.bid-time {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.bid-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.bid-form {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.bid-form .rewards-inputs {
  margin-bottom: 18px;
}

.bid-form .form-group {
  margin-bottom: 18px;
}

.bid-form textarea {
  width: 100%;
  padding: 14px;
  background: rgba(6, 6, 18, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  resize: vertical;
}

/* ============================================
   MODALS
   ============================================ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.active {
  display: flex;
  animation: modalFadeIn 0.3s ease;
}

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

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 36px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg), var(--glow-cyan);
  animation: modalSlideIn 0.3s ease;
}

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

.modal-content.modal-large {
  max-width: 960px;
}

.close-modal {
  position: absolute;
  top: 18px;
  right: 24px;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  line-height: 1;
}

.close-modal:hover {
  color: var(--accent-red);
  transform: scale(1.1);
}

.modal-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 28px;
  color: var(--text-bright);
}

.modal-content h3 {
  font-family: var(--font-ui);
  margin: 24px 0 14px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================
   TARGET ITEMS / RESOURCES
   ============================================ */

.target-item-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: center;
}

.target-item-row input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(6, 6, 18, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
}

.target-item-row .item-quantity,
.target-item-row .resource-quantity {
  width: 90px;
  flex: none;
}

.rewards-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.members-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  max-height: 220px;
  overflow-y: auto;
  padding: 14px;
  background: rgba(6, 6, 18, 0.6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.member-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-weight: 500;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.member-checkbox:hover {
  background: var(--bg-card-hover);
}

.member-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-cyan);
}

/* ============================================
   PICKER
   ============================================ */

.picker-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  margin-top: 18px;
}

.picker-item {
  padding: 16px;
  background: rgba(6, 6, 18, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.picker-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

/* ============================================
   VIEW MODALS
   ============================================ */

.detail-section {
  margin-bottom: 24px;
}

.detail-section h3 {
  font-family: var(--font-ui);
  margin-bottom: 14px;
  color: var(--accent-cyan);
  font-weight: 600;
}

.detail-items {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-item {
  padding: 10px 16px;
  background: rgba(6, 6, 18, 0.6);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
}

.applications-list {
  display: grid;
  gap: 12px;
}

.application-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px;
  background: rgba(6, 6, 18, 0.6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.application-info h4 {
  font-family: var(--font-ui);
  margin-bottom: 6px;
  font-weight: 600;
}

.application-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ============================================
   UTILITIES
   ============================================ */

.leader-only {
  display: none;
}

.is-leader .leader-only,
.is-officer .leader-only {
  display: inline-block;
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-family: var(--font-display);
  margin-bottom: 14px;
  color: var(--text-primary);
  font-size: 1.3rem;
  letter-spacing: 2px;
}

.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-secondary);
  font-family: var(--font-ui);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding: 16px 20px;
  }

  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px 16px;
  }

  .nav-btn {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .main-content {
    padding: 20px;
  }

  .tab-header {
    flex-direction: column;
    gap: 18px;
    align-items: stretch;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .filters {
    flex-direction: column;
  }

  .filters select,
  .filters input {
    width: 100%;
  }

  .order-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .order-rewards {
    flex-wrap: wrap;
  }

  .map-container {
    height: 400px;
  }

  .login-container {
    padding: 32px 24px;
  }

  .logo h1 {
    font-size: 1.8rem;
    letter-spacing: 4px;
  }
}

/* ============================================
   ANALYTICS & LEADERBOARD
   ============================================ */

.guild-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.stat-card .stat-label {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.stat-card .stat-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-card.atlas .stat-value {
  color: var(--accent-gold);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.stat-card.polis .stat-value {
  color: var(--accent-purple);
  text-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.leaderboard-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.leaderboard-header h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: 2px;
}

.leaderboard-header select {
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
}

.leaderboard-container {
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.leaderboard-table th {
  background: rgba(6, 6, 18, 0.6);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.leaderboard-table tbody tr {
  transition: all var(--transition-normal);
}

.leaderboard-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.leaderboard-table tbody tr.current-user {
  background: rgba(0, 240, 255, 0.08);
  border-left: 3px solid var(--accent-cyan);
}

.leaderboard-table tbody tr.gold {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), transparent);
}

.leaderboard-table tbody tr.silver {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.08), transparent);
}

.leaderboard-table tbody tr.bronze {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.08), transparent);
}

.rank-col {
  width: 70px;
  text-align: center !important;
}

.rank-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
}

.rank-medal.gold {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a1a00;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.rank-medal.silver {
  background: linear-gradient(135deg, #e0e0e0, #a0a0a0);
  color: #1a1a1a;
  box-shadow: 0 0 10px rgba(192, 192, 192, 0.3);
}

.rank-medal.bronze {
  background: linear-gradient(135deg, #cd7f32, #8b4513);
  color: #1a1000;
  box-shadow: 0 0 10px rgba(205, 127, 50, 0.3);
}

.member-col {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-col .member-name {
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--text-primary);
}

.num-col {
  text-align: right !important;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 1px;
}

.atlas-col {
  color: var(--accent-gold);
}

.polis-col {
  color: var(--accent-purple);
}

/* Responsive leaderboard */
@media (max-width: 768px) {
  .guild-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .leaderboard-header {
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .member-col {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ============================================
   FOOTER - AEPHIA BRANDING
   ============================================ */

.main-footer {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-darker) 100%);
  border-top: 1px solid var(--border-color);
  padding: var(--space-lg) var(--space-xl);
  margin-top: auto;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.footer-badge {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--bg-dark);
  background: var(--gradient-primary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  letter-spacing: 2px;
  text-shadow: none;
  box-shadow: var(--glow-cyan);
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.footer-slogan {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 500;
  letter-spacing: 1px;
}

.footer-factions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.faction-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: default;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.faction-dot:hover {
  transform: scale(1.3);
}

.faction-dot.mud {
  background: #8b4513;
  box-shadow: 0 0 8px rgba(139, 69, 19, 0.5);
}

.faction-dot.mud:hover {
  box-shadow: 0 0 15px rgba(139, 69, 19, 0.8);
}

.faction-dot.oni {
  background: #dc143c;
  box-shadow: 0 0 8px rgba(220, 20, 60, 0.5);
}

.faction-dot.oni:hover {
  box-shadow: 0 0 15px rgba(220, 20, 60, 0.8);
}

.faction-dot.ust {
  background: #1e90ff;
  box-shadow: 0 0 8px rgba(30, 144, 255, 0.5);
}

.faction-dot.ust:hover {
  box-shadow: 0 0 15px rgba(30, 144, 255, 0.8);
}

.footer-faction-text {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-left: var(--space-xs);
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.footer-tagline {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.footer-links a {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-bright);
  text-shadow: 0 0 10px var(--accent-cyan);
}

/* Footer responsive */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-brand {
    flex-direction: column;
  }

  .footer-factions {
    justify-content: center;
  }

  .footer-links {
    align-items: center;
  }
}

/* ============================================
   FLEET BUILDER
   ============================================ */

.fleet-builder-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.projects-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-bright);
  margin: 0;
}

.ship-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.ship-project-card {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.ship-project-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--glow-cyan);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.project-ship-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin: 0;
}

.project-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.project-status.status-planning {
  background: rgba(136, 136, 168, 0.2);
  color: var(--text-secondary);
}

.project-status.status-gathering {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
}

.project-status.status-building {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
}

.project-status.status-completed {
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
}

.project-config {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.project-progress {
  margin-bottom: 16px;
}

.progress-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.progress-item.large {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-width: 80px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(136, 136, 168, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-item.large .progress-bar {
  height: 10px;
  border-radius: 5px;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 3px;
  transition: width var(--transition-normal);
}

.progress-fill.components {
  background: var(--gradient-gold);
}

.progress-value {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 35px;
  text-align: right;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.project-priority {
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

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

/* Ship Selection Grid */
.ship-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}

.ship-select-card {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ship-select-card:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-card-hover);
}

.ship-select-name {
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.ship-select-manufacturer {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.ship-select-configs {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Selected Ship Preview */
.selected-ship-preview {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.ship-config-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.ship-config-selector label {
  color: var(--text-secondary);
}

.ship-components-preview {
  margin-bottom: 20px;
}

.components-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.component-category {
  background: rgba(6, 6, 18, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.component-category h4 {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.component-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.component-item {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.component-class {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* Project Detail View */
.project-detail-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.project-detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.project-detail-title h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-bright);
  margin: 0;
}

.project-detail-meta {
  display: flex;
  gap: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.project-notes {
  background: rgba(6, 6, 18, 0.6);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 24px;
}

.project-notes p {
  color: var(--text-secondary);
  margin: 0;
}

.project-detail-progress {
  margin-bottom: 24px;
}

.progress-section h3 {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.progress-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.project-section {
  background: rgba(6, 6, 18, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.project-section h3 {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--accent-cyan);
  margin-bottom: 16px;
}

.section-header-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header-inline h3 {
  margin-bottom: 0;
}

.components-list,
.resources-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.component-row,
.resource-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(13, 13, 26, 0.6);
  border-radius: var(--radius-sm);
}

.component-row.acquired {
  border-left: 3px solid var(--accent-green);
}

.component-row.in_progress {
  border-left: 3px solid var(--accent-cyan);
}

.component-row.pending {
  border-left: 3px solid var(--text-muted);
}

.comp-category {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 100px;
}

.comp-type {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.comp-status {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: capitalize;
}

.res-name {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.res-progress {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 80px;
  text-align: right;
}

.mini-progress {
  width: 60px;
  height: 4px;
  background: rgba(136, 136, 168, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.mini-fill {
  height: 100%;
  background: var(--accent-cyan);
  border-radius: 2px;
}

.empty-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
}

.project-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.btn-success {
  background: var(--gradient-success);
  color: var(--bg-dark);
}

.btn-success:hover {
  box-shadow: var(--glow-green);
}

.btn-danger {
  background: var(--gradient-danger);
  color: white;
}

.btn-danger:hover {
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.4);
}

/* ============================================
   RECIPE ITEMS (Work Order Detail)
   ============================================ */

.recipe-items-section {
  margin-top: 20px;
}

.recipe-items-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.recipe-items-progress .progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(13, 13, 26, 0.8);
  border-radius: 4px;
  overflow: hidden;
}

.recipe-items-progress .progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

.recipe-items-progress .progress-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.recipe-items-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.recipe-items-tabs .tab-btn {
  padding: 6px 16px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.recipe-items-tabs .tab-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

.recipe-items-tabs .tab-btn.active {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: var(--bg-primary);
}

.recipe-items-list {
  max-height: 400px;
  overflow-y: auto;
}

.recipe-items-aggregated,
.recipe-items-by-depth {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recipe-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(13, 13, 26, 0.6);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-color);
}

.recipe-item.acquired {
  border-left-color: var(--accent-green);
  opacity: 0.7;
}

.recipe-item.craftable {
  border-left-color: var(--accent-cyan);
}

.recipe-item.raw-material {
  border-left-color: var(--accent-gold);
}

.recipe-item-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.recipe-item-name {
  font-weight: 500;
  color: var(--text-primary);
}

.recipe-item-depth {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.recipe-item-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.recipe-item-badge.raw {
  background: rgba(255, 215, 0, 0.2);
  color: var(--accent-gold);
}

.recipe-item-badge.craftable {
  background: rgba(0, 212, 255, 0.2);
  color: var(--accent-cyan);
}

.recipe-item-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.recipe-item-progress .mini-progress {
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.recipe-item-progress .mini-fill {
  height: 100%;
  background: var(--accent-green);
}

.recipe-item-qty {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.recipe-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipe-item-actions .status-acquired {
  color: var(--accent-green);
  font-weight: bold;
}

.recipe-item-actions .assigned-to {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  padding: 4px 8px;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 4px;
}

/* Depth groups */
.depth-group {
  margin-bottom: 16px;
}

.depth-header {
  font-size: 0.85rem;
  color: var(--accent-purple);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(138, 43, 226, 0.3);
}

.depth-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ============================================
   FLEET BUILDER - COMPONENT CARDS
   ============================================ */

.project-overall-progress {
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(13, 13, 26, 0.6);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.overall-progress-bar {
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.overall-progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

.overall-progress-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.component-categories {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.component-category-section {
  background: rgba(13, 13, 26, 0.4);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.category-header h3 {
  font-size: 1rem;
  color: var(--accent-cyan);
  margin: 0;
}

.category-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-progress-bar {
  width: 80px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.mini-progress-fill {
  height: 100%;
  background: var(--accent-green);
}

.component-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.component-card {
  background: rgba(13, 13, 26, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.component-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.2);
}

.component-card.acquired {
  border-color: var(--accent-green);
  opacity: 0.7;
}

.component-card.in_progress {
  border-color: var(--accent-gold);
}

.component-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.component-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.component-class-tier {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.component-card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.status-pending {
  background: var(--text-muted);
}

.status-indicator.status-in_progress {
  background: var(--accent-gold);
}

.status-indicator.status-acquired {
  background: var(--accent-green);
}

.status-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.component-card-action {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.view-recipe-btn {
  font-size: 0.8rem;
  color: var(--accent-cyan);
}

/* ============================================
   RECIPE TREE MODAL
   ============================================ */

.modal-fullscreen {
  width: 95vw;
  max-width: none;
  height: 90vh;
  max-height: none;
  display: flex;
  flex-direction: column;
}

.modal-medium {
  max-width: 600px;
}

.recipe-tree-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(13, 13, 26, 0.8);
}

.recipe-tree-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-btn {
  color: var(--accent-cyan);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 6px 12px;
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.back-btn:hover {
  background: var(--accent-cyan);
  color: var(--bg-primary);
}

.recipe-tree-header h2 {
  font-family: var(--font-display);
  color: var(--text-bright);
  margin: 0;
  font-size: 1.3rem;
}

.recipe-tree-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  background: rgba(13, 13, 26, 0.8);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.zoom-btn:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
}

#recipe-tree-zoom-level {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  min-width: 50px;
  text-align: center;
}

.recipe-tree-container {
  flex: 1;
  overflow: auto;
  background: linear-gradient(135deg, #0a0a1a 0%, #0d0d1a 100%);
  position: relative;
}

.recipe-tree-container svg {
  display: block;
  min-width: 100%;
  min-height: 100%;
}

.tree-node {
  transition: transform 0.1s ease;
}

.tree-node:hover rect {
  stroke-width: 2.5;
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.5));
}

/* ============================================
   RECIPE ITEM WORK ORDER MODAL
   ============================================ */

.recipe-item-header {
  margin-bottom: 20px;
}

.recipe-item-header h2 {
  font-family: var(--font-display);
  color: var(--text-bright);
  margin: 0 0 12px 0;
}

.item-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.item-badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.item-badge.raw {
  background: rgba(255, 215, 0, 0.2);
  color: var(--accent-gold);
}

.item-badge.craft {
  background: rgba(0, 212, 255, 0.2);
  color: var(--accent-cyan);
}

.item-badge.qty {
  background: rgba(138, 43, 226, 0.2);
  color: var(--accent-purple);
}

.item-badge.status-open {
  background: rgba(0, 212, 255, 0.2);
  color: var(--accent-cyan);
}

.item-badge.status-in_progress {
  background: rgba(255, 215, 0, 0.2);
  color: var(--accent-gold);
}

.item-badge.status-completed {
  background: rgba(0, 255, 136, 0.2);
  color: var(--accent-green);
}

.work-order-section {
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(13, 13, 26, 0.6);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.work-order-section h3 {
  font-size: 0.9rem;
  color: var(--accent-cyan);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.work-order-info p {
  margin: 6px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.work-order-info strong {
  color: var(--text-primary);
}

.rewards-display {
  display: flex;
  gap: 12px;
}

.reward {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.reward.atlas {
  background: rgba(255, 215, 0, 0.2);
  color: var(--accent-gold);
}

.reward.polis {
  background: rgba(138, 43, 226, 0.2);
  color: var(--accent-purple);
}

.no-rewards {
  color: var(--text-muted);
  font-style: italic;
}

.bids-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bid-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
}

.bid-item.my-bid {
  border: 1px solid var(--accent-cyan);
}

.bidder-name {
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.bid-amount {
  font-size: 0.85rem;
  color: var(--accent-gold);
}

.bid-form-inline {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.bid-form-inline .form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bid-form-inline label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bid-form-inline input {
  width: 100px;
  padding: 8px;
  background: rgba(13, 13, 26, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.action-buttons {
  display: flex;
  gap: 12px;
}

/* Used In Section - Shows what items use this resource */
.used-in-section {
  background: rgba(0, 212, 255, 0.05) !important;
  border-color: rgba(0, 212, 255, 0.3) !important;
}

.used-in-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.used-in-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.used-in-item:hover {
  background: rgba(0, 212, 255, 0.2);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.used-in-name {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
}

.used-in-qty {
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 600;
}

.used-in-arrow {
  color: var(--accent-cyan);
  font-size: 0.9rem;
  opacity: 0.7;
}

.loading-text, .error-text, .empty-text {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}

/* Conflict Warning Section - Shows ingredients already assigned to others */
.conflict-warning-section {
  background: rgba(255, 136, 0, 0.1) !important;
  border-color: rgba(255, 136, 0, 0.5) !important;
  border-width: 2px !important;
}

.conflict-warning-section h3 {
  color: var(--accent-orange) !important;
}

.conflict-warning-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
  line-height: 1.5;
}

.assigned-children-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assigned-child-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 136, 0, 0.15);
  border: 1px solid rgba(255, 136, 0, 0.4);
  border-radius: var(--radius-sm);
}

.assigned-child-name {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
}

.assigned-child-assignee {
  color: var(--accent-orange);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ============================================
   MY WORK ORDERS TAB
   ============================================ */

.my-work-orders-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.my-work-orders-stats .stat-card {
  padding: 16px;
  text-align: center;
}

.my-work-orders-stats .stat-card.completed {
  border-color: var(--accent-green);
}

.my-work-orders-stats .stat-card.completed .stat-value {
  color: var(--accent-green);
}

.source-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.source-badge.work-order {
  background: rgba(0, 212, 255, 0.2);
  color: var(--accent-cyan);
}

.source-badge.fleet-builder {
  background: rgba(168, 85, 247, 0.2);
  color: var(--accent-purple);
}

/* ============================================
   MANAGE USERS TAB (Leader Only)
   ============================================ */

.leader-only-nav {
  display: none;
}

.manage-users-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.manage-user-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.manage-user-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
}

.manage-user-card .user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--bg-dark);
  flex-shrink: 0;
}

.manage-user-card .user-info {
  flex: 1;
}

.manage-user-card .user-info h3 {
  margin: 0 0 4px 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.manage-user-card .user-discord-id {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 8px 0;
}

.manage-user-card .user-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-right: 16px;
}

.manage-user-card .user-actions {
  flex-shrink: 0;
}

/* Role badges */
.role-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.role-badge.leader {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 140, 0, 0.3));
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.role-badge.officer {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(138, 43, 226, 0.3));
  color: var(--accent-purple);
  border: 1px solid var(--accent-purple);
}

.role-badge.member {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 180, 216, 0.2));
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
}

.role-badge.recruit {
  background: rgba(136, 136, 168, 0.2);
  color: var(--text-secondary);
  border: 1px solid var(--text-muted);
}

/* Form actions (for modal buttons) */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-danger {
  background: var(--gradient-danger);
  color: white;
  border: none;
}

.btn-danger:hover {
  box-shadow: var(--glow-cyan);
  filter: brightness(1.1);
}

.btn-success {
  background: var(--gradient-success);
  color: var(--bg-dark);
  border: none;
}
