/* Secure Cloud — enterprise UI tokens */
:root {
  --bg: #0c1222;
  --surface: #131c2e;
  --surface-2: #1a2740;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8edf5;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-2: #06b6d4;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: linear-gradient(160deg, #0a0f1a 0%, var(--bg) 40%, #0f1729 100%);
  color: var(--text);
  line-height: 1.5;
}
img {
  max-width: 100%;
  height: auto;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(1180px, 92vw);
  margin: 0 auto;
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(12, 18, 34, 0.85);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.brand-mark:hover {
  text-decoration: none;
  color: #fff;
}
.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-size: 0.9rem;
}
.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
}
.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #fff;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.35);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
}
.card h2,
.card h3 {
  margin-top: 0;
}

.grid {
  display: grid;
  gap: 1rem;
}
.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.flash-wrap {
  max-width: min(1180px, 92vw);
  margin: 0.75rem auto 0;
}
.alert {
  padding:0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
}
.alert-success {
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}
.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}
.alert-info {
  background: rgba(59, 130, 246, 0.12);
  color: #bfdbfe;
}
.alert-warning {
  background: rgba(234, 179, 8, 0.12);
  color: #fef08a;
}

.hero {
  padding: 4.5rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% 20% auto;
  height: 70%;
  background: radial-gradient(ellipse, rgba(59, 130, 246, 0.22), transparent 65%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
}
.lead {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 36rem;
}
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}
.pill {
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.hero-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 3rem 0;
}
.stat-strip div {
  background: var(--surface);
  padding: 1.25rem;
  text-align: center;
}
.stat-strip strong {
  display: block;
  font-size: 1.5rem;
  color: #fff;
}
.stat-strip span {
  color: var(--muted);
  font-size: 0.85rem;
}

section.section {
  padding: 3rem 0;
}
.section-head {
  max-width: 640px;
  margin-bottom: 2rem;
}
.section-head h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}
.section-head p {
  margin: 0;
  color: var(--muted);
}
.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.15);
  display: grid;
  place-items: center;
  margin-bottom: 0.75rem;
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Forms */
label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
input:not([type="checkbox"]):not([type="file"]),
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
.form-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data th,
table.data td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.data th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
}
table.data tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-ok {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
.badge-warn {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
}
.badge-admin {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

/* Admin layout */
.admin-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 56px);
}
@media (max-width: 960px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}
.admin-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
}
.admin-sidebar nav a {
  display: block;
  padding: 0.55rem 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}
.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
  color: var(--text);
  background: rgba(59, 130, 246, 0.08);
  border-left-color: var(--accent);
  text-decoration: none;
}
.admin-main {
  padding: 1.5rem min(2rem, 4vw) 2.5rem;
}
.page-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}
.page-desc {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.kpi .val {
  font-size: 1.5rem;
  font-weight: 700;
}
.kpi .lbl {
  color: var(--muted);
  font-size: 0.82rem;
}

.user-shell {
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: calc(100vh - 56px);
}
@media (max-width: 840px) {
  .user-shell {
    grid-template-columns: 1fr;
  }
}
.user-sidebar-inner {
  position: sticky;
  top: 56px;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding-bottom: 2rem;
}
.user-console-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.user-console-brand .mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #06b6d4, #0ea5e9);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
}
.user-console-brand strong {
  display: block;
  font-size: 0.95rem;
}
.user-console-brand span {
  font-size: 0.75rem;
  color: var(--muted);
}
.user-side nav a {
  padding: 0.5rem 1.25rem 0.5rem 1.4rem;
  border-left: 3px solid transparent;
}
.user-side nav a:hover,
.user-side nav a.active {
  border-left-color: #06b6d4;
  background: rgba(6, 182, 212, 0.08);
}
.user-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 0 1.25rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}
.user-chip {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge-shared {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-owned {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.user-side {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0;
}
.user-side a {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}
.user-main {
  padding: 1.5rem min(2rem, 4vw) 2rem;
}

.muted {
  color: var(--muted);
}
.row-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.small {
  font-size: 0.82rem;
}

/* —— Admin console (premium) —— */
.admin-sidebar-inner {
  position: sticky;
  top: 56px;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding-bottom: 2rem;
}
.admin-console-title {
  padding: 1.25rem 1.25rem 0.75rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}
.admin-console-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.admin-console-brand .mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
}
.admin-console-brand strong {
  display: block;
  font-size: 0.95rem;
}
.admin-console-brand span {
  font-size: 0.75rem;
  color: var(--muted);
}
.nav-group-label {
  padding: 0.85rem 1.25rem 0.35rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  font-weight: 600;
}
.admin-sidebar nav a {
  padding: 0.5rem 1.25rem 0.5rem 1.5rem;
  font-size: 0.875rem;
}
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 0 1.25rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}
.breadcrumbs {
  font-size: 0.88rem;
  color: var(--muted);
}
.breadcrumbs a {
  color: var(--muted);
}
.breadcrumbs a:hover {
  color: var(--accent);
}
.breadcrumbs .sep {
  margin: 0 0.4rem;
  opacity: 0.5;
}
.breadcrumbs .here {
  color: var(--text);
  font-weight: 500;
}
.admin-chip {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.detail-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .detail-hero {
    grid-template-columns: 1fr;
  }
}
.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.meta-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
.meta-tile .k {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.meta-tile .v {
  font-weight: 600;
  word-break: break-word;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.tabs {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tabs a {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid var(--border);
  text-decoration: none;
}
.tabs a:hover {
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.35);
}
.tabs a.active {
  background: rgba(59, 130, 246, 0.15);
  color: #fff;
  border-color: rgba(59, 130, 246, 0.4);
}
.mono {
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.8rem;
  word-break: break-all;
}
.dl-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 0.5rem;
}
.dl-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}
.dashboard-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}
.inline-form {
  display: inline;
}
h1.page-title {
  font-size: 1.65rem;
  letter-spacing: -0.02em;
}
.card h3,
.card .dashboard-section-title {
  margin-top: 0;
}
