/* ===== Reset-ish / Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0b1220;
    color: #e5e7eb;
}

/* Container */
.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Links */
a {
    color: #60a5fa;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== Header & Navigation ===== */
.site-header {
    background: linear-gradient(90deg, #020617, #111827);
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.logo a {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #f9fafb;
}

/* Nav */
.main-nav > ul {
    list-style: none;
    display: flex;
    gap: 16px;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: #e5e7eb;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.95rem;
}

.main-nav a:hover {
    background: rgba(148, 163, 184, 0.25);
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: #e5e7eb;
    border-radius: 999px;
}

/* ===== Main Layout ===== */
.page-main {
    padding: 24px 16px 40px;
}

/* Page title / subtitles */
.page-title {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 0.95rem;
    color: #9ca3af;
    margin-top: 0;
}

/* ===== Cards / Content Boxes ===== */
.content-box {
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 60%),
                #020617;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
}

/* Generic card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.card {
    background: #020617;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 4px;
}

.card-subtitle {
    font-size: 0.85rem;
    color: #9ca3af;
    margin: 0 0 8px;
}

.card-meta {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* ===== Forms ===== */
.form-standard {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row-inline {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-row-inline .form-row {
    flex: 1 1 150px;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #d1d5db;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: #020617;
    color: #e5e7eb;
    font-size: 0.95rem;
}

input::placeholder,
textarea::placeholder {
    color: #6b7280;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

small {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Form actions */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 6px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #f9fafb;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.5);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-secondary {
    background: transparent;
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.8);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.1);
}

.btn-link {
    background: transparent;
    border: none;
    padding: 0;
    color: #93c5fd;
    cursor: pointer;
    font-size: 0.85rem;
}

/* ===== Alerts / Errors ===== */
.error-box {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.8);
    color: #fecaca;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.error-box ul {
    margin: 0;
    padding-left: 18px;
}

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    padding: 14px 0 24px;
    margin-top: 16px;
    font-size: 0.8rem;
    color: #9ca3af;
}

/* ===== Dashboard-specific ===== */
.dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ===== Responsive Nav ===== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #020617;
        border-bottom: 1px solid rgba(148, 163, 184, 0.4);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease-out;
    }

        .main-nav > ul {
            flex-direction: column;
            padding: 10px 16px 12px;
            gap: 6px;
        }

    body.nav-open .main-nav {
        max-height: 260px;
        transition: max-height 0.25s ease-in;
    }

    .page-main {
        padding-top: 16px;
    }
}

/* ADMIN DROPDOWN MENU */
.has-submenu {
    position: relative;
}

    .has-submenu > a {
        cursor: pointer;
    }

/* The dropdown container */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 6px 0;
    min-width: 180px;
    display: none; /* hidden by default */
    z-index: 999;
}

    .submenu li {
        list-style: none;
    }

        .submenu li a {
            display: block;
            padding: 8px 14px;
            font-size: 0.9rem;
            white-space: nowrap;
            color: #e2e8f0;
        }

            .submenu li a:hover {
                background: #1e293b;
            }

/* SHOW DROPDOWN ON HOVER — DESKTOP */
@media (min-width: 768px) {
    .has-submenu:hover > .submenu {
        display: block;
    }
}

/* Slightly larger screens */
@media (min-width: 769px) {
    .page-main {
        padding-top: 28px;
    }
}
