:root {
    --sidebar-width: 250px;
    --brand: #1b3a6b; /* primary brand (navy) */
    --brand-dark: #142c52;
    --primary: #0d6efd; /* clear primary for buttons */
    --primary-contrast: #ffffff;
    --accent: #17a2b8; /* accent/teal for stat icons */
    --surface: #ffffff;
    --muted-text: #6b7280;
}

.blog-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
    background: #f8f9fa;
}

.blog-editor-toolbar .form-select {
    width: auto;
    min-width: 110px;
}

.blog-editor {
    min-height: 260px;
    padding: 14px;
    border: 1px solid #ced4da;
    border-radius: 0 0 6px 6px;
    background: #fff;
    outline: none;
}

.blog-editor:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

body {
    background: #f2f4f8;
    font-size: 0.925rem;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--brand);
    color: #cdd8ea;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    z-index: 1040;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.1rem 1.1rem;
    font-weight: 600;
    color: #fff;
    background: var(--brand-dark);
    font-size: 1.02rem;
}

.sidebar-nav {
    padding: .6rem 0 2rem;
}

.sidebar-nav .nav-heading {
    padding: 1rem 1.15rem .35rem;
    font-size: .7rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #7f96bb;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem 1.15rem;
    color: #cdd8ea;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, .12);
    border-left-color: #ffc107;
    color: #fff;
    font-weight: 500;
}

.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0 .35rem;
    font-size: .7rem;
    line-height: 1.55;
}

.topbar {
    display: flex;
    align-items: center;
    gap: .8rem;
    background: #fff;
    padding: .7rem 1.25rem;
    border-bottom: 1px solid #e3e7ef;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.content {
    padding: 1.25rem;
    flex: 1;
}

.app-footer {
    padding: .75rem 1.25rem;
    color: #7a869a;
    font-size: .8rem;
    border-top: 1px solid #e3e7ef;
    background: #fff;
}

.card {
    border: 1px solid #e8edf6;
    background: var(--surface);
    box-shadow: 0 6px 18px rgba(16, 24, 40, .04);
}

.card-header {
    background: linear-gradient(180deg, rgba(11,20,45,0.02), rgba(255,255,255,0));
    border-bottom: 1px solid #eef3fb;
    font-weight: 600;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.1;
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    color: var(--primary-contrast);
    box-shadow: 0 6px 12px rgba(27, 58, 107, .12);
}

/* Dashboard boxes: make key cards clearer and spacious */
.dashboard-box {
    padding: 1.15rem;
    border-radius: 10px;
}

/* Button styles override to ensure clear, accessible buttons across the ERP */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border-radius: 6px;
    font-weight: 600;
    padding: .45rem .8rem;
    transition: background-color .12s ease, box-shadow .12s ease, transform .06s ease, color .12s ease;
    /* sensible default: filled primary button unless a variant overrides it */
    background-color: var(--primary);
    color: var(--primary-contrast);
    border: 1px solid transparent;
    text-decoration: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-contrast);
    border-color: transparent;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #0b5ed7;
    box-shadow: 0 6px 16px rgba(13, 110, 253, .12);
    color: var(--primary-contrast);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--brand);
    border: 1px solid rgba(27,58,107,.12);
}

.btn-outline-secondary:hover {
    background: rgba(27,58,107,.06);
}

/* Small utility to emphasize actionable links */
.action-link {
    color: var(--brand);
    font-weight: 600;
}

.table > :not(caption) > * > * {
    padding: .6rem .65rem;
}

.table thead th {
    background: #f7f9fc;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    white-space: nowrap;
}

.required-mark {
    color: #dc3545;
}

.form-label {
    font-weight: 500;
    font-size: .85rem;
    margin-bottom: .25rem;
}

.login-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand), #2f6fb5);
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 410px;
    border-radius: 14px;
}

.exam-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }
}

@media print {
    .sidebar, .topbar, .app-footer, .no-print {
        display: none !important;
    }

    .app-main {
        margin-left: 0;
    }
}
