*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #0f4c81;
  --primary-dark: #0a3560;
  --primary-light: #1a6bb5;
  --accent: #00a896;
  --accent-light: #02c39a;
  --text: #1a1a2e;
  --text-muted: #5c6370;
  --bg: #ffffff;
  --bg-alt: #f4f7fb;
  --bg-dark: #0d1b2a;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(15, 76, 129, 0.08);
  --shadow-lg: 0 12px 48px rgba(15, 76, 129, 0.15);
  --radius: 12px;
  --radius-lg: 20px;
  --nav-height: 72px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navigation ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-lang {
  display: flex;
  align-items: center;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.lang-btn:hover {
  color: var(--primary);
}

.lang-btn.active {
  background: var(--primary);
  color: #fff;
}

.nav-cta {
  background: var(--primary);
  color: white !important;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}

.nav-cta:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: var(--transition);
}

/* ── Hero ── */
.hero {
  padding: calc(var(--nav-height) + 80px) 0 100px;
  background: linear-gradient(160deg, #f0f6fc 0%, #e8f4f8 50%, #f4f7fb 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(0, 168, 150, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 20px;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 76, 129, 0.3);
}

.btn-outline {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.hero-visual {
  position: relative;
}

.hero-card-stack {
  position: relative;
  height: 400px;
}

.hero-card {
  position: absolute;
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  width: 280px;
}

.hero-card:nth-child(1) {
  top: 0;
  left: 0;
  z-index: 3;
  animation: float 6s ease-in-out infinite;
}

.hero-card:nth-child(2) {
  top: 60px;
  left: 120px;
  z-index: 2;
  animation: float 6s ease-in-out 1s infinite;
}

.hero-card:nth-child(3) {
  top: 140px;
  left: 40px;
  z-index: 1;
  animation: float 6s ease-in-out 2s infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.hero-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.hero-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.hero-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Sections ── */
section {
  padding: 100px 0;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 60px;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ── About ── */
.about {
  background: var(--bg);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.about-card {
  text-align: center;
  padding: 40px 28px;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}

.about-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.about-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.about-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.about-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── Software Grid ── */
.software {
  background: var(--bg-alt);
}

.software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.software-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.software-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.software-card-header {
  padding: 32px 32px 0;
}

.software-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(0, 168, 150, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.software-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.software-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.software-tagline {
  font-size: 0.9rem;
  color: var(--primary-light);
  font-weight: 600;
  margin-bottom: 12px;
}

.software-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.software-price {
  margin-top: 16px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
}

.software-price span {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

.software-features {
  padding: 24px 32px;
  flex: 1;
}

.software-features ul {
  list-style: none;
}

.software-features li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.software-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.software-card-footer {
  padding: 0 32px 32px;
  display: flex;
  gap: 10px;
}

.btn-details {
  flex: 1;
  justify-content: center;
  background: var(--bg-alt);
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-details:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-buy {
  flex: 1;
  justify-content: center;
  background: var(--accent);
  color: white;
}

.btn-buy:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 168, 150, 0.35);
}

/* ── Contact ── */
.contact {
  background: var(--bg-dark);
  color: white;
}

.contact .section-label {
  color: var(--accent-light);
}

.contact .section-header h2 {
  color: white;
}

.contact .section-header p {
  color: rgba(255, 255, 255, 0.7);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.contact-info h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.contact-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.contact-info-head h3 {
  margin-bottom: 0;
}

.contact-edit-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-light);
  white-space: nowrap;
}

.contact-edit-link:hover {
  color: #fff;
}

.contact-item a {
  color: rgba(255, 255, 255, 0.8);
}

.contact-item a:hover {
  color: #fff;
}

.nav-login-out {
  font-size: 0.9rem;
  color: var(--text-muted) !important;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.contact-item-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-item p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

.contact-item strong {
  display: block;
  color: white;
  margin-bottom: 4px;
}

.contact-form {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.9);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group select option {
  background: var(--bg-dark);
  color: white;
}

.btn-accent {
  background: var(--accent);
  color: white;
  width: 100%;
  justify-content: center;
}

.btn-accent:hover {
  background: var(--accent-light);
}

/* ── Footer ── */
.footer {
  background: #080f18;
  color: rgba(255, 255, 255, 0.6);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  margin-top: 16px;
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer h4 {
  color: white;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.98);
  transition: transform var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 32px 32px 0;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-alt);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.modal-close:hover {
  background: var(--border);
}

.modal-body {
  padding: 24px 32px 32px;
}

.modal-section {
  margin-bottom: 28px;
}

.modal-section h4 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-section p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.modal-list {
  list-style: none;
}

.modal-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.modal-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.modal-ideal {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 20px;
  border-left: 4px solid var(--accent);
}

.modal-ideal p {
  font-style: italic;
}

/* ── Loading ── */
.loading {
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 968px) {
  .hero-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    display: none;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .software-grid {
    grid-template-columns: 1fr;
  }

  section {
    padding: 70px 0;
  }
}

/* ── Checkout / Ecommerce ── */
.checkout-page {
  background: var(--bg-alt);
  min-height: 100vh;
}

.checkout {
  padding: calc(var(--nav-height) + 48px) 0 80px;
}

.checkout-header {
  max-width: 640px;
  margin-bottom: 40px;
}

.checkout-header h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 10px;
}

.checkout-header p {
  color: var(--text-muted);
}

.checkout-messages {
  margin-bottom: 24px;
}

.checkout-messages .msg {
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 32px;
  align-items: start;
}

.order-summary {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  position: sticky;
  top: calc(var(--nav-height) + 24px);
}

.order-product h2 {
  font-size: 1.2rem;
  margin: 8px 0;
}

.order-license {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.order-includes {
  list-style: none;
  margin: 24px 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.order-includes li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.order-includes li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.order-price-box {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 20px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.price-row.total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
}

.price-row.total strong {
  color: var(--primary);
  font-size: 1.35rem;
}

.price-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.checkout-form-wrap {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
}

.checkout-form-wrap h3 {
  font-size: 1.2rem;
  margin-bottom: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group.light {
  margin-bottom: 18px;
}

.form-group.light label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group.light input,
.form-group.light textarea,
.form-group.light select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg-alt);
  color: var(--text);
}

.form-group.light input:focus,
.form-group.light textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group.light textarea {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.btn-buy-submit {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  padding: 16px;
  font-size: 1.05rem;
}

.checkout-legal {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 16px;
}

.success-card {
  max-width: 560px;
  margin: 40px auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  background: rgba(0, 168, 150, 0.12);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
}

.success-card h1 {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.success-card > p {
  color: var(--text-muted);
  margin-bottom: 28px;
}

.success-details {
  text-align: left;
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 28px;
}

.success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 968px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .order-summary {
    position: static;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* -- Manage UI -- */
.manage-page {
  background: var(--bg-alt);
  min-height: 100vh;
}

.manage-nav {
  background: var(--bg-dark);
  height: 64px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.manage-nav .nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.manage-nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.manage-nav-link {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 6px;
}

.manage-nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.manage-main {
  padding: 40px 0 80px;
}

.manage-login-card {
  max-width: 420px;
  margin: 60px auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.manage-login-card h1 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 8px;
}

.manage-login-card > p {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.manage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.manage-header h1 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.manage-header p,
.muted {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.manage-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.manage-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}

.manage-stat strong {
  display: block;
  font-size: 1.5rem;
  color: var(--primary);
}

.manage-stat span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.manage-alerts {
  margin-bottom: 16px;
}

.manage-alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.manage-alert.success {
  background: rgba(0,168,150,0.12);
  color: var(--accent);
}

.manage-alert.error {
  background: rgba(231,76,60,0.1);
  color: #e74c3c;
}

.manage-table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
  box-shadow: var(--shadow);
}

.manage-table {
  width: 100%;
  border-collapse: collapse;
}

.manage-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.manage-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  vertical-align: middle;
}

.manage-table tr:last-child td {
  border-bottom: none;
}

.manage-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.manage-actions form {
  display: inline;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
}

.btn-sm:hover {
  background: var(--bg-alt);
}

.btn-sm.danger {
  color: #e74c3c;
  border-color: rgba(231,76,60,0.35);
}

.btn-sm.danger:hover {
  background: #e74c3c;
  color: #fff;
}

.badge-on {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
  background: rgba(0,168,150,0.12);
  color: var(--accent);
}

.badge-off {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
  background: rgba(108,117,125,0.15);
  color: #6c757d;
}

.manage-form-page {
  max-width: 900px;
}

.manage-form-page h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.manage-form-card {
  margin-top: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}

.manage-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}

.manage-form-grid .full {
  grid-column: 1 / -1;
}

.manage-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-alt);
  color: var(--text);
}

.manage-input:focus {
  outline: none;
  border-color: var(--primary);
}

.manage-section {
  margin: 28px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--primary);
  font-size: 1rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: auto;
}

.manage-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.errorlist {
  list-style: none;
  color: #e74c3c;
  font-size: 0.85rem;
  margin-top: 4px;
}

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px !important;
}

@media (max-width: 900px) {
  .manage-stats {
    grid-template-columns: 1fr 1fr;
  }

  .manage-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Hardware section */
.hardware {
  background: var(--bg);
}

.manage-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.manage-tab {
  padding: 10px 18px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.manage-tab:hover {
  color: var(--primary);
}

.manage-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

