:root {
  --acacia-gold: #b8860b;
  --acacia-gold-light: #d4a83a;
  --bg: #fafaf7;
  --surface: #ffffff;
  --border: #e6e3dc;
  --text: #1f1f1d;
  --muted: #6b6b66;
  --danger: #b00020;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px; line-height: 1.5; }

header.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 12px 24px; display: flex; align-items: center; justify-content: space-between;
}
header.topbar .brand {
  font-family: Georgia, serif; font-size: 18px; font-weight: 700; color: var(--acacia-gold);
  letter-spacing: 0.5px;
}
header.topbar .user { color: var(--muted); font-size: 13px; }
header.topbar button.signout {
  background: none; border: 1px solid var(--border); padding: 6px 12px;
  border-radius: 4px; cursor: pointer; margin-left: 12px;
}

main.layout { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 56px); }

nav.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 0; }
nav.sidebar h3 { margin: 0 16px 8px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--muted); }
nav.sidebar a { display: block; padding: 8px 16px; color: var(--text); text-decoration: none;
  border-left: 3px solid transparent; }
nav.sidebar a:hover { background: #f4f2eb; }
nav.sidebar a.active { background: #f4f2eb; border-left-color: var(--acacia-gold); font-weight: 600; }

section.content { padding: 24px 32px; }
section.content h1 { font-family: Georgia, serif; font-size: 22px; margin: 0 0 4px; }
section.content .breadcrumb { color: var(--muted); margin-bottom: 16px; font-size: 12px; }

table.docs { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); }
table.docs th, table.docs td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
table.docs th { background: #f7f5ee; font-weight: 600; font-size: 12px; color: var(--muted); }
table.docs tr:hover { background: #fbf9f2; }
table.docs button { background: var(--acacia-gold); color: white; border: 0; padding: 6px 12px;
  border-radius: 4px; cursor: pointer; margin-right: 6px; font-size: 12px; }
table.docs button.secondary { background: transparent; color: var(--acacia-gold); border: 1px solid var(--acacia-gold); }
table.docs button:disabled { background: #cccac3; cursor: not-allowed; color: #888; border-color: transparent; }

.banner { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.banner.warn { background: #fff4d6; border: 1px solid #e6c64c; color: #5b4500; }

/* PDF viewer */
.viewer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000;
  display: flex; flex-direction: column; }
.viewer-overlay .topbar { background: #222; color: white; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; }
.viewer-overlay .topbar button { background: transparent; color: white; border: 1px solid #555;
  padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.viewer-overlay .pages { flex: 1; overflow: auto; padding: 20px; }
.viewer-overlay canvas { display: block; margin: 0 auto 20px; background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.viewer-watermark {
  position: absolute; pointer-events: none; color: rgba(180,30,30,0.18);
  font-size: 14px; transform: rotate(-30deg); user-select: none;
}

/* Login */
.login-shell { display: flex; min-height: 100vh; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f7f3e8 0%, #ece2c4 100%); }
.login-card { background: white; border: 1px solid var(--border); padding: 32px;
  border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.08); width: 380px; }
.login-card h1 { font-family: Georgia, serif; color: var(--acacia-gold); margin-top: 0; }
