@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: Arial, sans-serif; background: #0d0d0d; color: white; }
.muted { color: #888; font-size: 13px; }
.empty-msg { padding: 40px; text-align: center; color: #555; }

/* ── Login ─────────────────────────────────────────────────────────── */
.login-bg {
    background:
        radial-gradient(ellipse at top, rgba(34,197,94,0.15), transparent 60%),
        radial-gradient(ellipse at bottom, rgba(96,165,250,0.10), transparent 60%),
        #0a0a0a;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.login-card {
    background: #111;
    border: 1px solid #1f1f1f;
    border-radius: 16px;
    padding: 40px 32px;
    width: 100%; max-width: 380px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.brand-mark {
    width: 64px; height: 64px; margin: 0 auto 18px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: #000; font-weight: 800; font-family: 'Bebas Neue', Arial; font-size: 40px;
}
.brand-mark.sm { width: 32px; height: 32px; font-size: 22px; border-radius: 8px; margin: 0; }
.login-card h1 { font-family: 'Bebas Neue', Arial; font-size: 32px; margin: 0 0 4px; letter-spacing: 0.02em; }
.login-card .muted { margin: 0 0 28px; }
.btn-google {
    width: 100%;
    background: #fff; color: #1f1f1f;
    border: none; border-radius: 10px;
    padding: 12px;
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform .1s, box-shadow .15s;
}
.btn-google:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(34,197,94,0.25); }
.btn-google:disabled { opacity: .6; cursor: not-allowed; }
.g-glyph { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(#4285F4 0 25%,#34A853 0 50%,#FBBC05 0 75%,#EA4335 0); color: transparent; }
.login-err { color: #ef4444; font-size: 13px; margin-top: 14px; min-height: 16px; }

/* ── Hub shell ─────────────────────────────────────────────────────── */
.hub-bg { background: #0d0d0d; min-height: 100vh; }
.hub-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px;
    background: #111; border-bottom: 1px solid #1f1f1f;
    position: sticky; top: 0; z-index: 50;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: 'Bebas Neue', Arial; font-size: 18px; letter-spacing: .06em; color: #ccc; }
.hub-actions { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #888; }
.hub-main { max-width: 1100px; margin: 0 auto; padding: 30px 24px 60px; }
.hub-main h1 { font-family: 'Bebas Neue', Arial; font-size: 36px; letter-spacing: 0.02em; margin: 0 0 4px; }

/* ── App grid ──────────────────────────────────────────────────────── */
.apps-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px; margin-top: 22px;
}
.app-card {
    background: #1a1a1a; border: 1px solid #222;
    border-radius: 14px; padding: 22px;
    text-decoration: none; color: inherit;
    display: flex; flex-direction: column; gap: 6px;
    transition: transform .12s, border-color .15s, background .15s;
}
.app-card:hover { transform: translateY(-3px); border-color: #22c55e; background: #1e1e1e; }
.app-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, rgba(34,197,94,0.20), rgba(96,165,250,0.10));
    border: 1px solid rgba(34,197,94,0.30);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin-bottom: 10px;
}
.app-name { font-weight: 700; font-size: 16px; color: #fff; }
.app-desc { color: #888; font-size: 12px; min-height: 30px; }
.app-role {
    align-self: flex-start; margin-top: 8px;
    font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
}

/* ── Cards / forms ─────────────────────────────────────────────────── */
.card { background: #1a1a1a; border: 1px solid #222; border-radius: 12px; padding: 18px 22px; }
.section-label { font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: .08em; margin: 14px 0 6px; }
.field-label { display: block; font-size: 12px; color: #888; margin: 8px 0 3px; }
input, select, textarea {
    width: 100%; padding: 9px 10px; margin-bottom: 6px;
    border-radius: 6px; border: 1px solid #2a2a2a;
    background: #0d0d0d; color: white; font-size: 13px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #22c55e; }

.btn-tinted {
    width: auto; padding: 8px 16px; border-radius: 7px;
    background: rgba(34,197,94,0.15); color: #22c55e;
    border: 1px solid rgba(34,197,94,0.55);
    font-size: 12px; font-weight: 700; cursor: pointer;
}
.btn-tinted.btn-grey   { background: rgba(156,163,175,0.15); color: #9ca3af; border-color: rgba(156,163,175,0.55); }
.btn-tinted.btn-danger { background: rgba(239,68,68,0.15);   color: #ef4444; border-color: rgba(239,68,68,0.55); }
.btn-util {
    width: auto; padding: 6px 12px; font-size: 12px;
    background: #1a1a1a; color: #aaa;
    border: 1px solid #2a2a2a; border-radius: 6px; cursor: pointer;
}
.btn-util:hover { background: #222; color: #fff; }

/* ── Pills ─────────────────────────────────────────────────────────── */
.pill { padding: 3px 9px; border-radius: 5px; font-size: 11px; display: inline-flex; align-items: center; }
.pill-green  { background: rgba(34,197,94,0.10); border: 1px solid #22c55e; color: #22c55e; }
.pill-amber  { background: #1c1000;  border: 1px solid #f97316; color: #f97316; }
.pill-red    { background: rgba(239,68,68,0.10); border: 1px solid #ef4444; color: #ef4444; }
.pill-blue   { background: rgba(96,165,250,0.10); border: 1px solid #60a5fa; color: #60a5fa; }
.pill-grey   { background: transparent; border: 1px solid #555; color: #aaa; }

/* ── Users page ────────────────────────────────────────────────────── */
.apps-row { display: flex; flex-wrap: wrap; gap: 8px; }
.app-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    background: #111; border: 1px solid #2a2a2a;
    border-radius: 8px; cursor: pointer; font-size: 13px;
}
.app-chip:hover { border-color: #22c55e; }
.app-chip-icon { font-size: 16px; }

.user-row {
    display: grid;
    grid-template-columns: 42px 1fr 100px 80px 70px;
    align-items: center; gap: 12px;
    padding: 10px 12px;
    background: #111; border: 1px solid #222; border-radius: 8px;
    margin-bottom: 6px;
}
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #1f6e3a, #22c55e);
    color: #000; font-weight: 700; font-size: 12px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-meta .name { color: #fff; font-weight: 700; font-size: 13px; }
.user-meta .sub  { color: #666; font-size: 11px; margin-top: 2px; }
.user-meta .access-summary { color: #999; max-width: 580px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.perm-grid { display: flex; flex-direction: column; gap: 6px; }
.perm-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.perm-row  { display: grid; grid-template-columns: 1fr 130px; align-items: center; gap: 10px; }
.perm-label { display: inline-flex; align-items: center; gap: 8px; color: #ccc; font-size: 13px; }
.perm-label .ico { font-size: 16px; }
.perm-check-row {
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 10px 12px;
}
.perm-check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ddd;
    font-size: 13px;
    cursor: pointer;
}
.perm-check-label input {
    width: auto;
    margin: 0;
    accent-color: #22c55e;
}
.perm-check-label .ico { font-size: 16px; }

/* ── Modal ─────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.85);
    z-index: 9000;
    display: flex; align-items: center; justify-content: center;
}
.modal-box {
    background: #1a1a1a; border: 1px solid #333; border-radius: 12px;
    padding: 22px;
    width: 440px; max-width: 95vw; max-height: 92vh; overflow-y: auto;
    position: relative;
}
.modal-close {
    position: absolute; top: 10px; right: 12px;
    width: auto; padding: 2px 9px; font-size: 14px;
    background: rgba(239,68,68,0.15); color: #ef4444;
    border: 1px solid rgba(239,68,68,0.55); border-radius: 6px;
    cursor: pointer; font-weight: bold;
}

/* ── Centered single-message screens ───────────────────────────────── */
.centered-msg {
    min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; padding: 24px;
    background: #0d0d0d;
}
.centered-msg h1 { font-family: 'Bebas Neue', Arial; font-size: 32px; margin: 0 0 12px; }
.centered-msg p  { margin: 0 0 8px; max-width: 420px; color: #aaa; }
.centered-msg .muted { color: #666; }
.centered-msg button, .centered-msg a { margin-top: 18px; text-decoration: none; }
