@import './styles/tokens.css';

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body, 'Jost', sans-serif); background: var(--linen, #f9f7f4); color: var(--ink, #1a1a1a); }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.card { background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); width: 100%; max-width: 360px; }
.wordmark { font-family: var(--font-display, 'Fraunces', serif); font-size: 2rem; font-weight: 600; color: var(--walnut, #4a3f35); margin-bottom: 0.25rem; }
.sub, .tag { font-size: 0.875rem; color: var(--walnut, #4a3f35); opacity: 0.7; margin-bottom: 1.5rem; }
label { display: block; margin-top: 1rem; margin-bottom: 0.25rem; font-size: 0.875rem; color: var(--ink, #1a1a1a); }
input { width: 100%; padding: 0.5rem; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; }
button { margin-top: 1rem; width: 100%; padding: 0.75rem; background: var(--brass, #b8935e); color: white; border: none; border-radius: 4px; font-size: 1rem; cursor: pointer; }
button:hover { opacity: 0.9; }
.err { margin-top: 1rem; color: #c00; font-size: 0.875rem; }

.shell { display: flex; height: 100vh; }
.rail { width: 220px; background: var(--walnut, #4a3f35); color: white; padding: 1.5rem 1rem; flex-shrink: 0; }
.rail .wordmark { font-size: 1.5rem; }
.rail .tag { margin-bottom: 2rem; }
nav { display: flex; flex-direction: column; gap: 0.5rem; }
nav a { padding: 0.5rem 0.75rem; border-radius: 4px; cursor: pointer; transition: background 0.2s; }
nav a:hover { background: rgba(255,255,255,0.1); }
nav a.active { background: var(--brass, #b8935e); font-weight: 500; }
.main { flex: 1; display: flex; flex-direction: column; overflow: auto; }
.topbar { background: white; padding: 1.5rem 2rem; border-bottom: 1px solid #e0e0e0; display: flex; justify-content: space-between; align-items: center; }
.topbar h1 { font-family: var(--font-display, 'Fraunces', serif); font-size: 1.75rem; margin-bottom: 0.25rem; color: var(--ink, #1a1a1a); }
.who { font-size: 0.875rem; color: var(--walnut, #4a3f35); opacity: 0.7; }
.logout { width: auto; padding: 0.5rem 1rem; margin: 0; }
.cards { padding: 2rem; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.metric { background: white; padding: 1.5rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); min-width: 200px; }
.metric .accent { width: 40px; height: 4px; background: var(--brass, #b8935e); border-radius: 2px; margin-bottom: 1rem; }
.metric .n { font-size: 2.5rem; font-weight: 600; color: var(--ink, #1a1a1a); }
.metric .l { font-size: 0.875rem; color: var(--walnut, #4a3f35); opacity: 0.7; margin-top: 0.25rem; }

.pipeline { display: flex; gap: 1rem; padding: 2rem; overflow-x: auto; height: 100%; }
.pipeline-col { flex: 1; min-width: 260px; background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); display: flex; flex-direction: column; max-height: calc(100vh - 8rem); }
.pipeline-head { padding: 1rem 1.25rem; border-bottom: 1px solid #e0e0e0; font-weight: 600; color: var(--ink, #1a1a1a); display: flex; justify-content: space-between; align-items: center; }
.pipeline-head .count { background: var(--brass, #b8935e); color: white; padding: 0.125rem 0.5rem; border-radius: 12px; font-size: 0.75rem; }
.pipeline-cards { padding: 0.75rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }
.pipeline-card { background: var(--linen, #f9f7f4); padding: 1rem; border-radius: 6px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; border-left: 3px solid var(--brass, #b8935e); }
.pipeline-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.lead-num { font-weight: 600; color: var(--ink, #1a1a1a); margin-bottom: 0.25rem; }
.lead-cust { font-size: 0.875rem; color: var(--walnut, #4a3f35); margin-bottom: 0.25rem; }
.lead-type { font-size: 0.75rem; color: var(--walnut, #4a3f35); opacity: 0.7; }

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-card { background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.2); max-width: 500px; width: 90%; }
.modal-card h2 { font-family: var(--font-display, 'Fraunces', serif); margin-bottom: 1.5rem; color: var(--ink, #1a1a1a); }
.lead-detail { margin-bottom: 0.75rem; font-size: 0.9375rem; color: var(--ink, #1a1a1a); }
.lead-detail strong { color: var(--walnut, #4a3f35); margin-right: 0.5rem; }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.modal-actions button { margin: 0; width: auto; flex: 1; min-width: 100px; }
.btn-primary { background: var(--brass, #b8935e); }
.btn-secondary { background: var(--walnut, #4a3f35); }
.btn-close { background: #999; }

/* — Tables & inline forms (CRM pages) — */
.panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:20px 22px; margin-bottom:22px; box-shadow:var(--shadow-sm); }
.panel-h { font-family:var(--font-display); font-size:17px; margin-bottom:14px; color:var(--forma-ink); }
.form-row { display:flex; gap:10px; margin-bottom:10px; }
.form-row input { flex:1; width:auto; margin:0; }
.inline-btn { width:auto; margin:0; padding:12px 22px; white-space:nowrap; }
.table-wrap { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-sm); }
table { width:100%; border-collapse:collapse; }
thead th { text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:0.08em; color:var(--muted); padding:13px 16px; border-bottom:1px solid var(--line); background:var(--forma-linen); font-weight:600; }
tbody td { padding:13px 16px; font-size:13.5px; border-bottom:1px solid var(--line); color:var(--text); }
tbody tr:last-child td { border-bottom:none; }
tbody tr:hover { background:rgba(160,125,75,0.05); }
.pill { font-size:11px; padding:3px 11px; border-radius:20px; background:var(--forma-sand); color:var(--forma-walnut); text-transform:capitalize; }
