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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f1f5f9;
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-brand h2 { color: #fff; font-size: 24px; letter-spacing: 1px; }
.sidebar-brand .subtitle { font-size: 12px; color: var(--sidebar-text); }

.nav-links { list-style: none; flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-links li a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: background 0.2s;
  font-size: 14px;
}
.nav-links li a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-links li a.active { background: var(--primary); color: #fff; }
.nav-links .icon { width: 20px; text-align: center; }
.nav-section-title {
  padding: 18px 20px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.user-info span { font-size: 13px; word-break: break-all; }
.btn-logout {
  display: inline-block; margin-top: 8px;
  color: #fca5a5; font-size: 13px; text-decoration: none;
}
.btn-logout:hover { color: #fff; }

.content {
  margin-left: 240px;
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 28px; color: var(--text); }
.page-header p { color: var(--text-muted); margin-top: 4px; }

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

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card h3 { font-size: 16px; margin-bottom: 12px; color: var(--text); }
.card p { margin: 6px 0; font-size: 14px; }
.card .btn { margin-top: 12px; }

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn:hover { background: var(--primary-dark); }
.btn-sm { padding: 6px 12px; font-size: 13px; margin: 2px; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: rgba(37,99,235,0.08); }

.btn-google {
  display: block; width: 100%;
  background: #fff; color: #333;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  font-size: 15px;
  transition: background 0.2s;
}
.btn-google:hover { background: #f8fafc; }
.btn-local {
  display: block; width: 100%;
  background: var(--sidebar-bg); color: #fff;
  padding: 12px; border-radius: 6px;
  text-align: center; text-decoration: none;
  font-size: 15px; margin-top: 12px;
}
.btn-local:hover { background: #1e293b; }

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}
.status-ok { background: #dcfce7; color: var(--success); }
.status-warn { background: #fef3c7; color: var(--warning); }
.status-error { background: #fee2e2; color: var(--danger); }
.status-success { background: #dcfce7; color: var(--success); }

.status-mini {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.status-mini.status-completed, .status-mini.status-success, .status-mini.status-ok,
.status-mini.status-running { background: #dcfce7; color: var(--success); }
.status-mini.status-pending, .status-mini.status-processing { background: #fef3c7; color: var(--warning); }
.status-mini.status-failed, .status-mini.status-error, .status-mini.status-cancelled { background: #fee2e2; color: var(--danger); }

.verif {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.verif-ok { background: #dcfce7; color: var(--success); border: 1px solid #86efac; }
.verif-no { background: #f3f4f6; color: #6b7280; border: 1px solid #d1d5db; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.table th { font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; }
.table tr:hover td { background: #f8fafc; }

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin: 12px 0;
  font-size: 14px;
}
.alert-success { background: #dcfce7; color: var(--success); }
.alert-error { background: #fee2e2; color: var(--danger); }
.alert-warning { background: #fef3c7; color: var(--warning); }
.hidden { display: none; }

.inline-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0;
}
.inline-form input[type="text"], .inline-form input:not([type="checkbox"]), .inline-form select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  min-width: 250px;
  flex: 1;
}
.inline-form input[type="text"]:focus, .inline-form select:focus {
  outline: none;
  border-color: var(--primary);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
}

.text-sm { font-size: 13px; }
.text-muted { color: var(--text-muted); }

code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'SF Mono', Consolas, monospace;
}

/* Login page */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; text-align: center; }
.login-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.login-buttons { margin-top: 16px; }

.login-form .form-field { margin-bottom: 12px; }
.login-form input[type="email"], .login-form input[type="password"] {
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
}
.login-form input:focus { outline: none; border-color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-block { width: 100%; display: block; }
.divider { text-align: center; margin: 16px 0 12px; color: var(--text-muted); font-size: 13px; }
.divider span { background: var(--card-bg); padding: 0 10px; }

/* Nginx editor */
.file-name-input { min-width: 280px; flex: 0 1 auto; }
.wrap { flex-wrap: wrap !important; }
.code-editor {
  width: 100%; min-height: 420px; resize: vertical; margin: 12px 0;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 12px; font-family: 'SF Mono', Consolas, monospace; font-size: 13px; line-height: 1.5;
  background: #0f172a; color: #e2e8f0;
}
.code-editor:focus { outline: none; border-color: var(--primary); }

/* DDNS */
.global-ip-box { display: flex; align-items: center; gap: 16px; padding: 8px 0; }
.global-ip { font-size: 28px; font-weight: 700; font-family: 'SF Mono', Consolas, monospace; color: var(--primary); }
.global-ip.ip-ok { color: var(--success); }
.host-ip { font-family: 'SF Mono', Consolas, monospace; }

/* Hamburger (hidden on desktop) */
.hamburger {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 210;
  background: var(--sidebar-bg);
  border: none;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  width: 44px; height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99;
}

/* Responsive */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 200;
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .content {
    margin-left: 0;
    padding: 64px 16px 24px;
  }

  .page-header h1 { font-size: 22px; }
  .page-header p { font-size: 13px; }

  .dashboard-grid { grid-template-columns: 1fr; }

  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form input[type="text"],
  .inline-form input:not([type="checkbox"]),
  .inline-form select {
    min-width: 0;
    width: 100%;
  }

  .grid-form { grid-template-columns: 1fr; }
  .grid-form input, .grid-form select { width: 100%; }

  .cert-detail-grid { grid-template-columns: 1fr; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .card { padding: 16px; }

  .modal { padding: 0; align-items: flex-end; }
  .modal-box { max-width: 100%; border-radius: 12px 12px 0 0; max-height: 92vh; }
  .modal-body { padding: 16px; }

  .perm-grid { grid-template-columns: 1fr; }

  .global-ip { font-size: 20px; }

  .file-name-input { min-width: 0; width: 100%; }
  .code-editor { min-height: 280px; font-size: 12px; }

  .actions-cell { display: flex; flex-wrap: wrap; gap: 4px; }
  .actions-cell .btn { margin: 0; }

  .role-head { flex-direction: column; align-items: flex-start; }
}

/* Cert management */
.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 14px 0;
  align-items: end;
}
.grid-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}
.grid-form input, .grid-form select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
.grid-form input:focus, .grid-form select:focus { outline: none; border-color: var(--primary); }
.grid-form .btn { justify-self: start; }

.cert-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 20px;
  margin: 14px 0;
}
.cert-detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.cert-detail-grid .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; }
.cert-detail-grid .val { font-size: 14px; word-break: break-word; }
.val.mono, .mono { font-family: 'SF Mono', Consolas, monospace; font-size: 12px; }
.status-mini.status-expired { background: #fee2e2; color: var(--danger); }

.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-right: 4px; margin-bottom: 4px; }

/* Permissions / roles */
.role-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.role-head h3 { margin: 0; }
.perm-count { margin-left: 8px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 14px; }
.perm-group { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.perm-group-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 700; margin-bottom: 8px; }
.perm-group .checkbox-label { display: flex; padding: 3px 0; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal.hidden { display: none; }
.modal-box {
  background: var(--card-bg);
  border-radius: 12px;
  max-width: 760px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px; }

/* ============ Nginx Visual Editor ============ */
.ng-topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.ng-topbar h3 { margin: 0; white-space: nowrap; }
.ng-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ng-actions .btn { margin: 0; }
.ng-dirty { display: none; font-size: 13px; font-weight: 600; color: var(--warning); }
.ng-dirty.visible { display: inline; }
.ng-parse-state { font-size: 12px; font-weight: 600; margin-left: 8px; }
.ng-parse-state.ok { color: var(--success); }
.ng-parse-state.err { color: var(--danger); }

.ng-filebar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.ng-filebar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; min-width: 200px; }
.ng-filebar select:focus { outline: none; border-color: var(--primary); }
.ng-filebar input[type="text"] { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; min-width: 180px; flex: 1; }
.ng-filebar input[type="text"]:focus { outline: none; border-color: var(--primary); }
.ng-filebar label { font-size: 13px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ng-filebar .btn-sm { padding: 6px 12px; font-size: 13px; }

/* Two-pane layout */
.ng-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
  min-height: 600px;
}
.ng-pane {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ng-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: #f8fafc;
}
.ng-pane-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.ng-raw { border: none; border-radius: 0; flex: 1; min-height: 0; resize: none; }
.ng-raw:focus { border-color: var(--primary); }
.ng-boxes { flex: 1; overflow-y: auto; padding: 16px; }

.ng-tip {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

.ng-filebar-fmt { margin-left: auto; }

/* Box styles */
.ng-box { margin-bottom: 12px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.ng-box-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: grab;
  border-bottom: 1px solid transparent;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
}
.ng-box-head:active { cursor: grabbing; }
.ng-box-body { padding: 8px 12px 12px; }
.ng-box-body:empty::before { content: 'vuoto'; color: var(--text-muted); font-size: 12px; font-style: italic; }

.ng-grip { color: var(--text-muted); font-size: 16px; line-height: 1; cursor: grab; }
.ng-grip:active { cursor: grabbing; }
.ng-kind {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
}
.ng-title { color: var(--text); font-weight: 400; font-family: 'SF Mono', Consolas, monospace; font-size: 12px; }
.ng-space { flex: 1; }
.ng-action {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.ng-action:hover { background: #f1f5f9; color: var(--text); }
.ng-del:hover { color: var(--danger); border-color: var(--danger); }

/* Color variants */
.ng-server { border-left: 3px solid #7c3aed; }
.ng-server > .ng-box-head { background: #f5f3ff; }
.ng-server > .ng-box-head .ng-kind { background: #ede9fe; color: #6d28d9; }
.ng-location { border-left: 3px solid #0891b2; }
.ng-location > .ng-box-head { background: #ecfeff; }
.ng-location > .ng-box-head .ng-kind { background: #cffafe; color: #0e7490; }
.ng-upstream { border-left: 3px solid #059669; }
.ng-upstream > .ng-box-head { background: #ecfdf5; }
.ng-upstream > .ng-box-head .ng-kind { background: #d1fae5; color: #047857; }
.ng-events { border-left: 3px solid #d97706; }
.ng-events > .ng-box-head { background: #fffbeb; }
.ng-events > .ng-box-head .ng-kind { background: #fef3c7; color: #92400e; }
.ng-http { border-left: 3px solid #0d9488; }
.ng-http > .ng-box-head { background: #f0fdfa; }
.ng-http > .ng-box-head .ng-kind { background: #ccfbf1; color: #0f766e; }
.ng-block { border-left: 3px solid #94a3b8; }
.ng-block > .ng-box-head { background: #f8fafc; }
.ng-block > .ng-box-head .ng-kind { background: #f1f5f9; color: #475569; }

/* Directive rows */
.ng-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
}
.ng-row:last-child { border-bottom: none; }
.ng-row[draggable="true"] { cursor: default; }
.ng-row-comment { gap: 8px; padding: 3px 0; }
.ng-comment-text {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  flex: 1;
}
.ng-in {
  border: none;
  background: transparent;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 4px;
  outline: none;
  color: var(--text);
}
.ng-in:focus { background: #f1f5f9; }
.ng-in-key { min-width: 120px; max-width: 220px; font-weight: 600; color: #7c3aed; }
.ng-in-args { flex: 1; }
.ng-x {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.ng-row:hover .ng-x,
.ng-box-head:hover .ng-del { opacity: 1; }
.ng-x:hover { color: var(--danger); background: #fee2e2; }

/* DnD highlights */
.ng-drop-before { box-shadow: inset 0 2px 0 0 var(--primary); }
.ng-drop-after { box-shadow: inset 0 -2px 0 0 var(--primary); }
.ng-box.dragging, .ng-row.dragging, .ng-box-head.dragging { opacity: 0.4; }

/* Box list spacing */
.ng-box-list { display: flex; flex-direction: column; }
.ng-box-list > .ng-box { margin-bottom: 12px; }
.ng-box-list > .ng-row,
.ng-box-list > .ng-row-comment { margin-bottom: 2px; padding-left: 4px; }

/* Nested box indentation */
.ng-box-body .ng-box { margin-top: 6px; margin-bottom: 6px; }

/* Responsive */
@media (max-width: 900px) {
  .ng-panes { grid-template-columns: 1fr; min-height: auto; }
  .ng-raw { min-height: 260px; }
  .ng-boxes { min-height: 300px; }
}
@media (max-width: 768px) {
  .ng-filebar { flex-direction: column; align-items: stretch; }
  .ng-filebar select,
  .ng-filebar input[type="text"] { min-width: 0; width: 100%; }
}

/* ------------------------------------------------------------------ */
/* Landing pages (hub + portal): standalone shell, no sidebar          */
/* ------------------------------------------------------------------ */
.landing-body {
  display: block;
  background: var(--bg);
}

.landing-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 32px;
  background: var(--sidebar-bg);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.landing-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  font-size: 14px;
  letter-spacing: 1px;
}
.landing-topnav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.landing-topnav > a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
}
.landing-topnav > a:hover { color: #fff; }
.landing-user { font-size: 13px; color: #94a3b8; }

.landing-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 32px 64px;
}

.landing-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 32px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}
.landing-footer a { color: var(--text-muted); }

.hub-intro { margin-bottom: 24px; max-width: 640px; }

.landing-section { margin-top: 36px; }
.landing-section-head { margin-bottom: 16px; }
.landing-section-head h2 { font-size: 20px; }
.landing-section-head p { font-size: 13px; }

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.app-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
  border-color: var(--primary);
}
.app-card-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 10px;
  background: var(--primary);
  opacity: 0.12;
}
.app-card-body { flex: 1; }
.app-card-body h3 { font-size: 16px; margin-bottom: 4px; }
.app-card-body p { font-size: 13px; }
.app-card-host { font-size: 12px; color: var(--text-muted); }
.app-card-arrow { color: var(--primary); font-size: 18px; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.tool-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.tool-card:hover { border-color: var(--primary); background: #f8fafc; }
.tool-card-icon {
  width: 22px; height: 22px; flex: 0 0 22px;
  border-radius: 6px;
  background: var(--primary);
  opacity: 0.14;
}
.landing-header { margin-bottom: 8px; }

