/* ================================================
   标品通报 V4 — 主样式
   ================================================ */

:root {
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --border: #d9dce1;
    --border-light: #e8eaed;
    --text: #1d2129;
    --text2: #4e5969;
    --text3: #86909c;
    --blue: #3370ff;
    --green: #00b42a;
    --red: #f53f3f;
    --orange: #ff7d00;
    --sidebar-w: 188px;
    --sidebar-w-collapsed: 52px;
    --topbar-h: 46px;
    --shadow: 0 1px 4px rgba(0, 0, 0, .06);
    --shadow-md: 0 2px 12px rgba(0, 0, 0, .08);
    --radius: 8px;
}

[v-cloak] {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

body.app-ready .boot-shell {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.boot-shell {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at top left, rgba(51, 112, 255, .18), transparent 34%),
        linear-gradient(180deg, #f8fbff 0%, #eef2f7 100%);
    transition: opacity .28s ease, visibility .28s ease;
}

.boot-shell-card {
    width: min(460px, 100%);
    padding: 28px 26px;
    border: 1px solid rgba(51, 112, 255, .12);
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 18px 45px rgba(29, 33, 41, .08);
    backdrop-filter: blur(6px);
}

.boot-shell-badge {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(51, 112, 255, .08);
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
}

.boot-shell-card h1 {
    margin: 14px 0 8px;
    font-size: 28px;
    line-height: 1.2;
}

.boot-shell-card p {
    color: var(--text2);
    line-height: 1.6;
}

.boot-shell-lines {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.boot-line {
    display: block;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #edf1f7 20%, #f8fbff 50%, #edf1f7 80%);
    background-size: 220% 100%;
    animation: shimmer 1.2s linear infinite;
}

.boot-line-lg {
    width: 82%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -20% 0;
    }
}

/* ==============================
   IMAGE LAZY LOADING STYLES
   ============================== */
.img-loading {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.img-loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.img-error {
    opacity: 0.5;
    filter: grayscale(1);
}

/* Placeholder for lazy-loaded images */
img[data-src]:not(.img-loaded) {
    background: linear-gradient(90deg, #f0f2f5 20%, #f8fbff 50%, #f0f2f5 80%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

#watermark-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.05;
    /* Subtle watermark */
}

#app {
    display: flex;
    height: 100vh;
}

/* ==============================
   SIDEBAR
   ============================== */
/* Sidebar styles moved to consolidated block below */

.sidebar.collapsed {
    width: var(--sidebar-w-collapsed);
}

.sidebar.collapsed .sidebar-text {
    display: none;
}

.sidebar.collapsed .nav-children {
    display: none !important;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    min-height: 48px;
}

.sidebar-collapse-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, .5);
    padding: 2px;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: color .2s;
}

.sidebar-collapse-btn:hover {
    color: #fff;
}

.sidebar-nav {
    padding: 8px 5px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 7px;
    color: rgba(255, 255, 255, .6);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all .18s;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.nav-item.active {
    background: rgba(51, 112, 255, .35);
    color: #fff;
    font-weight: 600;
}

.nav-item.disabled {
    opacity: .4;
    cursor: default;
    pointer-events: none;
}

.nav-parent {
    justify-content: flex-start;
}

.nav-parent .arrow {
    margin-left: auto;
    transition: transform .2s;
}

.nav-parent .arrow.open {
    transform: rotate(180deg);
}

.nav-children {
    padding-left: 10px;
}

.nav-child {
    font-size: 13px;
    padding: 7px 12px 7px 24px;
}

.nav-child.active {
    background: rgba(51, 112, 255, .35);
    color: #fff;
}

.nav-group {
    margin-bottom: 1px;
}

/* User info at bottom */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    min-height: 54px;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3370ff, #6b48ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, .5);
    margin-top: 1px;
}

.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, .45);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    flex-shrink: 0;
    transition: color .2s;
}

.logout-btn:hover {
    color: var(--red);
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 150;
}

/* ==============================
   MAIN WRAPPER
   ============================== */
.main-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.top-bar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: var(--text2);
}

.menu-toggle:hover {
    background: var(--bg);
}

.page-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-content {
    flex: 1;
    overflow: auto;
    padding: 12px 14px;
    background: var(--bg);
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================
   REPORT
   ============================== */
.report-toolbar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
}

