/* ==== GLOBAL RESET & BASE ==== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable; /* Prevent layout jump when scrollbar appears */
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #020617; /* deep navy */
    color: #f9fafb;
    overflow-y: scroll;
    font-size: 16px;
}

/* ==== PAGE SHELL ==== */
.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==== TOP NAVBAR ==== */
.topbar {
    background: #020617;
    border-bottom: 1px solid rgba(15, 23, 42, 0.9);
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-inner {
    max-width: 1150px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ==== BRAND / LOGO ==== */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo-circle {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: #020617;
}

.brand-text-main {
    font-weight: 700;
    font-size: 16px;
    color: #f9fafb;
}

.brand-text-sub {
    font-size: 12px;
    color: #9ca3af;
}

/* ==== NAV LINKS ==== */
.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 500;
    color: #e5e7eb;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.5);
    opacity: 0.95;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.12s ease,
        opacity 0.15s ease;
}

.nav-links a:hover {
    opacity: 1;
    background: rgba(37, 99, 235, 0.55);
    border-color: rgba(59, 130, 246, 0.9);
    box-shadow:
        0 0 0 1px rgba(15,23,42,0.7),
        0 6px 14px rgba(15,23,42,0.7);
    transform: translateY(-1px);
}

/* ACTIVE PAGE */
.nav-links a.active {
    background: #facc15;
    color: #111827;
    border-color: #facc15;
    font-weight: 600;
}

/* ICON SUPPORT */
.nav-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* ==== USER PILL (logout) ==== */
.user-pill {
    font-size: 13px;
    color: #e5e7eb;
}

.user-pill a {
    color: #f97316;
    text-decoration: none;
}

.user-pill a:hover {
    text-decoration: underline;
}

/* ==== MAIN CONTENT WRAPPER ==== */
.main-content {
    flex: 1;
    padding: 30px 18px 45px;
}

.content-inner {
    max-width: 1150px;
    margin: 0 auto;
}

/* ==== GENERIC CARDS ==== */
.card {
    background: #020617;
    border-radius: 18px;
    padding: 18px 20px 20px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow:
        0 20px 40px rgba(15,23,42,0.9),
        0 0 0 1px rgba(15,23,42,1);
}

/* ==== TABLES ==== */
.table-wrapper {
    overflow-x: auto;
}

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

table th,
table td {
    padding: 10px 8px;
    border-bottom: 1px solid #334155;
    text-align: left;
    color: #e5e7eb;
}

table th {
    background: #0f172a;
    font-weight: 600;
    color: #f1f5f9;
}

/* ==== FORMS ==== */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #475569;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 16px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.35);
}

textarea {
    resize: vertical;
}

/* ==== BUTTONS ==== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    padding: 12px 24px;
    border-radius: 999px;
    border: none;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}
