:root {
    --bg: #f4f5f7;
    --sidebar-bg: #1f2937;
    --sidebar-fg: #e5e7eb;
    --accent: #7a1f2e;
    --accent-hover: #631827;
    --brand-light: #f7e9ea;
    --brand-text: #5c1620;
    --danger: #dc2626;
    --success: #16a34a;
    --border: #d1d5db;
    --text: #111827;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.sidebar-brand { font-weight: 700; font-size: 1.25rem; margin-bottom: 1.5rem; }

.sidebar nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }

.sidebar nav a {
    color: var(--sidebar-fg);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.sidebar nav a:hover { background: rgba(255, 255, 255, 0.1); }

.logout-form button {
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    color: var(--sidebar-fg);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
}

.content { flex: 1; padding: 2rem; max-width: 960px; }

h1 { margin-top: 0; }

.table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.table th, .table td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; }

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}
.btn:hover { background: var(--accent-hover); }

.link-danger {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-size: inherit;
}

form label { display: block; margin-bottom: 0.75rem; font-weight: 500; }
form input[type="text"],
form input[type="email"],
form input[type="password"],
form textarea {
    display: block;
    width: 100%;
    max-width: 420px;
    margin-top: 0.25rem;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}
form textarea { max-width: 640px; }
form fieldset { border: 1px solid var(--border); border-radius: 6px; margin-bottom: 1rem; padding: 0.75rem 1rem; }
form .checkbox-line { font-weight: 400; display: flex; align-items: center; gap: 0.5rem; }
form .checkbox-line input { width: auto; }

.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

.muted { color: #6b7280; font-size: 0.9rem; }

.backup-actions { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }

.install-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.install-box { background: #fff; padding: 2rem; border-radius: 10px; max-width: 520px; width: 100%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.install-box fieldset { margin-bottom: 1rem; }

.code-view { width: 100%; font-family: monospace; font-size: 0.85rem; }

.public-topbar {
    background: var(--accent);
    color: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.public-brand { font-weight: 500; font-size: 1.1rem; }
.public-content { max-width: 960px; margin: 0 auto; padding: 2rem; }

.btn-inverse { background: #fff; color: var(--accent); }
.btn-inverse:hover { background: var(--brand-light); }

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 1.5rem;
}
.tile {
    display: block;
    background: var(--brand-light);
    color: var(--brand-text);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    font-weight: 500;
}
.tile:hover { opacity: 0.85; }