.report-skeleton-card,
.report-table-skeleton {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.report-skeleton-card {
    padding: 14px 16px;
    margin-bottom: 8px;
}

.report-skeleton-head,
.report-skeleton-filters,
.report-table-skeleton-head,
.report-table-skeleton-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-skeleton-head {
    margin-bottom: 12px;
}

.report-skeleton-filters+.report-skeleton-filters {
    margin-top: 10px;
}

.skeleton-chip,
.skeleton-pill,
.skeleton-cell {
    display: inline-block;
    border-radius: 999px;
    background: linear-gradient(90deg, #edf1f7 20%, #f8fbff 50%, #edf1f7 80%);
    background-size: 220% 100%;
    animation: shimmer 1.2s linear infinite;
}

.skeleton-chip {
    width: 110px;
    height: 26px;
}

.skeleton-chip-wide {
    width: 180px;
}

.skeleton-pill {
    width: 72px;
    height: 24px;
}

.report-table-skeleton {
    padding: 14px 14px 18px;
    min-height: 360px;
}

.report-table-skeleton-head {
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.report-table-skeleton-row+.report-table-skeleton-row {
    margin-top: 10px;
}

.skeleton-cell {
    height: 18px;
    flex: 1;
    min-width: 54px;
    border-radius: 6px;
}

.skeleton-cell-sticky {
    flex: 0 0 86px;
}

.report-skeleton-tip {
    margin-top: 16px;
    color: var(--text3);
    font-size: 12px;
}

.toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
}

.toolbar-row+.toolbar-row {
    margin-top: 5px;
}

.filter-row {
    justify-content: flex-start;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.toolbar-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    white-space: nowrap;
    min-width: 28px;
}

.filter-tag.el-check-tag {
    font-size: 11.5px;
    border-radius: 12px;
    padding: 1px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text2);
    cursor: pointer;
    transition: all .18s;
}

.filter-tag.el-check-tag:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.filter-tag.el-check-tag.is-checked {
    background: rgba(51, 112, 255, .1) !important;
    border-color: var(--blue) !important;
    color: var(--blue) !important;
    font-weight: 600;
}

/* ==============================
   TABLE
   ============================== */
.table-container {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: auto;
    max-height: calc(100vh - 245px);
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
}

.data-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    font-size: 12px;
}

.data-table th,
.data-table td {
    border: 1px solid var(--border-light);
    padding: 4px 7px;
    white-space: nowrap;
    text-align: center;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-row-0 th {
    background: #d5dbe5;
    color: var(--text);
    font-weight: 700;
    font-size: 12.5px;
}

.super-header.cloud-biz-header {
    background: hsl(220, 50%, 85%) !important;
    letter-spacing: 2px;
}

.sidebar {
    width: 240px;
    background: #1d2129;
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: width 0.3s;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
}

.header-row-1 th {
    background: #e0e5ed;
    color: var(--text);
    font-weight: 700;
    font-size: 12.5px;
}

.group-header {
    border-left: 2px solid var(--border) !important;
}

.header-row-2 th {
    background: #eef0f4;
    color: var(--text2);
    font-weight: 600;
    font-size: 11.5px;
}

.sub-header {
    min-width: 54px;
}

.sub-progress {
    min-width: 64px;
}

/* Sticky cols — auto width, no max-width */
.sticky-col {
    position: sticky;
    z-index: 10;
    background: #fff;
}

.col-0 {
    left: 0;
    min-width: 56px;
}

.col-1 {
    left: 56px;
    min-width: 100px;
    text-align: left;
}

.col-2 {
    left: calc(56px + 100px);
    min-width: 68px;
}

.col-3 {
    left: calc(56px + 100px + 68px);
    min-width: 92px;
    text-align: left;
    border-right: 2px solid var(--border) !important;
}

.header-row-0 .sticky-col {
    background: #d5dbe5;
    z-index: 30;
}

.header-row-1 .sticky-col {
    background: #e0e5ed;
    z-index: 30;
}

.header-row-2 .sticky-col {
    background: #eef0f4;
    z-index: 30;
}

.row-even td {
    background: #fafbfc;
}

.row-even .sticky-col {
    background: #fafbfc;
}

.data-table tbody tr:hover td {
    background: #e8f0fe;
}

.data-table tbody tr:hover .sticky-col {
    background: #e8f0fe;
}

.area-cell {
    font-weight: 600;
    color: var(--blue);
    background: #f5f7ff !important;
    vertical-align: middle;
}

.type-cell {
    color: var(--text2);
    font-size: 11.5px;
}

.num-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.progress-cell {
    text-align: center;
}

.pg-na {
    color: var(--text3);
}

.rank-top {
    color: var(--green);
    font-weight: 700;
    background: rgba(0, 180, 42, .12);
    padding: 1px 5px;
    border-radius: 3px;
}

.rank-bottom {
    color: var(--red);
    font-weight: 700;
    background: rgba(245, 63, 63, .1);
    padding: 1px 5px;
    border-radius: 3px;
}

/* ==============================
/* ==============================
   EDITOR (Standard UI for Admin Pages)
   ============================== */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.editor-table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: auto;
    max-height: calc(100vh - 180px);
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
}

