:root {
  --bg-primary: #0b0f19;
  --bg-card: rgba(21, 28, 45, 0.7);
  --bg-card-hover: rgba(30, 41, 67, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --accent-primary: #6366f1;
  --accent-secondary: #a855f7;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.12) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(6, 182, 212, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism utility */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

/* Layout */
header {
  height: 72px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  box-shadow: var(--shadow-glow);
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.25rem;
  border-radius: 30px;
  border: 1px solid var(--border-color);
}

.nav-btn {
  padding: 0.6rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 25px;
  cursor: pointer;
  transition: var(--transition);
}

.nav-btn:hover {
  color: var(--text-main);
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.8rem;
  border-radius: 30px;
}

.avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-primary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Main Container */
main {
  max-width: 1280px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
  flex: 1;
}

/* Hero Section */
.hero {
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Search Box */
.domain-search-box {
  display: flex;
  max-width: 680px;
  margin: 0 auto;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.9);
  padding: 0.5rem;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.domain-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.8rem 1.5rem;
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border: none;
  padding: 0.8rem 1.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
}

/* Metrics Grid */
.grid-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.icon-purple { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.icon-cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.icon-green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }

.metric-data h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.metric-data .value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Content Sections */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

th {
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem 1.5rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.badge {
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-active { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-pending { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-plesk { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.3); }

/* Quick Action Buttons */
.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.825rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-weight: 500;
}

/* Node Cards Grid Layout */
.node-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.node-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  transition: var(--transition);
}

.node-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

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

.node-title-group h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.2rem;
}

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

.node-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.progress-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.825rem;
}

.progress-label {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-val {
  color: var(--text-main);
  font-weight: 600;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.fill-purple { background: linear-gradient(90deg, #6366f1, #a855f7); }
.fill-cyan { background: linear-gradient(90deg, #06b6d4, #3b82f6); }
.fill-green { background: linear-gradient(90deg, #10b981, #059669); }
.fill-amber { background: linear-gradient(90deg, #f59e0b, #d97706); }

.node-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.meta-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  color: var(--text-muted);
}

.node-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* Modal Overlay & Card */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  padding: 2rem;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: white;
}

.modal-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.modal-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  transition: var(--transition);
}

.modal-tab-btn.active {
  color: var(--accent-primary);
  border-bottom: 2px solid var(--accent-primary);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-group label {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  width: 100%;
  box-sizing: border-box;
}

.form-group textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.form-group input:disabled,
.form-group select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Checkbox/radio rows inside a form-group shouldn't inherit the uppercase label styling
   or full-width block layout used for field labels above inputs. */
.form-group label.checkbox-row,
.form-group label.radio-row {
  display: flex;
  align-items: center;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-main);
  gap: 0.4rem;
}

.form-group label.checkbox-row input,
.form-group label.radio-row input {
  width: auto;
}

/* Dynamically-added addon/spec-field rows (Products modal) */
.dynamic-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.dynamic-row input,
.dynamic-row select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  min-width: 0;
}

.dynamic-row input:focus,
.dynamic-row select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.dynamic-row select.term-billing-type {
  flex: 0 0 auto;
  width: 150px;
}

.dynamic-row input.term-price {
  flex: 1 1 auto;
}

/* Product modal: section dividers, unit-suffixed inputs, radio stacks */
.form-section-divider {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: 1rem;
}

.form-section-divider[style*="display: none"] {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.form-section-divider h4 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.form-section-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

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

.input-with-unit {
  display: flex;
  gap: 0.4rem;
}

.input-with-unit input {
  flex: 1 1 auto;
  min-width: 60px;
  width: 0;
}

.unit-select {
  flex: 0 0 72px;
  width: 72px;
  min-width: 0;
  max-width: 72px;
  padding-left: 0.5rem !important;
  padding-right: 1.5rem !important;
}

.product-page-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.product-sidebar {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 0.75rem;
}

.product-sidebar h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding: 0 0.5rem;
}

.product-sidebar-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 0.25rem;
}

.product-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.product-sidebar-item.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: white;
}

.product-sidebar-new {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .product-page-layout {
    grid-template-columns: 1fr;
  }
  .product-sidebar {
    position: static;
    max-height: none;
  }
}

.checkbox-row-tight {
  margin-top: 0.35rem;
  font-size: 0.8rem;
}

.radio-stack {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}
