@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #1c2521;
  --paper: #faf8f3;
  --panel: #ffffff;
  --line: #e4ddce;
  --moss: #35604a;
  --moss-deep: #24402f;
  --clay: #b5603f;
  --amber: #c98a2b;
  --muted: #6f7a70;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28, 37, 33, 0.06), 0 6px 20px rgba(28, 37, 33, 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
}

h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; margin: 0 0 0.5em; letter-spacing: -0.01em; }

a { color: var(--moss-deep); text-decoration: none; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--moss-deep);
  color: #eef1ec;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--amber); color: #2a1c0a;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-weight: 600;
}
.brand-name { font-family: 'Fraunces', serif; font-size: 18px; letter-spacing: 0.01em; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  color: #cfd8cf;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav a.active { background: var(--amber); color: #2a1c0a; }

.logout { margin-top: 12px; }
.logout button {
  width: 100%; padding: 9px 12px; border-radius: 8px;
  background: transparent; border: 1px solid rgba(255,255,255,0.16);
  color: #cfd8cf; cursor: pointer; font-size: 13px;
}
.logout button:hover { background: rgba(255,255,255,0.08); }

.content { flex: 1; padding: 36px 44px; max-width: 1180px; }
.content-header { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; }
.content-header h1 { font-size: 26px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.stat-card .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.stat-card .value { font-family: 'Fraunces', serif; font-size: 28px; color: var(--moss-deep); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f6f3ea; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.badge-active, .badge-paid, .badge-occupied, .badge-resolved { background: #e3ede4; color: var(--moss-deep); }
.badge-vacant, .badge-open, .badge-pending { background: #fbe9d9; color: #8a5518; }
.badge-overdue, .badge-ended, .badge-urgent { background: #f6e0da; color: #8f3a22; }

.btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px; border: none;
  background: var(--moss); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer;
}
.btn:hover { background: var(--moss-deep); }
.btn-secondary { background: transparent; color: var(--moss-deep); border: 1px solid var(--line); }
.btn-secondary:hover { background: #f1ede2; }
.btn-danger { background: transparent; color: var(--clay); border: 1px solid var(--line); }
.btn-danger:hover { background: #f6e0da; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

form.stacked { display: flex; flex-direction: column; gap: 14px; max-width: 480px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--moss); outline-offset: 1px; }
.form-row { display: flex; gap: 14px; }
.form-row .field { flex: 1; }

.empty-state { color: var(--muted); padding: 32px; text-align: center; font-size: 14px; }

.login-shell { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--paper); }
.login-card { width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 32px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-error { background: #f6e0da; color: #8f3a22; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.login-hint { margin-top: 16px; font-size: 12px; color: var(--muted); }

.actions-cell { display: flex; gap: 8px; }
.actions-cell form { display: inline; }
