.main-content {
    margin-left: 240px;
    padding: 65px 7px 8px;
    min-height: 100vh;
    overflow-x: hidden;
}
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.dashboard-header h2 {
    font-size: 30px;
    font-weight: 700;
    color: var(--sidebar);
    margin: 0;
    line-height: 1.3;
}
.dashboard-header p {
    margin-top: 4px;
    color: #777;
    font-size: 14px;
}
.dashboard-header .btn {
    padding: 9px 16px;
    border-radius: 8px;
    white-space: nowrap;
}
/* =========================================================
   IMPORTANT ALERT TICKER
   Compact full-width dashboard announcement strip
   ========================================================= */

.important-alert-panel {
    width: calc(100% + 50px);
    min-height: 46px;
    margin-left: -25px;
    margin-top: 0;
    margin-bottom: 10px;

    display: flex;
    align-items: stretch;

    background: #6F5138;

    border-top: 1px solid #D8B26E;
    border-bottom: 1px solid #D8B26E;

    box-shadow: 0 4px 14px rgba(111, 81, 56, 0.16);

    overflow: hidden;
    position: relative;
}

/* =========================================================
   MOVING TICKER AREA
   ========================================================= */

.important-alert-ticker {
    flex: 1;
    min-width: 0;
    overflow: hidden;

    display: flex;
    align-items: center;
}

.important-alert-track {
    display: flex;
    align-items: center;

    width: max-content;
    min-width: max-content;

    /* Slower movement */
    animation: importantAlertScroll 55s linear infinite;
}

.important-alert-panel:hover .important-alert-track {
    animation-play-state: paused;
}

/* =========================================================
   ALERT ITEM
   ========================================================= */

.important-alert-item {
    display: inline-flex;
    align-items: center;

    gap: 8px;
    min-height: 46px;

    padding: 0 24px;

    color: #FFFDF8;
    text-decoration: none;

    white-space: nowrap;
}

.important-alert-item:hover {
    color: #FFFFFF;
}

/* =========================================================
   ALERT ICON
   ========================================================= */

.important-alert-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    font-size: 12px;
}

/* Emergency */
.important-alert-icon.emergency {
    background: #C94A4A;
    color: #FFFFFF;

    box-shadow:
        0 0 0 2px rgba(201, 74, 74, 0.18);
}

/* Normal / Important Notice */
.important-alert-icon.notice {
    background: #D8B26E;
    color: #5A422F;

    box-shadow:
        0 0 0 2px rgba(216, 178, 110, 0.18);
}

/* =========================================================
   ALERT TYPE
   ========================================================= */

.important-alert-type {
    font-size: 10px;
    font-weight: 800;

    letter-spacing: 0.7px;

    text-transform: uppercase;
}

/* Emergency */
.emergency-text {
    color: #FFD1D1;
}

/* Important */
.notice-text {
    color: #FFE3A3;
}

/* =========================================================
   ALERT TITLE
   ========================================================= */

.important-alert-title {
    color: #FFFFFF;

    font-size: 13px;
    font-weight: 700;
}

/* =========================================================
   ALERT DESCRIPTION
   ========================================================= */

.important-alert-description {
    color: #F1E7DC;

    font-size: 12px;
}

/* =========================================================
   RIGHT SIDE VIEW BUTTON
   ========================================================= */

.important-alert-view {
    width: 48px;
    min-width: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #5A422F;
    text-decoration: none;

    background: #D8B26E;

    border-left: 1px solid rgba(255, 255, 255, 0.18);

    z-index: 2;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.important-alert-view:hover {
    background: #E6C98A;
    color: #3F2D20;
}

/* =========================================================
   MOVING ANIMATION
   ========================================================= */

@keyframes importantAlertScroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .important-alert-track {
        animation: none;
    }
}

