/* Console — minimalistic dark theme inspired by gpc-agent */

:root {
    --bg: #0f1115;
    --surface: #1a1d23;
    --surface2: #232730;
    --border: #2d323c;
    --border-hover: #3f4552;
    --text: #e8eaed;
    --text2: #a9afba;
    --text3: #6b7280;
    --accent: #6ea8ff;
    --accent-dim: rgba(110, 168, 255, 0.15);
    --green: #34d399;
    --red: #f87171;
    --yellow: #fbbf24;
    --radius: 10px;
    --radius-sm: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 24px; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: 18px; margin: 24px 0 12px; font-weight: 600; }

/* ── Layout ── */
.page { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.brand a { color: var(--text); font-weight: 600; font-size: 16px; }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar .user { color: var(--text2); font-size: 13px; }
.topbar .logout { color: var(--text2); font-size: 13px; }

.content { max-width: 1100px; margin: 0 auto; padding: 32px 24px; width: 100%; flex: 1; }
.subtitle { color: var(--text2); margin: 0 0 24px; }

/* ── Flash messages ── */
.flashes { max-width: 1100px; margin: 16px auto 0; padding: 0 24px; }
.flash { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 13px; }
.flash-success { background: rgba(52, 211, 153, 0.12); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.3); }
.flash-error   { background: rgba(248, 113, 113, 0.12); color: var(--red);   border: 1px solid rgba(248, 113, 113, 0.3); }

/* ── Login ── */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
}
.login-card h1 { font-size: 22px; }
.login-card .subtitle { margin-bottom: 32px; }
.btn-google {
    display: inline-flex; align-items: center; gap: 10px;
    background: white; color: #3c4043;
    padding: 12px 24px; border-radius: 6px;
    font-weight: 500; font-size: 14px;
    text-decoration: none;
    border: 1px solid #dadce0;
    transition: background 0.15s;
}
.btn-google:hover { background: #f8f9fa; text-decoration: none; }
.g-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 25%, #fbbc04 50%, #ea4335 100%);
    color: white; border-radius: 50%; font-weight: 700; font-size: 12px;
}
.error-box {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--red);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
}
.hint { margin-top: 24px; font-size: 12px; color: var(--text3); }

/* ── Home tiles ── */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.15s;
    color: var(--text);
}
.tile:hover {
    border-color: var(--accent);
    background: var(--surface2);
    text-decoration: none;
    transform: translateY(-2px);
}
.tile-icon { font-size: 28px; margin-bottom: 12px; }
.tile-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.tile-desc { color: var(--text2); font-size: 13px; }
.tile-admin { border-color: var(--accent); }

/* ── Admin ── */
.admin-nav {
    display: flex; gap: 4px; flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 24px;
}
.admin-nav a {
    padding: 8px 14px; border-radius: 4px; font-size: 13px;
    color: var(--text2);
}
.admin-nav a:hover { background: var(--surface2); text-decoration: none; color: var(--text); }
.admin-nav a.active { background: var(--accent-dim); color: var(--accent); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin: 24px 0;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}
.stat-num { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-label { color: var(--text2); font-size: 12px; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Tables ── */
.data-table {
    width: 100%; border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 16px 0;
}
.data-table th, .data-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-table th { background: var(--surface2); color: var(--text2); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }
.row-inactive { opacity: 0.5; }

.event-login    { color: var(--green); }
.event-logout   { color: var(--text2); }
.event-denied   { color: var(--red); }
.event-user_created    { color: var(--yellow); }
.event-role_changed    { color: var(--accent); }
.event-user_deleted    { color: var(--red); }

/* ── Forms ── */
.form-inline { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.form-inline input[type="text"], .form-inline input[type="email"] {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    flex: 1;
    min-width: 200px;
}
.form-inline button, button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
button:hover { opacity: 0.9; }

.inline { display: inline; margin: 0; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: var(--red); }

select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.pagination { margin-top: 20px; display: flex; gap: 16px; justify-content: center; }

/* ── Error page ── */
.error-page { text-align: center; padding: 60px 20px; }
.error-page h1 { font-size: 32px; color: var(--red); }
.btn { display: inline-block; padding: 8px 16px; background: var(--accent); color: white; border-radius: var(--radius-sm); margin-top: 20px; }
