:root {
    --brown: #5b3826;
    --brown-dark: #3d261b;
    --cream: #f8f5f1;
    --bg: #f6f7f9;
    --text: #242424;
    --muted: #7d8490;
    --line: #e8e9ed;
    --white: #fff;
    --green: #16a34a;
    --blue: #2563eb;
    --orange: #f59e0b;
    --purple: #7c3aed;
    --red: #ef4444;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}
a {
    text-decoration: none;
    color: inherit;
}
.app-shell {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    transition: 0.2s;
}
.sidebar.collapsed {
    width: 82px;
}
.sidebar.collapsed .brand-name,
.sidebar.collapsed .brand-subtitle,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item:not(.active)::after,
.sidebar.collapsed .user-mini div:not(.avatar),
.sidebar.collapsed .logout-link {
    display: none;
}
.brand {
    height: 82px;
    background: var(--brown-dark);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
}
.brand-icon {
    font-size: 26px;
}
.brand-name {
    font-family: Georgia, serif;
    font-size: 17px;
    font-weight: 700;
}
.brand-subtitle {
    font-size: 10px;
    color: #ddcabe;
    margin-top: 4px;
}
.sidebar-nav {
    padding: 24px 14px;
    flex: 1;
}
.nav-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #9ca1aa;
    margin: 0 12px 10px;
}
.nav-label:not(:first-child) {
    margin-top: 26px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    border-radius: 9px;
    color: #68707c;
    margin: 4px 0;
    font-size: 13px;
}
.nav-item svg {
    width: 17px;
    height: 17px;
}
.nav-item:hover,
.nav-item.active {
    background: #f2e8e0;
    color: var(--brown);
    font-weight: 700;
}
.coming {
    margin-left: auto;
    font-size: 9px;
    background: #f0f1f3;
    padding: 3px 5px;
    border-radius: 4px;
}
.sidebar-bottom {
    padding: 16px;
    border-top: 1px solid var(--line);
}
.user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.user-mini strong {
    display: block;
    font-size: 12px;
}
.user-mini small {
    color: var(--muted);
    font-size: 11px;
}
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #eadbd0;
    color: var(--brown);
    font-weight: 800;
}
.avatar.small {
    width: 28px;
    height: 28px;
    font-size: 12px;
}
.logout-link {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    color: #6b7280;
    font-size: 13px;
}
.logout-link svg {
    width: 17px;
}
.main-content {
    flex: 1;
    min-width: 0;
}
.topbar {
    height: 70px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}
.icon-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: #555;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #6b7280;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}
.status-dot.offline {
    background: var(--red);
}
.chevron {
    width: 14px;
}
.page-content {
    padding: 30px;
    max-width: 1700px;
    margin: auto;
}
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}
.page-heading h1 {
    margin: 8px 0 6px;
    font-size: 30px;
    letter-spacing: -0.04em;
}
.page-heading p {
    margin: 0;
    color: var(--muted);
}
.breadcrumb {
    font-size: 12px;
    color: var(--brown);
}
.target-select {
    min-width: 260px;
}
.target-select label,
.filter-bar label,
.form-panel label {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 700;
}
.target-select select,
.filter-bar select,
.filter-bar input,
.form-panel input {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 11px;
    font-size: 12px;
}
.btn {
    border: 0;
    border-radius: 8px;
    padding: 11px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
}
.btn svg {
    width: 15px;
}
.btn-primary {
    background: var(--brown);
    color: #fff;
}
.btn-primary:hover {
    background: #704630;
}
.btn-full {
    width: 100%;
}
.alert {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 13px 15px;
    border-radius: 9px;
    font-size: 12px;
    margin-bottom: 20px;
}
.alert.success {
    background: #e8f8ed;
    color: #207c40;
}
.alert svg {
    width: 16px;
}
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.kpi-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    gap: 13px;
    align-items: center;
    box-shadow: 0 2px 8px #1b1b1b05;
}
.kpi-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: grid;
    place-items: center;
}
.kpi-icon svg {
    width: 22px;
}
.kpi-icon.green {
    background: #e5f8eb;
    color: var(--green);
}
.kpi-icon.blue {
    background: #e8f0ff;
    color: var(--blue);
}
.kpi-icon.orange {
    background: #fff2df;
    color: var(--orange);
}
.kpi-icon.purple {
    background: #f0eaff;
    color: var(--purple);
}
.kpi-card span {
    display: block;
    color: #777;
    font-size: 11px;
    margin-bottom: 4px;
}
.kpi-card strong {
    font-size: 23px;
    display: block;
    letter-spacing: -0.04em;
}
.kpi-card small {
    display: block;
    color: #a0a4ab;
    font-size: 10px;
    margin-top: 5px;
}
.green-text {
    color: var(--green);
}
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.fake-chart {
    height: 210px;
    display: flex;
    gap: 8px;
    position: relative;
}

