@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap");

:root {
  --rs-ink: #18181b;        /* zinc-900 — primary text / dark surfaces */
  --rs-ink-soft: #27272a;   /* zinc-800 — hover on dark */
  --rs-muted: #52525b;      /* zinc-600 — secondary text */
  --rs-faint: #a1a1aa;      /* zinc-400 — tertiary text */
  --rs-line: #e4e4e7;       /* zinc-200 — borders */
  --rs-surface: #ffffff;
  --rs-bg: #f4f4f5;         /* zinc-100 — page background */
  --rs-accent: #dc2626;     /* red-600 — brand accent */
  --rs-accent-dark: #b91c1c;/* red-700 */
  --rs-radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--rs-ink);
  background: var(--rs-bg);
}

h1, h2 { font-weight: 700; letter-spacing: -0.01em; }

/* ── Login / logout-success ── */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1.5rem;
  padding: 1.5rem;
}

.login-container .logo {
  width: 260px;
  max-width: 80vw;
  height: auto;
}

.login-container h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--rs-muted);
}

/* ── Layout ── */
header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem 1.5rem;
  background: var(--rs-surface);
  border-bottom: 1px solid var(--rs-line);
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand .logo {
  height: 30px;
  width: auto;
  display: block;
}

header h1 {
  margin: 0;
  padding-left: 1.25rem;
  border-left: 1px solid var(--rs-line);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--rs-muted);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
}

.header-nav a {
  color: var(--rs-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.header-nav a:hover {
  color: var(--rs-accent);
}

main {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* ── Toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.toolbar h2 {
  margin: 0;
  flex: 1;
  font-size: 1.4rem;
}

/* ── Messages ── */
.success {
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--rs-radius);
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}

/* ── Project list ── */
.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--rs-surface);
  border: 1px solid var(--rs-line);
  border-radius: var(--rs-radius);
  padding: 0.75rem 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.project-card:hover {
  border-color: var(--rs-faint);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.project-card strong {
  flex: 1;
  font-weight: 600;
}

.project-card form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Table ── */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--rs-surface);
  border: 1px solid var(--rs-line);
  border-radius: var(--rs-radius);
  overflow: hidden;
}

th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  background: var(--rs-bg);
  border-bottom: 1px solid var(--rs-line);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rs-muted);
}

td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--rs-line);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

.text-input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--rs-line);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  color: var(--rs-ink);
}

.text-input:focus {
  outline: none;
  border-color: var(--rs-accent);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.bexio-text {
  margin-top: 0.2rem;
  padding: 0 0.5rem;
  font-size: 12px;
  color: var(--rs-faint);
}

.actions {
  white-space: nowrap;
}

.print {
  text-align: center;
}

.deleted-row {
  background: var(--rs-bg);
}

.deleted-row .text-input {
  color: var(--rs-faint);
  background: var(--rs-bg);
  text-decoration: line-through;
}

.deleted-row td {
  color: var(--rs-faint);
}

/* ── Toggle switch ── */
.toggle {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle .slider {
  position: absolute;
  inset: 0;
  background: #d4d4d8;
  border-radius: 10px;
  transition: background 0.15s;
}

.toggle .slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
}

.toggle input:checked + .slider {
  background: var(--rs-accent);
}

.toggle input:checked + .slider::before {
  transform: translateX(14px);
}

/* ── Buttons ── */
button, .btn-primary {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--rs-line);
  border-radius: 4px;
  background: var(--rs-surface);
  color: var(--rs-ink);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

button:hover, .btn-primary:hover {
  background: var(--rs-bg);
  border-color: var(--rs-faint);
}

.btn-primary {
  background: var(--rs-ink);
  border-color: var(--rs-ink);
  color: #fff;
}

.btn-primary:hover {
  background: var(--rs-ink-soft);
  border-color: var(--rs-ink-soft);
  color: #fff;
}

.btn-danger {
  border-color: var(--rs-accent);
  color: var(--rs-accent);
}

.btn-danger:hover {
  background: #fef2f2;
  border-color: var(--rs-accent-dark);
  color: var(--rs-accent-dark);
}

input[type="date"] {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--rs-line);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  color: var(--rs-ink);
}