.editor-tbl th {
    background: #d5dbe5;
    font-weight: 700;
    font-size: 12.5px;
    color: var(--text);
    padding: 8px 10px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.editor-tbl td {
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text2);
}

.editable-cell {
    padding: 0 !important;
}

.cell-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    text-align: right;
    padding: 8px 10px;
    font-family: inherit;
}

.cell-input:focus {
    background: #e8f0fe;
    box-shadow: inset 0 0 0 2px var(--blue);
}

.cell-changed {
    background: #fef3cd !important;
}

.cell-changed .cell-input {
    font-weight: 600;
    color: var(--orange);
}

.row-dirty td:first-child {
    border-left: 3px solid var(--orange);
}

.confirm-list {
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    background: #fafbfc;
}

.confirm-item {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.confirm-item:last-child {
    border-bottom: none;
}

.confirm-area {
    font-weight: 600;
    color: var(--text);
    display: block;
    margin-bottom: 2px;
}

.confirm-change {
    display: block;
    font-size: 12px;
    color: var(--orange);
    padding-left: 12px;
}

/* ==============================
   IMPORT WIZARD
   ============================== */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text3);
}

.wizard-step.active {
    color: var(--blue);
    font-weight: 600;
}

.wizard-step.done {
    color: var(--green);
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.wizard-step.active .step-num {
    background: var(--blue);
}

.wizard-step.done .step-num {
    background: var(--green);
}

.step-line {
    width: 32px;
    height: 2px;
    background: var(--border);
    margin: 0 4px;
}

.wizard-content {
    display: flex;
    justify-content: center;
}

.wizard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 28px;
    max-width: 520px;
    width: 100%;
    box-shadow: var(--shadow-md);
}

.wizard-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.form-row label {
    font-size: 14px;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
    color: var(--text2);
}

.form-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wizard-desc {
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 10px;
    line-height: 1.5;
}

.wizard-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    margin-bottom: 10px;
    background: #fafbfc;
}

.upload-area input[type="file"] {
    font-size: 13px;
}

.import-errors {
    max-height: 180px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    background: #fef2f2;
    margin-top: 8px;
}

.import-error-line {
    font-size: 12px;
    color: var(--red);
    margin-bottom: 3px;
}

/* ==============================
   ANIMATION SYSTEM
   ============================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(51, 112, 255, .2);
    }
    50% {
        box-shadow: 0 0 16px rgba(51, 112, 255, .3);
    }
}

/* Page content animation */
.page-content {
    animation: fadeInUp 0.4s ease-out;
}

/* Card hover animations */
.stat-card:hover {
    animation: glow 2s ease-in-out infinite;
}

/* Button click feedback */
.btn:active,
.el-button:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

/* Table row fade-in */
.data-table tbody tr {
    animation: fadeIn 0.3s ease-out;
}

/* Sidebar nav item stagger animation */
.nav-item {
    animation: fadeInUp 0.3s ease-out;
    animation-fill-mode: both;
}

.nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-item:nth-child(2) { animation-delay: 0.1s; }
.nav-item:nth-child(3) { animation-delay: 0.15s; }
.nav-item:nth-child(4) { animation-delay: 0.2s; }
.nav-item:nth-child(5) { animation-delay: 0.25s; }
.nav-item:nth-child(6) { animation-delay: 0.3s; }
.nav-item:nth-child(7) { animation-delay: 0.35s; }
.nav-item:nth-child(8) { animation-delay: 0.4s; }

/* Dialog animation */
.el-dialog {
    animation: fadeInUp 0.3s ease-out;
}

/* Loading shimmer with tech glow */
@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -20% 0;
    }
}

/* ==============================
   RESPONSIVE — Tablet (≤ 900px)
   ============================== */
@media (max-width: 900px) {
    .sidebar {
        width: var(--sidebar-w-collapsed);
    }

    .sidebar .sidebar-text {
        display: none;
    }

    .sidebar .nav-children {
        display: none !important;
    }

    .sidebar-collapse-btn {
        display: none;
    }

    .table-container {
        max-height: calc(100vh - 230px);
    }
}