.fake-chart svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Tooltip grafik */
.chart-tooltip {
    position: absolute;
    display: none;
    pointer-events: none;

    background: #242424;
    color: #fff;
    padding: 8px 10px;
    border-radius: 7px;

    font-size: 11px;
    line-height: 1.4;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 20;
    white-space: nowrap;
}

.chart-tooltip strong {
    display: block;
    font-size: 12px;
    margin-bottom: 2px;
}

.chart-tooltip span {
    color: #d1d5db;
}

/* Hilangkan titik/bulet pada grafik */
.fake-chart svg circle {
    fill: transparent;
    stroke: transparent;
}
.bottom-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 18px;
}
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 8px #1b1b1b05;
    min-width: 0;
}
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}
.panel-heading h3 {
    font-size: 13px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-heading h3 svg {
    width: 16px;
    color: var(--brown);
}
.period-tabs {
    display: flex;
    gap: 4px;
}

.period-tabs a {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 10px;
    color: #777;
    text-decoration: none;
}

.period-tabs a.active {
    background: var(--brown);
    color: #fff;
    border-color: var(--brown);
}
.fake-chart {
    height: 210px;
    display: flex;
    gap: 8px;
}
.y-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #9da3ac;
    font-size: 10px;
    padding-bottom: 3px;
}
.fake-chart svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}
.grid-lines line {
    stroke: #edf0f3;
    stroke-width: 1;
}
.line {
    fill: none;
    stroke: #3182ed;
    stroke-width: 3;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.area {
    fill: #dbeafe;
    opacity: 0.65;
}
.orange-line {
    stroke: #f59e0b;
}
.chart-x {
    display: flex;
    justify-content: space-between;
    color: #9da3ac;
    font-size: 10px;
    margin: 6px 0 0 24px;
}
.text-link {
    font-size: 11px;
    color: var(--brown);
    font-weight: 700;
}
.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
th {
    background: #fafafa;
    color: #737984;
    font-size: 10px;
    text-align: left;
    font-weight: 800;
}
th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid #f0f1f3;
    white-space: nowrap;
}
td {
    color: #555;
}
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
}
.status > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
}
.status.warning > span {
    background: var(--orange);
}
.status.offline > span {
    background: var(--red);
}
.status.online {
    color: var(--green);
}
.status.warning {
    color: #b77905;
}
.status.offline {
    color: var(--red);
}
.summary-list > div {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f1f3;
    font-size: 12px;
}
.summary-list > div:last-child {
    border-bottom: 0;
}
.summary-list span {
    color: #777;
}
.summary-list strong {
    font-size: 12px;
}
.table-search {
    border: 1px solid var(--line);
    padding: 9px;
    border-radius: 7px;
    font-size: 11px;
    min-width: 200px;
}
.action {
    border: 0;
    border-radius: 5px;
    padding: 6px 8px;
    font-size: 10px;
    margin-right: 5px;
    cursor: pointer;
}
.action.edit {
    background: #fff1d6;
    color: #b77905;
}
.action.delete {
    background: #fee2e2;
    color: #dc2626;
}
.badge {
    background: #f1e7df;
    color: var(--brown);
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 10px;
}
.filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 20px;
}
.filter-bar > div {
    min-width: 0;
}
.filter-bar .btn {
    height: 37px;
}
.form-panel {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-panel h3 {
    margin: 0 0 12px;
}
.form-panel input {
    margin-bottom: 12px;
}
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        linear-gradient(90deg, #4c2e20aa, #4c2e2011),
        url("https://images.unsplash.com/photo-1511920170033-f8396924c348?auto=format&fit=crop&w=1800&q=85")
            center/cover fixed;
}
.login-overlay {
    position: fixed;
    inset: 0;
    background: #21140db5;
}
.login-card {
    position: relative;
    width: min(430px, calc(100% - 32px));
    background: #fff;
    border-radius: 14px;
    padding: 42px;
    box-shadow: 0 20px 70px #0003;
    text-align: center;
}
.login-logo {
    font-size: 46px;
    color: var(--brown);
}
.login-card h1 {
    font-family: Georgia, serif;
    color: var(--brown);
    margin: 10px 0 8px;
    font-size: 27px;
}
.login-subtitle {
    color: #90949c;
    font-size: 13px;
    margin: 0 0 28px;
}
.login-form {
    text-align: left;
}
.login-form > label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #5f636b;
    margin: 14px 0 7px;
}
.input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e1e3e8;
    border-radius: 8px;
    padding: 0 12px;
}
.input-wrap svg {
    width: 16px;
    color: #a1a5ad;
}
.input-wrap input {
    width: 100%;
    border: 0;
    outline: 0;
    padding: 13px 0;
    font-size: 12px;
}
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    margin: 15px 0 20px;
}
.form-row a {
    color: var(--brown);
    font-weight: 700;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #777;
}
.login-footer {
    font-size: 10px;
    color: #a2a5ab;
    margin: 28px 0 0;
}

