@import url("./app/shared/tokens.css");
@import url("./app/shared/base.css");
@import url("./app/shared/button.css");
@import url("./app/modules/energy/styles.css");
@import url("./app/modules/market/styles.css");
@import url("./app/modules/aviation/styles.css");
@import url("./app/modules/disaster/styles.css");
@import url("./app/modules/public-health/styles.css");
@import url("./app/modules/space-weather/styles.css?v=43");
@import url("./app/modules/mnd-pla/styles.css");
@import url("./app/modules/f1/styles.css");
@import url("./app/modules/feed/styles.css");
@import url("./app/modules/news-timeline/styles.css");
@import url("./app/modules/lightbox/styles.css");
@import url("./app/modules/mobile/styles.css");


@media (min-width: 1100px) {
    html {
        font-size: 14.4px;
    }

    .top-nav {
        height: 54px;
        padding: 0 22px;
    }

    .dashboard-main {
        padding: 12px;
    }
}

.layout-edit-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

body.edit-layout-mode .layout-edit-banner {
    display: flex;
}

.layout-edit-banner-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.layout-edit-banner-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.layout-edit-banner-text {
    font-size: 12px;
    color: var(--text-sec);
}

.layout-edit-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* panel picker */

.layout-panel-picker {
    display: none;
    position: fixed;
    top: 108px;
    right: 16px;
    z-index: 1200;
    width: 320px;
    max-width: calc(100vw - 24px);
}

.layout-panel-picker.open {
    display: block;
}

.layout-panel-picker-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    padding: 14px;
}

.layout-panel-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.layout-panel-picker-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.layout-panel-picker-desc {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-sec);
    line-height: 1.5;
}

.layout-panel-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layout-panel-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-surface);
}

.layout-panel-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    flex-shrink: 0;
}

.layout-panel-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.layout-panel-option-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

.layout-panel-option-sub {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.2;
}

.mobile-section-tabs {
    display: none;
}

.dashboard-main {
    flex: 1;
    min-height: 0;
    padding: 10px;
    overflow: auto;
}

/* ===== TRUE x/y board ===== */

.grid-stack {
    position: relative;
    min-height: 320px;
}

.grid-stack-item {
    position: absolute;
    min-width: 0;
    min-height: 0;
}

.grid-stack-item[hidden] {
    display: none !important;
}

.grid-stack-item-content {
    height: 100%;
    min-height: 0;
}

.grid-col {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 320px;
    height: 100%;
    transition: none !important;
}

body.edit-layout-mode .grid-col {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.20);
    border-color: rgba(59, 130, 246, 0.58);
}

.section-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

body.edit-layout-mode .section-header {
    cursor: grab;
}

body.layout-dragging .section-header {
    cursor: grabbing;
}

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-header h3 {
    font-size: 12px;
    color: var(--text-sec);
    letter-spacing: 1px;
    font-weight: 600;
}

.section-updated {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.grid-stack-item.dragging {
    opacity: 0.78;
}

.panel-resize-x,
.panel-resize-y {
    position: absolute;
    display: none;
    user-select: none;
    z-index: 8;
}

body.edit-layout-mode .panel-resize-x,
body.edit-layout-mode .panel-resize-y {
    display: block;
}

.panel-resize-x {
    top: 0;
    right: 0;
    width: 12px;
    height: 100%;
    cursor: ew-resize;
}

.panel-resize-y {
    left: 0;
    bottom: 0;
    width: 100%;
    height: 12px;
    cursor: ns-resize;
}

.panel-resize-x::before,
.panel-resize-y::before {
    content: "";
    position: absolute;
    background: rgba(59, 130, 246, 0.55);
    border-radius: 999px;
}

.panel-resize-x::before {
    top: 50%;
    right: 2px;
    transform: translateY(-50%);
    width: 4px;
    height: 52px;
}

.panel-resize-y::before {
    left: 50%;
    bottom: 2px;
    transform: translateX(-50%);
    width: 52px;
    height: 4px;
}

@media (max-width: 960px) {
    .layout-edit-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .layout-edit-banner-actions {
        flex-wrap: wrap;
    }

    .layout-panel-picker {
        top: auto;
        right: 12px;
        left: 12px;
        bottom: 12px;
        width: auto;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .dashboard-main {
        padding: 0;
        overflow: hidden;
    }

    .grid-stack {
        min-height: 0;
        height: 100%;
    }

    .grid-stack-item {
        position: static !important;
        width: 100% !important;
        height: 100% !important;
        left: auto !important;
        top: auto !important;
        display: none;
    }

    .grid-stack-item.mobile-active {
        display: block;
    }

    .grid-stack-item-content,
    .grid-col {
        height: 100%;
        min-height: 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
    }

    .mobile-section-tabs {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px;
        border-bottom: 1px solid var(--border);
        background: var(--bg-card);
        overflow-x: auto;
        flex-shrink: 0;
    }
}


/* ==== Pages static dashboard overrides ==== */
.pages-static-note {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 960px) {
  .pages-static-note {
    display: none;
  }
}