/* ==============================
   RESPONSIVE — Mobile (≤ 600px)
   ============================== */
@media (max-width: 600px) {

    /* Sidebar becomes a drawer */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: var(--sidebar-w) !important;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

    .sidebar .sidebar-text {
        display: inline !important;
    }

    .sidebar .nav-children {
        display: block !important;
    }

    /* Show sidebar when mobile menu is open — controlled via JS class */
    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .mobile-overlay {
        display: block;
    }

    .menu-toggle {
        display: flex;
    }

    .main-wrap {
        width: 100%;
    }

    .top-bar {
        padding: 0 10px;
    }

    .page-content {
        padding: 8px 10px;
    }

    .table-container {
        max-height: calc(100vh - 200px);
    }

    .hide-mobile {
        display: none;
    }

    .wizard-card {
        padding: 16px 14px;
    }

    .form-row {
        flex-wrap: wrap;
    }

    .form-row label {
        min-width: auto;
        text-align: left;
    }

    .step-text {
        display: none;
    }
}

/* ==============================
   HELP DIALOG
   ============================== */
.help-section {
    padding: 10px 5px;
}

.help-section h4 {
    margin: 15px 0 8px;
    color: var(--blue);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section h4::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 14px;
    background: var(--blue);
    border-radius: 2px;
}

.help-section p {
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--text2);
    margin-bottom: 12px;
}

.help-section b {
    color: var(--text);
}

/* ==============================
   ORG MANAGEMENT
   ============================== */
.page-org {
    padding: 10px;
}

.org-container {
    height: calc(100vh - 85px) !important;
}

.custom-tree-node {
    display: flex;
    align-items: center;
    font-size: 13.5px;
}

.org-tree-side .el-tree {
    background: transparent;
}

.org-tree-side .el-tree-node__content:hover {
    background-color: #f5f7fa;
}

.org-tree-side .el-tree-node.is-current>.el-tree-node__content {
    background-color: #e8f3ff !important;
    color: var(--blue);
    font-weight: 600;
}

.org-editor-side h3 {
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 12px;
    font-size: 18px;
    color: #1d2129;
}

.org-editor-side .el-form-item__label {
    font-weight: 500;
}

/* ==============================
   MARKETING CONTROL (Visit Task/Form)
   ============================== */
.form-editor-container {
    display: flex;
    height: calc(100vh - 120px);
    background: #f4f5f7;
    margin: -20px;
}

.editor-sidebar-left {
    width: 200px;
    background: #fff;
    border-right: 1px solid #e5e6eb;
    padding: 20px 15px;
}

.editor-sidebar-right {
    width: 320px;
    background: #fff;
    border-left: 1px solid #e5e6eb;
    padding: 10px 15px;
    overflow-y: auto;
}

.editor-main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 30px;
    overflow-y: auto;
    background: #f0f2f5;
}

.editor-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d2129;
    margin-bottom: 20px;
}

.field-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.field-btn {
    padding: 10px 15px;
    background: #f2f3f5;
    border: 1px dashed #c9cdd4;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #4e5969;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all .2s;
}

.field-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: #e8f3ff;
}

.mobile-preview-container {
    width: 375px;
    height: 667px;
    background: #fff;
    border-radius: 36px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border: 8px solid #333;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.mobile-status-bar {
    height: 44px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    font-size: 12px;
    font-weight: 600;
}

.mobile-h5-content {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 0 15px 30px;
}

.h5-header {
    padding: 25px 5px 15px;
    text-align: center;
}

.h5-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.h5-desc {
    font-size: 13px;
    color: #666;
}

.h5-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    padding: 15px 5px 8px;
}

.h5-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.h5-field {
    margin-bottom: 15px;
}

.h5-field:last-child {
    margin-bottom: 0;
}

