/*
  Global NotaryOSS Theme (Gold/Charcoal)
  Loaded after base styles to retheme existing UI classes.
*/

:root {
  --font-family-base: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --shell-bg: #1a1f27;
  --shell-surface: #15171c;
  --shell-panel: #101318;
  --shell-topbar: #15171c;

  --shell-accent: #e6b93d;
  --shell-accent-2: #f0c84b;
  --shell-accent-dim: rgba(230, 185, 61, 0.16);

  --shell-border: #2d3440;
  --shell-border-strong: rgba(230, 185, 61, 0.56);

  --shell-text: #f3f4f6;
  --shell-muted: #b6c2d1;
  --shell-faint: #8a96a8;

  --shell-hover-bg: #202632;

  --shell-danger: #ef4444;
  --shell-success: #22c55e;
  --shell-info: #3b82f6;

  --shell-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shell-shadow-md: 0 10px 26px rgba(0, 0, 0, 0.28);
  --shell-shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.42);

  --shell-radius-sm: 8px;
  --shell-radius-md: 10px;
  --shell-radius-lg: 14px;

  /* Bridge existing shell token names used across the app */
  --bg-page: var(--shell-bg);
  --bg-sidebar: var(--shell-panel);
  --bg-sidebar-hover: var(--shell-hover-bg);
  --bg-topbar: var(--shell-topbar);
  --bg-content: #131924;
  --border: var(--shell-border);
  --border-strong: var(--shell-border-strong);
  --blue: var(--shell-accent);
  --blue-dim: var(--shell-accent-dim);
  --blue-glow: rgba(230, 185, 61, 0.08);
  --text: var(--shell-text);
  --text-muted: var(--shell-muted);
  --text-faint: var(--shell-faint);
}

html,
body {
  background: var(--shell-bg);
  color: var(--shell-text);
  font-family: var(--font-family-base);
}

body.app-body {
  background: var(--shell-bg) !important;
  color: var(--shell-text) !important;
  font-family: var(--font-family-base) !important;
}

