/* LOTSE Logbuch — nautisches Navy/Messing-Farbschema */

:root {
  --navy-900: #0b1f33;
  --navy-800: #12283f;
  --navy-700: #1c3a56;
  --navy-600: #2a4d6e;
  --brass: #b8863c;
  --brass-light: #d9ac6b;
  --cream: #f7f3ea;
  --paper: #fffdf8;
  --ink: #1b2733;
  --muted: #62748a;
  --line: #e4ddcc;
  --ok: #2f7a63;
  --ok-bg: #e7f2ee;
  --warn: #b3502b;
  --warn-bg: #fbeee6;
  --danger: #a8333a;
  --radius: 10px;
  --font-display: 'Spectral', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.5;
}

a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--brass); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0 0 .4em; color: var(--navy-900); text-wrap: balance; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Layout */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--navy-900);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 22px; border-bottom: 1px solid rgba(217,172,107,.25); margin-bottom: 18px; }
.brand-mark { width: 30px; height: 30px; color: var(--brass-light); flex-shrink: 0; }
.brand-name { font-family: var(--font-display); font-weight: 700; letter-spacing: .06em; font-size: 1.05rem; color: var(--paper); }
.brand-sub { font-size: .72rem; color: var(--brass-light); letter-spacing: .08em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { color: rgba(247,243,234,.72); padding: 9px 10px; border-radius: 7px; font-size: .93rem; font-weight: 500; }
.nav a:hover { color: var(--paper); background: rgba(255,255,255,.06); }
.nav a.active { color: var(--navy-900); background: var(--brass-light); }

.sidebar-foot { border-top: 1px solid rgba(217,172,107,.2); padding-top: 14px; margin-top: 14px; }
.sidebar-foot a { color: rgba(247,243,234,.55); font-size: .85rem; }

.content { flex: 1; padding: 32px 40px; max-width: 1180px; }

/* Flash messages */
.flashes { margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 10px 14px; border-radius: var(--radius); font-size: .9rem; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--warn-bg); color: var(--warn); }

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card + .card { margin-top: 18px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 1.3fr .9fr; }

@media (max-width: 980px) {
  .sidebar { display: none; }
  .content { padding: 20px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; }
}

/* Stat tiles */
.stat {
  background: var(--navy-900);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat.brass { background: linear-gradient(135deg, var(--brass), #9c6f2c); }
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; opacity: .75; margin-bottom: 6px; }
.stat-value { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .78rem; opacity: .7; margin-top: 4px; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: .9rem; }
th { color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* Forms */
label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
input, select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: .92rem;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brass-light); outline-offset: 1px; border-color: var(--brass); }
textarea { resize: vertical; min-height: 60px; }
.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }

button, .btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .88rem;
  border: none;
  border-radius: 7px;
  padding: 9px 16px;
  cursor: pointer;
  background: var(--navy-900);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button:hover, .btn:hover { background: var(--navy-700); color: var(--paper); }
.btn-brass { background: var(--brass); }
.btn-brass:hover { background: #9c6f2c; }
.btn-ghost { background: transparent; color: var(--navy-800); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--cream); color: var(--navy-900); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid #e6c9c9; }
.btn-danger:hover { background: var(--warn-bg); }
.btn-sm { padding: 5px 10px; font-size: .78rem; }
form.inline { display: inline; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 600; letter-spacing: .02em; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-muted { background: #eef0f2; color: var(--muted); }
.badge-brass { background: #f3e5cc; color: #8a611f; }

.topbar { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 22px; flex-wrap: wrap; gap: 10px; }
.topbar p { color: var(--muted); margin: 0; }

.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.two-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.list-plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.list-plain li { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border: none; padding-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

.timer-banner {
  background: var(--navy-900);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.timer-banner .running { display: flex; align-items: center; gap: 10px; }
.timer-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brass-light); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.timer-clock { font-family: var(--font-mono); font-size: 1.1rem; }

/* Login page */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--navy-900); margin: 0; font-family: var(--font-body); }
.login-card { background: var(--paper); padding: 40px 36px; border-radius: 14px; width: 320px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-mark { width: 40px; height: 40px; color: var(--brass); margin-bottom: 10px; }
.login-card h1 { font-size: 1.3rem; margin-bottom: 2px; }
.login-sub { color: var(--muted); margin: 0 0 20px; font-size: .85rem; }
.login-card input { margin-bottom: 14px; }
.login-card button { width: 100%; justify-content: center; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
