/* SalesWRK shared base styles. Each app overrides --brand in its own css. */
:root {
  --brand: #2563eb;
  --brand-dark: #1e40af;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --radius: 8px;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 .5rem; font-weight: 600; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; }

/* ---- Forms ---- */
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }

input, select, textarea {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  background: var(--surface);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}

.field { margin-bottom: 1rem; }

.btn {
  display: inline-block;
  padding: .6rem 1.1rem;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.secondary { background: transparent; color: var(--brand); }
.btn.secondary:hover { background: var(--bg); }
.btn.block { width: 100%; }

.error { color: var(--danger); font-size: .85rem; min-height: 1.2em; }

/* ---- Auth layout (login pages) ---- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}
.auth-card .logo { font-weight: 700; font-size: 1.25rem; color: var(--brand); margin-bottom: 1.5rem; }

/* ---- App shell (dashboard pages) ---- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
}
.sidebar .logo { font-weight: 700; color: var(--brand); padding: 0 .5rem 1.25rem; }
.sidebar nav a {
  display: block;
  padding: .55rem .75rem;
  border-radius: var(--radius);
  color: var(--text);
}
.sidebar nav a:hover { background: var(--bg); text-decoration: none; }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.sidebar .spacer { flex: 1; }

.main { flex: 1; padding: 1.5rem 2rem; min-width: 0; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.topbar .user { color: var(--muted); font-size: .9rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.75rem; font-weight: 600; margin-top: .25rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: .85rem; }

@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--border); }
  .main { padding: 1rem; }
}