.h5-field label {
    display: block;
    font-size: 13.5px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.h5-field label.required::after {
    content: " *";
    color: var(--red);
}

.editable-field {
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
    transition: all .2s;
}

.editable-field:hover {
    border-color: #3370ff80;
    background: #f0f7ff;
}

.editable-field.active {
    border-color: var(--blue);
    background: #f0f7ff;
    box-shadow: 0 0 0 2px rgba(51, 112, 255, 0.1);
}

.field-actions {
    position: absolute;
    right: 8px;
    top: 8px;
    display: none;
    z-index: 10;
}

.editable-field:hover .field-actions,
.editable-field.active .field-actions {
    display: flex;
    gap: 5px;
}

.field-actions .el-icon {
    padding: 4px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    color: var(--red);
    cursor: pointer;
}

.empty-fields-tip {
    text-align: center;
    padding: 40px 10px;
    color: #999;
    font-size: 13px;
    border: 2px dashed #e5e6eb;
    border-radius: 12px;
    margin: 20px 0;
}

.page-visit-task,
.page-visit-form,
.page-visit-stats {
    padding: 20px;
}

/* ==============================
   MODAL / DIALOG REFINEMENT (Modern Flat UI)
   ============================== */
.el-dialog {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    /* Softer, wider shadow */
    border: 1px solid var(--border-light);
    overflow: hidden;
    background: var(--bg-card);
    animation: fadeInUp 0.3s ease-out;
}

.el-dialog__header {
    background: transparent;
    border-bottom: none;
    margin-right: 0 !important;
    padding: 24px 28px 10px;
}

.el-dialog__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.el-dialog__body {
    padding: 10px 28px 24px;
    font-size: 14px;
    color: var(--text2);
}

.el-form-item {
    margin-bottom: 16px;
}

.el-form-item__label {
    font-size: 14px;
    /* Match form-row label */
    font-weight: 500;
    color: var(--text2);
}

.el-input__inner,
.el-textarea__inner {
    font-size: 13px;
    border-radius: var(--radius);
    /* Ensures inputs feel modern */
}

.el-dialog__footer {
    border-top: none;
    padding: 10px 28px 24px;
    background: transparent;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    /* Standardize button gap */
}

/* ==============================
   CUSTOMER MANAGEMENT (PC)
   ============================== */
.page-customer {
    padding: 10px 0;
}

.customer-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.stat-card .label {
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--blue);
}

.customer-list-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-md);
}