/* =========================================================
   HISTORY - ACTION BUTTONS
   ========================================================= */

.history-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.history-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.history-actions form {
    margin: 0;
}

.history-check-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
}

/* =========================================================
   MINIMAL FOOTER
   ========================================================= */

.app-footer {
    margin-top: 35px;
    padding: 18px 30px;

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

    border-top: 1px solid var(--line);

    color: #8a8f98;
    font-size: 11px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;

    color: #6f747c;
    font-weight: 700;
}

.footer-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brown);
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 8px;

    color: #a0a4ab;
}

.footer-info span {
    color: #d0d2d5;
}

/* =========================================================
   LOCKED SIDEBAR MENU
   ========================================================= */

.locked-nav {
    position: relative;
    cursor: pointer;
    opacity: 0.65;
}

.locked-nav:hover {
    opacity: 1;
}

.nav-lock {
    width: 13px;
    height: 13px;
    margin-left: auto;
    opacity: 0.7;
}

/* =====================================================
   Restriction Toast
   ===================================================== */

.restriction-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    right: auto;
    z-index: 99999;

    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 320px;
    max-width: 420px;

    padding: 14px 16px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06);

    opacity: 0;
    transform: translate(-50%, -15px) scale(0.98);

    pointer-events: none;

    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.restriction-toast.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
    pointer-events: auto;
}

.restriction-toast-icon {
    width: 38px;
    height: 38px;

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

    flex-shrink: 0;

    border-radius: 10px;

    background: #fef2f2;
    color: #dc2626;
}

.restriction-toast-icon svg {
    width: 19px;
    height: 19px;
}

.restriction-toast-content {
    display: flex;
    flex-direction: column;
    gap: 3px;

    flex: 1;
}

.restriction-toast-content strong {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}

.restriction-toast-content span {
    font-size: 13px;
    line-height: 1.4;
    color: #6b7280;
}

