@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wdth,wght@12..96,75..100,500..800&family=IBM+Plex+Mono:wght@500;600&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --mc-ink: #081a2c;
  --mc-ink-soft: #102a43;
  --mc-quartz: #f4f7fa;
  --mc-paper: #ffffff;
  --mc-facet: #2e6dcc;
  --mc-azurite: #184b8a;
  --mc-amethyst: #7656d8;
  --mc-citrine: #d8a53a;
  --mc-success: #1f8d70;
  --mc-danger: #c43d4f;
  --mc-muted: #586b7d;
  --mc-line: #cad6e2;
  --mc-line-soft: #e4ebf1;
  --mc-display: "Bricolage Grotesque", sans-serif;
  --mc-body: "Manrope", sans-serif;
  --mc-mono: "IBM Plex Mono", monospace;
  --mc-shadow-sm: 0 8px 24px rgba(8, 26, 44, 0.07);
  --mc-shadow-md: 0 22px 58px rgba(8, 26, 44, 0.11);
  --mc-radius-sm: 6px;
  --mc-radius-md: 12px;
  --mc-radius-lg: 18px;
  --mc-ease: cubic-bezier(.22, 1, .36, 1);

  /* Compatibility bridge for the existing app shell. */
  --font-family: var(--mc-body);
  --bg-primary: var(--mc-quartz);
  --bg-secondary: #edf2f6;
  --content-bg: var(--mc-quartz);
  --text-primary: var(--mc-ink);
  --text-secondary: var(--mc-muted);
  --border-color: var(--mc-line);
  --primary: var(--mc-facet);
  --primary-color: var(--mc-facet);
  --accent: var(--mc-amethyst);
  --sidebar-bg: #061522;
  --sidebar-text: #adc0d1;
  --sidebar-text-active: #ffffff;
  --sidebar-section-label: #6f899e;
  --sidebar-active-bg: linear-gradient(120deg, rgba(46, 109, 204, .96), rgba(118, 86, 216, .88));
  --sidebar-active-border: #d8a53a;
  --sidebar-hover-bg: rgba(139, 185, 228, .11);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  background:
    linear-gradient(rgba(24, 75, 138, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 75, 138, .028) 1px, transparent 1px),
    var(--mc-quartz) !important;
  background-size: 44px 44px !important;
  color: var(--mc-ink);
  font-family: var(--mc-body) !important;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.page-title,
.brand-copy,
.sidebar-brand {
  font-family: var(--mc-display);
  letter-spacing: -.025em;
}

code,
pre,
kbd,
.mono,
.eyebrow,
.badge,
.status,
.status-badge,
.sidebar-section-title,
.table thead,
table thead {
  font-family: var(--mc-mono);
}

a,
button,
input,
select,
textarea,
summary {
  touch-action: manipulation;
}

a,
button {
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 220ms var(--mc-ease),
    transform 220ms var(--mc-ease);
}

:focus-visible {
  outline: 3px solid var(--mc-citrine) !important;
  outline-offset: 3px !important;
}

button,
.button,
.btn,
.btn-primary,
.btn-secondary,
[role="button"] {
  min-height: 44px;
  border-radius: var(--mc-radius-sm);
  font-family: var(--mc-body);
  font-weight: 800;
}

.btn-primary,
.button-primary,
button.primary,
[type="submit"] {
  border-color: transparent;
  background: var(--mc-facet);
  color: #fff;
  box-shadow: 0 10px 24px rgba(46, 109, 204, .2);
}

.btn-primary:hover,
.button-primary:hover,
button.primary:hover,
[type="submit"]:hover {
  background: var(--mc-azurite);
  box-shadow: 0 15px 32px rgba(46, 109, 204, .28);
  transform: translateY(-1px);
}

input,
select,
textarea {
  min-height: 44px;
  border: 1px solid var(--mc-line) !important;
  border-radius: var(--mc-radius-sm) !important;
  background: var(--mc-paper);
  color: var(--mc-ink);
  font-family: var(--mc-body);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #9eb2c4 !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--mc-facet) !important;
  box-shadow: 0 0 0 3px rgba(46, 109, 204, .12);
}

.app-layout,
.app-shell,
.page-shell,
.main-content,
.content,
main {
  min-width: 0;
}

.sidebar {
  border-right: 1px solid rgba(195, 218, 239, .14);
  background:
    radial-gradient(circle at 22% 6%, rgba(118, 86, 216, .18), transparent 24%),
    linear-gradient(180deg, #07192c, #061522 72%) !important;
  box-shadow: 14px 0 40px rgba(8, 26, 44, .13);
}

.sidebar-brand {
  color: #fff;
}

.sidebar-section-title {
  letter-spacing: .1em;
}

.sidebar-link {
  min-height: 44px;
  border-radius: var(--mc-radius-sm);
}

.sidebar-link.active {
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

.sidebar-link.active::before {
  background: var(--mc-citrine);
}

.topbar,
.app-header,
.page-header,
.navbar {
  border-bottom-color: var(--mc-line-soft);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px);
}

.card,
.panel,
.stat-card,
.metric-card,
.dashboard-card,
.content-card,
.form-card,
.sidebar-card,
.table-card,
.pricing-card {
  border: 1px solid var(--mc-line-soft);
  border-radius: var(--mc-radius-md);
  background: var(--mc-paper);
  box-shadow: var(--mc-shadow-sm);
}

.card:hover,
.stat-card:hover,
.metric-card:hover,
.dashboard-card:hover {
  border-color: #c5d3df;
  box-shadow: var(--mc-shadow-md);
}

table {
  border-collapse: separate;
  border-spacing: 0;
  background: var(--mc-paper);
}

table thead {
  color: var(--mc-muted);
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

table th,
table td {
  border-bottom-color: var(--mc-line-soft) !important;
}

.badge,
.status,
.status-badge {
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --mc-quartz: #071522;
  --mc-paper: #0b2034;
  --mc-ink: #e8f0f7;
  --mc-muted: #9db0c1;
  --mc-line: #294158;
  --mc-line-soft: #1c3449;
  --content-bg: #071522;
  --text-primary: #e8f0f7;
  --text-secondary: #9db0c1;
  --border-color: #294158;
}

html[data-theme="dark"] body {
  background:
    linear-gradient(rgba(139, 185, 228, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 185, 228, .035) 1px, transparent 1px),
    #071522 !important;
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .app-header,
html[data-theme="dark"] .page-header,
html[data-theme="dark"] .navbar,
html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .content-card,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .table-card,
html[data-theme="dark"] table,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--mc-paper);
  color: var(--mc-ink);
}

@media (max-width: 760px) {
  body {
    background-size: 32px 32px !important;
  }

  .card,
  .panel,
  .stat-card,
  .metric-card,
  .dashboard-card,
  .content-card,
  .form-card,
  .table-card {
    border-radius: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
