:root {
    --bg: #05070d;
    --bg-soft: #0b0f1a;
    --card: #10162a;
    --card-border: #1c2438;
    --blue: #2f6fed;
    --blue-light: #5b9dff;
    --blue-glow: rgba(47, 111, 237, 0.35);
    --text: #e9ecf5;
    --text-muted: #8891a7;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }

/* ---------- Navbar ---------- */
.navbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 32px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 20px;
    white-space: nowrap;
}

.navbar .logo .icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(145deg, var(--blue), #143a8c);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 18px var(--blue-glow);
}

.navbar .logo .brand-alt { color: var(--blue-light); }

.search-wrap {
    flex: 1;
    max-width: 640px;
    margin: 0 auto;
}

.search-wrap input {
    width: 100%;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--card);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.search-wrap input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-glow);
}

.nav-actions { display: flex; align-items: center; gap: 12px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-light); }

.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--card-border); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue-light); }

.avatar {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}

/* ---------- Layout / sections ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 32px; }

.section-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 20px; font-weight: 700; margin-bottom: 4px;
}
.section-title .badge {
    background: var(--card); border: 1px solid var(--card-border);
    color: var(--blue-light); font-size: 13px; padding: 2px 10px; border-radius: 999px;
}
.section-sub { color: var(--text-muted); font-size: 13px; margin: 0 0 18px; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 22px;
}

.manga-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .15s, border-color .15s;
}
.manga-card:hover { transform: translateY(-4px); border-color: var(--blue); }

.manga-cover {
    position: relative;
    aspect-ratio: 3 / 4.2;
    background: #0d1120 linear-gradient(160deg, #14192c, #0a0d18);
    background-size: cover; background-position: center;
}

.rating-badge {
    position: absolute; top: 8px; right: 8px;
    background: rgba(5,7,13,.85);
    color: var(--blue-light);
    font-size: 12px; font-weight: 700;
    padding: 3px 8px; border-radius: 999px;
    border: 1px solid var(--card-border);
}

.type-badge {
    position: absolute; top: 8px; left: 8px;
    background: rgba(47,111,237,.9);
    color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 3px 8px; border-radius: 999px;
    letter-spacing: .03em;
}

.manga-info { padding: 12px 14px 16px; }
.manga-info h3 { margin: 0 0 8px; font-size: 15px; line-height: 1.3; }

.chapter-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 8px; margin-bottom: 4px;
    background: var(--bg-soft); border-radius: 8px; font-size: 13px;
}
.chapter-row .new-tag {
    background: var(--blue); color: #fff; font-size: 10px;
    padding: 1px 7px; border-radius: 999px; font-weight: 700;
}

footer {
    text-align: center; padding: 28px; color: var(--text-muted);
    border-top: 1px solid var(--card-border); font-size: 13px;
}

.empty-state { color: var(--text-muted); padding: 60px 0; text-align: center; }

.badge-gray { background: rgba(136,145,167,.15); color: var(--text-muted); border: 1px solid var(--card-border); padding: 3px 10px; border-radius: 999px; font-size: 12px; }

/* ---------- Admin quick access footer button ---------- */
.admin-access {
    display: flex; justify-content: center; padding: 24px 0 0;
}
.admin-access a {
    font-size: 12px; color: var(--text-muted);
    border: 1px dashed var(--card-border); padding: 6px 14px; border-radius: 999px;
}
.admin-access a:hover { color: var(--blue-light); border-color: var(--blue); }

/* ---------- Auth pages ---------- */
.auth-box {
    max-width: 400px; margin: 90px auto; background: var(--card);
    border: 1px solid var(--card-border); border-radius: var(--radius);
    padding: 36px 30px; text-align: center;
}
.auth-box h1 { font-size: 22px; margin-bottom: 6px; }
.auth-box p { color: var(--text-muted); font-size: 14px; margin-bottom: 26px; }

.google-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 12px; border-radius: 10px;
    background: #fff; color: #1f1f1f; font-weight: 600; font-size: 14px;
    border: none; cursor: pointer;
}

.admin-login-box input {
    width: 100%; padding: 11px 14px; margin-bottom: 14px;
    border-radius: 10px; border: 1px solid var(--card-border);
    background: var(--bg-soft); color: var(--text); font-size: 14px;
}

.alert {
    padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px;
}
.alert-error { background: rgba(237, 47, 47, .12); color: #ff8080; border: 1px solid rgba(237,47,47,.3); }
.alert-success { background: rgba(47, 237, 130, .12); color: #6ef7ab; border: 1px solid rgba(47,237,130,.3); }

@media (max-width: 720px) {
    .navbar { flex-wrap: wrap; }
    .search-wrap { order: 3; max-width: 100%; }
}