.restriction-toast-close {
    width: 30px;
    height: 30px;

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

    flex-shrink: 0;

    border: 0;
    background: transparent;

    color: #9ca3af;

    cursor: pointer;
    border-radius: 8px;

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

.restriction-toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.restriction-toast-close svg {
    width: 17px;
    height: 17px;
}

.report-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.report-title {
    min-width: 0;
}

.report-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.report-actions .target-select {
    width: 260px;
}

.print-btn {
    height: 38px;
    white-space: nowrap;
}

/* =========================================================
   DESKTOP SIDEBAR COLLAPSED - ICON ONLY
   ========================================================= */

@media (min-width: 801px) {
    .sidebar.collapsed .nav-item {
        width: 100%;
        justify-content: center;
        align-items: center;
        padding: 12px 0;
        gap: 0;
        font-size: 0;
        margin: 5px 0;
    }

    .sidebar.collapsed .nav-item > svg:not(.nav-lock) {
        width: 20px;
        height: 20px;
        margin: 0;
        flex-shrink: 0;
    }

    .sidebar.collapsed .nav-item .nav-lock {
        display: none;
    }

    .sidebar.collapsed .nav-item span {
        display: none;
    }

    .sidebar.collapsed .sidebar-nav {
        padding: 24px 10px;
    }

    .sidebar.collapsed .nav-label {
        display: none;
    }

    .sidebar.collapsed .nav-item.active,
    .sidebar.collapsed .nav-item:hover {
        justify-content: center;
    }

    .sidebar.collapsed .brand {
        justify-content: center;
        padding: 0;
    }

    .sidebar.collapsed .sidebar-bottom {
        padding: 16px 8px;
    }

    .sidebar.collapsed .user-mini {
        justify-content: center;
    }

    .sidebar.collapsed .logout-link {
        justify-content: center;
        padding: 10px 0;
        font-size: 0;
        gap: 0;
    }

    .sidebar.collapsed .logout-link svg {
        width: 20px;
        height: 20px;
    }
}

/* =========================================================
   TOPBAR USER / ADMIN DROPDOWN
   ========================================================= */

.user-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Tombol Admin */
.user-menu-button {
    display: flex;
    align-items: center;
    gap: 8px;

    border: 0;
    background: transparent;

    padding: 5px 8px;
    border-radius: 8px;

    cursor: pointer;
    color: var(--text);
}

.user-menu-button:hover {
    background: #f5f5f5;
}

.user-menu-button .avatar {
    flex-shrink: 0;
}

.user-menu-button strong {
    display: block;
    font-size: 12px;
    line-height: 1.2;
}

.user-menu-button .chevron {
    width: 14px;
    height: 14px;
}

/* DROPDOWN */
.user-menu {
    display: none;

    position: absolute;
    top: calc(100% + 8px);
    right: 0;

    width: 150px;

    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;

    padding: 6px;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);

    z-index: 9999;
}

/* INI PENTING */
.user-menu.show {
    display: block;
}

/* Item dropdown */
.user-menu-item,
.user-menu-item button,
.user-menu-item a {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 9px;

    box-sizing: border-box;

    padding: 9px 10px;

    border: 0;
    border-radius: 6px;

    background: transparent;

    color: #555;
    font-size: 12px;

    text-decoration: none;
    cursor: pointer;

    text-align: left;
}

.user-menu-item:hover,
.user-menu-item button:hover,
.user-menu-item a:hover {
    background: #f5f5f5;
}

/* Logout */
.user-menu-item.logout-item {
    color: #dc2626;
}

.user-menu-item.logout-item:hover {
    background: #fef2f2;
}

.user-menu svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* =====================================================
   Mobile
   ===================================================== */

@media (max-width: 600px) {
    .restriction-toast {
        top: 16px;
        left: 50%;
        right: auto;
        min-width: 0;
        max-width: none;
        width: calc(100% - 32px);
        transform: translate(-50%, -15px) scale(0.98);
    }

    .restriction-toast.show {
        transform: translate(-50%, 0) scale(1);
    }
}

@media (max-width: 1100px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .charts-grid,
    .bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .charts-grid {
        gap: 12px;
    }
    .panel {
        padding: 13px;
    }
    .page-heading h1 {
        font-size: 25px;
    }
    .login-card {
        padding: 30px 24px;
    }
}

/* SIDEBAR MINIMIZE */
.sidebar.collapsed .sidebar-nav {
    padding: 24px 8px;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
    font-size: 0;
    gap: 0;
}

.sidebar.collapsed .nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar.collapsed .nav-item .coming {
    display: none;
}

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

