:root {
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --text: #1f2430;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --danger: #dc2626;
    --success: #16a34a;
}

* { box-sizing: border-box; }

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

.topbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand { font-weight: 700; color: var(--text); text-decoration: none; }

.topbar nav a {
    margin-left: 18px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
}

.topbar nav a:hover { color: var(--primary); }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

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

h1 { font-size: 24px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 14px; }

.muted { color: var(--muted); font-size: 14px; }

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th, .table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
}

.table th { color: var(--muted); font-weight: 600; }

.truncate {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actions form { display: inline-block; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    text-decoration: underline;
}

.link-btn-danger { color: var(--danger); }

.inline { display: inline; }

.inline-form {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: var(--muted);
    gap: 4px;
}

input, select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }

.badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.badge-warn { background: #fef3c7; color: #92400e; }

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-flat { color: var(--muted); }

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 32px;
    width: 100%;
    max-width: 360px;
}

.auth-box form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.auth-box label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}
