/* ITFIRE Zeiterfassung */
:root {
    --bg: #0f1115;
    --surface: #181b22;
    --surface-2: #21252e;
    --border: #2c313c;
    --text: #e7e9ee;
    --muted: #9aa1ad;
    --accent: #ff5722;
    --accent-soft: rgba(255, 87, 34, 0.12);
    --green: #34d399;
    --red: #f87171;
    --radius: 10px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: "SF Mono", "JetBrains Mono", Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.error { color: var(--red); background: rgba(248,113,113,.1); padding: 10px 14px; border-radius: var(--radius); margin: 10px 0; }
.success { color: var(--green); background: rgba(52,211,153,.1); padding: 10px 14px; border-radius: var(--radius); margin: 10px 0; }

/* Auth */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 36px; width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 22px; margin-bottom: 8px; }
.auth-card label { display: block; margin: 16px 0 6px; font-size: 13px; color: var(--muted); }

/* Layout */
.topbar {
    display: flex; align-items: center; gap: 24px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0 24px; height: 60px; position: sticky; top: 0; z-index: 50;
}
.brand { font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--muted); padding: 8px 14px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.userbox { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.userbox a:not(.btn):hover { color: var(--accent) !important; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.page-title { font-size: 20px; margin-bottom: 20px; font-weight: 600; }

/* Timer bar */
.timer-bar {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 14px; display: flex; gap: 12px; align-items: center; margin-bottom: 24px; flex-wrap: wrap;
}
.timer-bar input.desc { flex: 1; min-width: 200px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 12px 14px; border-radius: 8px; font-size: 15px; }
.timer-display { font-family: var(--mono); font-size: 22px; font-weight: 600; min-width: 110px; text-align: center; letter-spacing: 1px; }
.timer-display.running { color: var(--green); }

/* Inputs */
input, select, textarea {
    font-family: var(--font); font-size: 14px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); padding: 9px 11px; border-radius: 8px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
select { cursor: pointer; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
    padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--border); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #e64a19; }
.btn-green { background: var(--green); border-color: var(--green); color: #06281d; }
.btn-green:hover { filter: brightness(1.08); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: rgba(248,113,113,.15); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-icon { padding: 7px 9px; }

/* Tables */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 20px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-head h2 { font-size: 16px; font-weight: 600; }
.project-head { cursor: pointer; user-select: none; transition: background .12s; border-bottom: none; }
.project-head:hover { background: var(--surface-2); }
.project-body { border-top: 1px solid var(--border); }
.chevron { display: inline-block; width: 14px; color: var(--muted); font-size: 12px; margin-right: 4px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding: 12px 20px; border-bottom: 1px solid var(--border); }
td { padding: 12px 20px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
.num { font-family: var(--mono); text-align: right; }

/* Tagesgruppierung in der Timer-Übersicht */
tr.day-header th { background: var(--surface-2); text-transform: none; font-size: 13px; color: var(--text); letter-spacing: 0; border-top: 1px solid var(--border); }
tr.day-header th.num { font-family: var(--mono); font-weight: 700; color: var(--accent); }
/* Größerer Abstand vor jedem Tag außer dem ersten */
#entryList thead:not(:first-child) tr.day-header th { padding-top: 28px; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--surface-2); color: var(--muted); }
.tag.bill { background: rgba(52,211,153,.15); color: var(--green); }

.toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar .field { display: flex; flex-direction: column; gap: 4px; }
.toolbar .field label { font-size: 12px; color: var(--muted); }
.toolbar .field input, .toolbar .field select { width: auto; min-width: 150px; }

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

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 6px; font-family: var(--mono); }
.stat .value.accent { color: var(--accent); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-bottom: 18px; }
.modal label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 5px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.checkbox-row input { width: auto; }

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

@media (max-width: 640px) {
    .nav a span { display: none; }
    .container { padding: 16px; }
    .topbar { gap: 12px; padding: 0 14px; }
    th:nth-child(3), td:nth-child(3) { display: none; }
}