.customer-detail-drawer .drawer-content {
    padding: 24px;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h4 {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.detail-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px 8px;
}

.detail-label {
    font-size: 13px;
    color: var(--text3);
}

.detail-value {
    font-size: 13px;
    color: var(--text);
}

/* ==============================
   RESPONSIVE — Enhanced Tablet (768px - 1024px)
   ============================== */
@media (min-width: 768px) and (max-width: 1024px) {
    :root {
        --sidebar-w: 180px;
    }

    .table-container {
        max-height: calc(100vh - 240px);
    }

    .data-table {
        font-size: 11.5px;
    }

    .data-table th,
    .data-table td {
        padding: 3px 5px;
    }

    .report-toolbar {
        padding: 6px 10px;
    }

    .filter-tag.el-check-tag {
        font-size: 11px;
        padding: 1px 6px;
    }

    .page-content {
        padding: 10px 12px;
    }
}

/* ==============================
   RESPONSIVE — Mobile (< 768px)
   ============================== */
@media (max-width: 767px) {
    :root {
        --topbar-h: 50px;
    }

    /* Sidebar becomes drawer */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 240px !important;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 1000;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar .sidebar-text {
        display: inline !important;
    }

    .sidebar .nav-children {
        display: block !important;
    }

    .mobile-overlay {
        display: block;
    }

    .menu-toggle {
        display: flex;
    }

    /* Main content full width */
    .main-wrap {
        width: 100%;
    }

    .top-bar {
        padding: 0 12px;
        height: var(--topbar-h);
    }

    .page-title {
        font-size: 14px;
    }

    .page-content {
        padding: 8px 10px;
    }

    /* Table optimizations */
    .table-container {
        max-height: calc(100vh - 210px);
        border-radius: 6px;
    }

    .data-table {
        font-size: 11px;
    }

    .data-table th,
    .data-table td {
        padding: 3px 4px;
    }

    /* Sticky columns on mobile */
    .col-0 {
        min-width: 50px;
    }

    .col-1 {
        left: 50px;
        min-width: 80px;
    }

    .col-2 {
        left: calc(50px + 80px);
        min-width: 60px;
    }

    .col-3 {
        left: calc(50px + 80px + 60px);
        min-width: 80px;
    }

    /* Toolbar compact */
    .report-toolbar {
        padding: 6px 8px;
        margin-bottom: 6px;
    }

    .toolbar-row {
        gap: 4px;
    }

    .filter-tag.el-check-tag {
        font-size: 10.5px;
        padding: 1px 5px;
    }

    .toolbar-label {
        font-size: 11px;
    }

    /* Hide non-essential on mobile */
    .hide-mobile {
        display: none !important;
    }

    /* Dialog full-screen on mobile */
    .el-dialog {
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0;
    }

    .el-dialog__header {
        padding: 16px 16px 8px;
    }

    .el-dialog__body {
        padding: 8px 16px 16px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }

    .el-dialog__footer {
        padding: 8px 16px 16px;
    }

    /* Form compact */
    .el-form-item {
        margin-bottom: 12px;
    }

    .el-form-item__label {
        font-size: 13px;
    }

    /* Wizard compact */
    .wizard-card {
        padding: 14px 12px;
        border-radius: 8px;
    }

    .wizard-card h3 {
        font-size: 15px;
        margin-bottom: 12px;
    }

    .form-row {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 10px;
    }

    .form-row label {
        min-width: auto;
        text-align: left;
        font-size: 13px;
    }

    .step-text {
        display: none;
    }

    /* Import wizard */
    .upload-area {
        padding: 12px;
    }

    /* Chat page */
    .page-chat {
        padding: 8px;
        height: calc(100vh - 58px);
    }

    .chat-container {
        border-radius: 8px;
    }

    .chat-header {
        padding: 12px 14px;
    }

    .chat-messages {
        padding: 14px;
    }

    /* Organization page */
    .page-org {
        padding: 8px;
    }

    .org-container {
        height: calc(100vh - 90px) !important;
    }

    /* Customer page */
    .page-customer {
        padding: 8px 0;
    }

    .customer-stats {
        gap: 10px;
        margin-bottom: 12px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card .value {
        font-size: 20px;
    }

    .customer-list-wrap {
        padding: 12px;
    }

    /* Editor table */
    .editor-table-wrap {
        max-height: calc(100vh - 160px);
    }

    .editor-tbl th,
    .editor-tbl td {
        padding: 6px 8px;
        font-size: 12px;
    }

    /* Help dialog */
    .help-section {
        padding: 8px 4px;
    }

    .help-section h4 {
        font-size: 14px;
    }

    .help-section p {
        font-size: 13px;
    }
}

/* ==============================
   RESPONSIVE — Small Mobile (< 480px)
   ============================== */
@media (max-width: 479px) {
    :root {
        --topbar-h: 48px;
    }

    .top-bar {
        padding: 0 10px;
    }

    .page-title {
        font-size: 13px;
    }

    .page-content {
        padding: 6px 8px;
    }

    .table-container {
        max-height: calc(100vh - 200px);
    }

    .data-table {
        font-size: 10.5px;
    }

    .report-toolbar {
        padding: 5px 6px;
    }

    .filter-tag.el-check-tag {
        font-size: 10px;
        padding: 0 4px;
    }

    .wizard-card {
        padding: 12px 10px;
    }

    .chat-header {
        padding: 10px 12px;
    }

    .chat-messages {
        padding: 12px;
    }
}

/* ==============================
   TOUCH INTERACTIONS (Mobile)
   ============================== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-item {
        padding: 10px 12px;
        min-height: 44px;
    }

    .filter-tag.el-check-tag {
        padding: 3px 8px;
        min-height: 32px;
    }

    .el-button {
        min-height: 36px;
        padding: 8px 16px;
    }

    /* Remove hover effects on touch */
    .nav-item:hover {
        background: transparent;
    }

    .data-table tbody tr:hover td {
        background: transparent;
    }

    /* Active state for touch */
    .nav-item:active {
        background: rgba(255, 255, 255, .12);
    }

    .filter-tag.el-check-tag:active {
        transform: scale(0.95);
    }
}

/* ==============================
   LANDSCAPE MOBILE
   ============================== */
@media (max-width: 900px) and (orientation: landscape) {
    .table-container {
        max-height: calc(100vh - 180px);
    }

    .el-dialog {
        max-height: 90vh !important;
    }

    .el-dialog__body {
        max-height: calc(90vh - 100px);
    }
}

/* ==============================
   PRINT STYLES
   ============================== */
@media print {
    .sidebar,
    .top-bar,
    .mobile-overlay,
    .menu-toggle {
        display: none !important;
    }

    .main-wrap {
        width: 100%;
    }

    .page-content {
        padding: 0;
        overflow: visible;
    }

    .table-container {
        max-height: none;
        overflow: visible;
        box-shadow: none;
        border: 1px solid #000;
    }

    .data-table {
        font-size: 10px;
    }

    .data-table th,
    .data-table td {
        padding: 2px 3px;
    }
}
