/* ============ RESET ============ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #f3f4f6;
    color: #111827;
}

/* ============ LINKS & BUTTONS ============ */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input[type="submit"] {
    cursor: pointer;
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    background: linear-gradient(135deg, #2563eb, #22c55e);
    color: #ffffff;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.3);
}

button:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.35);
}

/* ============ TOPBAR ============ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-left {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-left span.logo-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #22c55e);
}

.topbar-right {
    font-size: 0.85rem;
    color: #4b5563;
}

.topbar-right strong {
    color: #111827;
}

.topbar-right a {
    color: #2563eb;
    font-weight: 500;
    margin-left: 6px;
}

.topbar-right a:hover {
    color: #1d4ed8;
}

/* ============ MAIN LAYOUT ============ */
.layout {
    display: flex;
    min-height: calc(100vh - 48px);
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #0f172a, #020617);
    color: #e5e7eb;
    padding: 18px 16px;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar-section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin: 14px 0 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #e5e7eb;
    margin-bottom: 4px;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.nav-link:hover {
    background: rgba(31, 41, 55, 0.9);
    transform: translateX(2px);
    text-decoration: none;
}

.nav-link.active {
    background: linear-gradient(135deg, #2563eb, #22c55e);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
    color: #f9fafb;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

.nav-label {
    white-space: nowrap;
}

/* ============ CONTENT ============ */
.content {
    flex: 1;
    padding: 24px 24px 32px;
    max-width: 960px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 18px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 0.92rem;
    color: #6b7280;
}

/* ============ HERO (dashboard “blog” header) ============ */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2.3fr);
    gap: 18px;
    align-items: center;
    padding: 18px 18px;
    margin-bottom: 22px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
}

.hero-kicker {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: #6b7280;
    margin-bottom: 6px;
}

.hero-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #111827;
}

.hero-text {
    font-size: 0.96rem;
    color: #4b5563;
    margin-bottom: 10px;
}

.hero-meta {
    font-size: 0.8rem;
    color: #9ca3af;
}

.hero-image-wrapper {
    border-radius: 15px;
    overflow: hidden;
    background: #0f172a;
    position: relative;
}

.hero-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-image-tag {
    position: absolute;
    left: 10px;
    top: 10px;
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
}

/* ============ DASHBOARD CARDS ============ */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.card {
    background: #ffffff;
    padding: 14px 14px 12px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.card-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9ca3af;
    margin-bottom: 4px;
}

.card-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
}

/* ============ FORMS ============ */
.form-box {
    background: #ffffff;
    padding: 18px 18px 20px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    margin-bottom: 20px;
}

.form-box h2 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #111827;
}

.form-box label {
    display: block;
    margin-top: 10px;
    margin-bottom: 3px;
    font-size: 0.84rem;
    color: #374151;
}

.form-box input,
.form-box select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 9px;
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.15s ease, box-shadow 0.15s ease;
}

.form-box input:focus,
.form-box select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

/* ============ TABLES ============ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

th, td {
    padding: 8px 10px;
    font-size: 0.85rem;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: #f9fafb;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.72rem;
    color: #6b7280;
}

tr:nth-child(even) td {
    background: #f9fafb;
}

tr:hover td {
    background: #eff6ff;
}

/* ============ MESSAGES ============ */
.error,
.success {
    padding: 8px 10px;
    margin-bottom: 12px;
    border-radius: 9px;
    font-size: 0.85rem;
}

.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.success {
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ============ LOGIN PAGE ============ */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top, #2563eb 0, #020617 55%);
}

.login-box {
    background: #ffffff;
    padding: 24px 26px 22px;
    border-radius: 18px;
    width: 330px;
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.45);
    border: 1px solid #e5e7eb;
}

.login-box h2 {
    margin-top: 0;
    font-size: 1.4rem;
    margin-bottom: 4px;
    color: #111827;
}

.login-box .subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 14px;
}

.login-box label {
    display: block;
    margin-top: 10px;
    margin-bottom: 3px;
    font-size: 0.84rem;
}

.login-box input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
    outline: none;
}

.login-box input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.login-box button {
    width: 100%;
    margin-top: 16px;
}

.login-box .hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 10px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding: 10px 12px;
    }

    .sidebar nav ul {
        display: flex;
        gap: 6px;
    }

    .nav-link {
        padding: 7px 10px;
    }

    .content {
        padding: 18px 14px 24px;
    }

    .hero {
        grid-template-columns: 1fr;
    }
}