/* =========================================================
   TABLET / MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .important-alert-panel {
        width: calc(100% + 28px);
        margin-left: -14px;

        min-height: 42px;

        margin-bottom: 16px;

        border-top-width: 1px;
        border-bottom-width: 1px;

        border-radius: 0;
    }

    .important-alert-item {
        min-height: 42px;

        padding: 0 16px;

        gap: 7px;
    }

    .important-alert-icon {
        width: 25px;
        height: 25px;
        min-width: 25px;

        font-size: 11px;
    }

    .important-alert-type {
        font-size: 9px;
    }

    .important-alert-title {
        font-size: 11px;
    }

    .important-alert-description {
        font-size: 10px;
    }

    .important-alert-view {
        width: 42px;
        min-width: 42px;
    }
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
    width: 100%;
}
.kpi-card {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.kpi-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary);
    color: var(--white);
    font-size: 17px;
}
.kpi-content {
    min-width: 0;
}
.kpi-title {
    margin-bottom: 3px;
    color: #777;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kpi-number {
    color: var(--secondary);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
}
/* Dashboard Alerts */
.dashboard-role-alert {
    margin-bottom: 20px;
    border-radius: 10px;
}
.dashboard-widget {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    min-height: 360px;
    position: relative;
}
.dashboard-widget h5 {
    margin: 0 0 18px;
    font-size: 17px;
    font-weight: 700;
    color: var(--secondary);
}
.dashboard-widget canvas {
    width: 100% !important;
    height: 280px !important;
    display: block;
}
.dashboard-container {
    margin-top: 18px;
}
.dashboard-row {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}
.dashboard-row.row-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dashboard-row.row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.widget {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.widget-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.widget-title h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary);
}
.widget-title small {
    color: #888;
}
.widget-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}
.widget-item:last-child {
    border-bottom: none;
}
.widget-label {
    color: #666;
    font-size: 14px;
}
.widget-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}
.activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}
.activity-item:last-child {
    border-bottom: none;
}
.activity-item:hover {
    background: #faf9f7;
}
.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.activity-content {
    flex: 1;
    min-width: 0;
}
.activity-content h6 {
    margin: 0;
    font-weight: 600;
}
.activity-content small {
    color: #777;
}
.activity-time {
    color: #888;
    font-size: 12px;
    white-space: nowrap;
}
.notice {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.notice:last-child {
    border-bottom: none;
}
.notice strong {
    color: var(--secondary);
}
.notice small {
    color: #777;
}
.event-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.event-item:last-child {
    border-bottom: none;
}
.event-date {
    min-width: 62px;
    padding: 8px;
    border-radius: 8px;
    background: var(--event);
    color: var(--secondary);
    text-align: center;
    font-weight: 700;
    font-size: 13px;
}
.event-content {
    flex: 1;
}
.event-content h6 {
    margin: 0 0 4px;
    font-weight: 600;
}
.event-content small {
    color: #777;
}
.widget img {
    max-width: 100%;
    height: auto;
    display: block;
}
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-row.row-3,
    .dashboard-row.row-2 {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 82px 14px 24px;
    }
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .dashboard-header .btn {
        width: 100%;
    }
    .dashboard-widget {
        min-height: 320px;
        padding: 15px;
    }
    .dashboard-widget canvas {
        height: 240px !important;
    }
    .widget {
        padding: 15px;
    }
    .widget canvas {
    width: 100% !important;
    height: 260px !important;
    display: block;
}
}
.dashboard-advertisement {
    width: 100%;
    margin: 24px 0;
    padding: 14px 18px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.advertisement-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.advertisement-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--secondary);
}
.advertisement-header i {
    margin-right: 7px;
    color: var(--primary);
}
.advertisement-carousel {
    position: relative;
    width: 100%;
    /* THIS controls the rectangle size */
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.advertisement-slides {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 10px;
    background: #f5f5f5;
}
.advertisement-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
}
.advertisement-slide.active {
    display: flex;
}
.advertisement-slide a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.advertisement-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
}
.advertisement-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease,
                transform 0.2s ease;
}
.advertisement-arrow:hover {
    background: rgba(0, 0, 0, 0.75);
}
.advertisement-prev {
    left: 10px;
}
.advertisement-next {
    right: 10px;
}
.advertisement-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 9px;
}
.advertisement-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #c7c7c7;
    cursor: pointer;
    transition: width 0.2s ease,
                background 0.2s ease;
}
.advertisement-dot.active {
    width: 20px;
    border-radius: 5px;
    background: var(--primary);
}
@media (max-width: 768px) {
    .dashboard-advertisement {
        margin: 18px 0;
        padding: 12px;
    }
    .advertisement-carousel {
        height: 110px;
    }
    .advertisement-slides {
        height: 110px;
    }
    .advertisement-arrow {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }
    .advertisement-prev {
        left: 6px;
    }
    .advertisement-next {
        right: 6px;
    }
}
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}
@media (max-width: 576px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .kpi-card {
        padding: 12px;
        gap: 8px;
    }
    .kpi-title {
        font-size: 11px;
    }
    .kpi-number {
        font-size: 21px;
    }
}