@media (max-width: 800px) {
    /* =====================================================
       SIDEBAR MOBILE
       ===================================================== */

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;

        width: 260px;
        height: 100vh;

        transform: translateX(-100%);
        transition: transform 0.25s ease;

        box-shadow: 8px 0 25px rgba(0, 0, 0, 0.12);
    }

    /* Sidebar dibuka */
    .sidebar.collapsed {
        width: 260px;
        transform: translateX(0);
    }

    /* Kembalikan tampilan normal sidebar */
    .sidebar.collapsed .brand {
        justify-content: flex-start;
        padding: 0 24px;
    }

    .sidebar.collapsed .brand-name,
    .sidebar.collapsed .brand-subtitle,
    .sidebar.collapsed .nav-label {
        display: block;
    }

    .sidebar.collapsed .sidebar-nav {
        padding: 24px 14px;
    }

    .sidebar.collapsed .nav-item {
        width: auto;

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

        gap: 12px;
        padding: 12px 13px;
        margin: 4px 0;

        font-size: 13px;
    }

    .sidebar.collapsed .nav-item svg {
        width: 17px;
        height: 17px;
        flex-shrink: 0;
    }

    .sidebar.collapsed .nav-item span {
        display: inline;
    }

    .sidebar.collapsed .nav-item .coming {
        display: inline-flex;
        margin-left: auto;
        font-size: 9px;
    }

    .sidebar.collapsed .nav-item .nav-lock {
        display: block;
        margin-left: auto;
    }

    /* User area */
    .sidebar.collapsed .sidebar-bottom {
        padding: 16px;
    }

    .sidebar.collapsed .user-mini {
        justify-content: flex-start;
    }

    .sidebar.collapsed .user-mini div:not(.avatar) {
        display: block;
    }

    .sidebar.collapsed .logout-link {
        display: flex;
        justify-content: flex-start;
        align-items: center;

        padding: 10px;
        gap: 10px;

        font-size: 13px;
    }

    .sidebar.collapsed .logout-link svg {
        width: 17px;
        height: 17px;
    }

    /* =====================================================
       MAIN CONTENT
       ===================================================== */

    .main-content {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
    }

    .topbar {
        width: 100%;
        height: 60px;
        padding: 0 18px;
    }

    .page-content {
        width: 100%;
        padding: 20px 16px;
    }

    /* =====================================================
       PAGE HEADING
       ===================================================== */

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
        margin-bottom: 18px;
    }

    .page-heading h1 {
        font-size: 25px;
    }

    /* =====================================================
       REPORT HEADER
       ===================================================== */

    .report-heading {
        align-items: flex-start;
        gap: 16px;
    }

    .report-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .report-actions .target-select {
        width: 100%;
        min-width: 0;
    }

    .print-btn {
        width: 100%;
        height: 40px;
    }

    /* =====================================================
       TARGET
       ===================================================== */

    .target-select {
        width: 100%;
        min-width: 0;
    }

    /* =====================================================
       KPI
       ===================================================== */

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .kpi-card {
        padding: 14px;
    }

    .kpi-card strong {
        font-size: 20px;
    }

    /* =====================================================
       CHART
       ===================================================== */

    .charts-grid,
    .bottom-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .panel {
        padding: 14px;
    }

    .fake-chart {
        height: 180px;
    }

    /* =====================================================
       FILTER
       ===================================================== */

    .filter-bar {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .filter-bar .btn {
        width: 100%;
    }

    /* =====================================================
       FOOTER
       ===================================================== */

    .app-footer {
        margin-top: 25px;
        padding: 16px 18px;

        flex-direction: column;
        align-items: center;
        gap: 6px;

        text-align: center;
    }

    .footer-brand {
        font-size: 11px;
    }

    .footer-info {
        font-size: 10px;
    }

    /* =====================================================
       HISTORY
       ===================================================== */

    .history-panel-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .history-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .history-check-btn {
        width: auto;
    }
}

@media (max-width: 900px) {
    .report-period-info {
        align-items: flex-start;
        flex-direction: column;
    }

    .report-heading {
        align-items: stretch;
    }

    .report-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .report-actions .target-select {
        width: 100%;
    }

    .print-btn {
        width: 100%;
    }
}

@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .btn,
    .period-tabs,
    .target-select {
        display: none !important;
    }

    .main-content {
        width: 100%;
    }

    .page-content {
        padding: 0;
        max-width: none;
    }

    .panel {
        box-shadow: none;
        break-inside: avoid;
    }
}

@media (max-width: 500px) {
    .history-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .history-actions form {
        width: 100%;
    }

    .history-check-btn {
        width: 100%;
    }
}