body,
body *:not(code):not(pre):not(kbd):not(samp):not(svg):not(path):not(use) {
  font-family: var(--font-family-base) !important;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* Global surfaces */
.container,
.hero,
.card,
.auth-card,
.app-panel,
.glass-panel,
.table-shell,
.demo-table-wrap,
.demo-stat,
.kpi-card,
.chart-section {
  background: var(--shell-surface) !important;
  border: 1px solid var(--shell-border) !important;
  color: var(--shell-text) !important;
  border-radius: var(--shell-radius-md) !important;
  box-shadow: var(--shell-shadow-sm) !important;
}

/* Public nav/footer */
.nav,
.footer {
  background: var(--shell-topbar) !important;
  border-color: var(--shell-border) !important;
}

.brand,
.footer-brand,
h1,
h2,
h3,
.topbar-title {
  color: var(--shell-text) !important;
}

.footer-sub,
.auth-sub,
.lead,
.kpi-label,
.section-title-icon,
.chart-subtitle,
.sidebar-user-role,
.nav-section-label,
th,
.table-muted,
.theme-muted {
  color: var(--shell-muted) !important;
}

/* Links/nav */
a,
.nav-link,
.nav-item,
.topbar-tab,
.topbar-btn {
  color: var(--shell-text);
}

.nav-link,
.nav-item,
.topbar-tab,
.topbar-btn,
.sidebar-nav .nav-item,
.sidebar-footer .nav-item {
  border: 1px solid transparent !important;
  border-radius: var(--shell-radius-sm) !important;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-item:hover,
.topbar-tab:hover,
.topbar-btn:hover,
.sidebar-nav .nav-item:hover,
.sidebar-footer .nav-item:hover {
  background: var(--shell-accent-dim) !important;
  color: var(--shell-accent) !important;
  border-color: var(--shell-border-strong) !important;
  text-decoration: none !important;
}

.nav-item.active,
.topbar-tab.active,
.topbar-tab.is-active,
.sidebar-nav .nav-item.active,
.sidebar-footer .nav-item.active {
  background: var(--shell-accent-dim) !important;
  color: var(--shell-accent) !important;
  border-color: var(--shell-border-strong) !important;
}

/* Shell frame */
.sidebar {
  background: var(--shell-panel) !important;
  border-right: 1px solid var(--shell-border) !important;
}

.app-topbar {
  background: var(--shell-topbar) !important;
  border-bottom: 1px solid var(--shell-border) !important;
}

.app-main,
.app-content {
  background: transparent !important;
}

.sidebar-user,
.topbar-search,
.preview-notice {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid var(--shell-border) !important;
}

.sidebar-logo,
.sidebar-avatar {
  background: linear-gradient(135deg, #e6b93d 0%, #bb8d17 100%) !important;
  color: #101318 !important;
  box-shadow: 0 2px 10px rgba(230, 185, 61, 0.26) !important;
}

/* Buttons */
.button,
.btn,
button,
.theme-btn,
.topbar-btn.primary,
.btn-primary,
.btn--primary,
.btn--secondary,
.btn--accent {
  min-height: 34px;
  border-radius: var(--shell-radius-sm) !important;
  border: 1px solid var(--shell-border) !important;
  background: transparent;
  color: var(--shell-text) !important;
}

.button:hover,
.btn:hover,
button:hover,
.theme-btn:hover {
  background: var(--shell-hover-bg) !important;
  border-color: var(--shell-border-strong) !important;
}

.button-primary,
.btn-primary,
.topbar-btn.primary,
.theme-btn-primary,
.btn--primary,
.btn--secondary,
.btn--accent,
.button[type="submit"] {
  background: var(--shell-accent) !important;
  border-color: var(--shell-accent) !important;
  color: #101318 !important;
}

.button-primary:hover,
.btn-primary:hover,
.topbar-btn.primary:hover,
.theme-btn-primary:hover,
.btn--primary:hover,
.btn--secondary:hover,
.btn--accent:hover,
.button[type="submit"]:hover {
  background: var(--shell-accent-2) !important;
  border-color: var(--shell-accent-2) !important;
  color: #101318 !important;
}

.button-danger,
.btn-danger,
.btn--danger,
.nav-item-danger {
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
  color: #fecaca !important;
}

/* Inputs */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea,
.theme-input,
.theme-select,
.theme-textarea,
.topbar-search input {
  background: #161b24 !important;
  color: var(--shell-text) !important;
  border: 1px solid var(--shell-border) !important;
  border-radius: var(--shell-radius-sm) !important;
}

input:focus,
select:focus,
textarea:focus,
.topbar-search:focus-within {
  border-color: var(--shell-accent) !important;
  box-shadow: 0 0 0 2px rgba(230, 185, 61, 0.18) !important;
  outline: none !important;
}

input::placeholder,
textarea::placeholder {
  color: var(--shell-faint) !important;
}

/* Tables and badges */
table,
.theme-table {
  background: var(--shell-surface) !important;
  border: 1px solid var(--shell-border) !important;
}

th,
.theme-table th {
  background: var(--shell-panel) !important;
  border-bottom: 1px solid var(--shell-border) !important;
}

td,
.theme-table td {
  border-bottom: 1px solid var(--shell-border) !important;
  color: var(--shell-text) !important;
}

tbody tr:hover td {
  background: var(--shell-hover-bg) !important;
}

.nav-badge,
.badge,
.theme-badge.theme-badge-accent {
  background: var(--shell-accent-dim) !important;
  border: 1px solid var(--shell-border-strong) !important;
  color: var(--shell-accent) !important;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--shell-accent) var(--shell-bg);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--shell-bg);
}

*::-webkit-scrollbar-thumb {
  background: var(--shell-accent);
  border-radius: 999px;
  border: 2px solid var(--shell-bg);
}

@media (max-width: 980px) {
  .app-content {
    padding: 14px !important;
  }
}
