/* Crossroads Design System - centralized styles */
:root { --bg:#f6f7f9; --surface:#ffffff; --text:#111; --muted:#6b7280; --brand:#111827; --link:#2563eb; --radius:8px; --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:24px; --shadow-sm:0 2px 8px rgba(0,0,0,.08); --shadow-md:0 8px 24px rgba(0,0,0,.08); }
html, body { height: 100%; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; margin: 0; background: var(--bg); color: var(--text); }

/* Layout */
header.sticky { position: sticky; top: 0; z-index: 1000; background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.wrap { margin: 0 auto; padding: 12px 50px 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.layout { display: grid; grid-template-columns: 1fr; gap: 16px; min-height: calc(100dvh - var(--header-h, 64px) - var(--footer-h, 0px)); align-items: stretch; }
@media (min-width: 960px) { .layout.has-sidebar { grid-template-columns: 240px 1fr; } }
.sidebar-container { height: 100%; }
.container { max-width: 1000px; margin: 24px auto; }

/* Surfaces */
.card { background: var(--surface); padding: 24px; border-radius: 12px; box-shadow: var(--shadow-md); }
.row-cards { background: transparent; }
.row-cards-inner { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 0; }
@media (min-width: 960px) {
  .row-cards-inner { grid-template-columns: 1fr 1fr; }
}
.toolbar { display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 8px 16px; }
.toolbar-right { justify-content: flex-end; }
.actions { display: flex; gap: 8px; }
/* moved polytable-specific styles to /public/css/PolyTable.css */

/* Navigation */
.sidebar { list-style: none; margin: 0; padding: 8px; background: var(--surface); border-radius: 0; box-shadow: var(--shadow-md); height: 100%; overflow: auto; }
.sidebar a { display: block; color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 6px; }
.sidebar a:hover, .sidebar a:focus { background: #f1f5f9; }
.menubar { display: flex; gap: 12px; list-style: none; margin: 0; padding: 0; }
.menubar > li { position: relative; }
.menubar a, .menubar button { color: #fff; text-decoration: none; padding: 8px 10px; border-radius: 6px; border: 0; background: transparent; cursor: pointer; }
.menubar > li:hover > a, .menubar > li:focus-within > a { background: rgba(255,255,255,0.08); }
.submenu { position: absolute; left: 0; top: calc(100% + px); background: #111827; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; min-width: 180px; padding: 6px; list-style: none; margin: 0; display: none; }
.menubar > li:hover > .submenu, .menubar > li:focus-within > .submenu { display: block; }
.submenu li a { display: block; color: #fff; padding: 8px 10px; border-radius: 6px; }
.submenu li a:hover, .submenu li a:focus { background: rgba(255,255,255,0.08); }
.sidebar-nav { height: 100%; overflow: auto; }
.footer { background: var(--brand); color: #fff; padding: 8px 20px; }

/* Header menu container and account dropdown */
.menu-wrap { display: inline-flex; align-items: center; gap: 20px; }
.account-menu { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.account-avatar { width: 32px; height: 32px; border-radius: 999px; background: #000; color: #fff; border: 1px solid; border-color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.account-dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: #111827; color: #fff; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; min-width: 220px; padding: 10px; display: none; box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.account-menu.open .account-dropdown { display: block; }
.account-name { font-weight: 700; margin-bottom: 4px; }
.account-email { font-size: 12px; opacity: .9; margin-bottom: 6px; }
.account-meta { font-size: 12px; color: #cbd5e1; margin-bottom: 8px; }
.account-actions { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 8px; }
.account-link { color: #fff; text-decoration: none; font-size: 13px; }
.account-link:hover, .account-link:focus { text-decoration: underline; }


/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; border-radius: 8px; border: 1px solid transparent; background: var(--brand); color: #fff; text-decoration: none; cursor: pointer; -webkit-appearance: none; appearance: none; font: inherit; line-height: 1.2; }
.btn:hover, .btn:focus { opacity: .95; }
.btn.secondary { background: #eef2ff; color: #111; border-color: #e5e7eb; }
.btn.ghost { background: transparent; color: var(--brand); border-color: transparent; }

.input, input[type="text"], input[type="password"], input:not([type]), select, textarea { width: 100%; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; color: var(--text); }
.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: #c7d2fe; box-shadow: 0 0 0 3px rgba(99,102,241,.2); }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px; }
.table thead th { font-weight: 600; color: var(--muted); border-bottom: 1px solid #e5e7eb; }
.table tbody tr { background: #fff; border-bottom: 1px solid #f3f4f6; }
.table tbody tr:hover { background: #f9fafb; }

/* Utilities */
.text-muted { color: var(--muted); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }


/* Auth (Login) */
.auth-wrap { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-md); padding: 28px; }
.auth-title { margin: 0 0 12px; font-size: 22px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 14px; color: var(--muted); }
.auth-muted { margin-top: 8px; font-size: 12px; color: var(--muted); }
.auth-footer { margin-top: 16px; font-size: 12px; }

/* Gradient Button */
.btn-gradient { background: linear-gradient(180deg, #6b7280 0%, #111827 100%); border: 0; color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.2); padding: 10px 14px; border-radius: 10px; }
.btn-gradient:hover, .btn-gradient:focus { filter: brightness(1.03); box-shadow: 0 8px 20px rgba(0,0,0,.28); }
