* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f7fb;
    --text: #172033;
    --muted: #7c8799;
    --white: #ffffff;

    --blue: #4f7cff;
    --blue-dark: #315fd8;
    --blue-soft: #edf3ff;

    --green: #20b26b;
    --green-soft: #eafaf2;
    --green-border: #d2f1e1;

    --orange: #f59e0b;
    --orange-soft: #fff6df;
    --orange-border: #ffe8b0;

    --red: #ef5350;
    --red-soft: #fff0ef;
    --red-border: #ffd8d5;

    --border: #e8edf4;

    --shadow:
        0 8px 30px rgba(30, 50, 90, .06);

    --shadow-hover:
        0 14px 35px rgba(30, 50, 90, .11);
}


/* =========================================
   BASE
========================================= */

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background:
        radial-gradient(
            circle at top left,
            #eef4ff 0,
            transparent 32%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        "Segoe UI",
        Tahoma,
        Arial,
        sans-serif;

    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.app {
    max-width: 1440px;

    margin: auto;

    padding: 28px;
}


/* =========================================
   HEADER
========================================= */

.topbar {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    margin-bottom: 22px;
}

.brand {
    display: flex;

    align-items: center;

    gap: 14px;

    min-width: 0;
}

.brand-icon {
    width: 52px;
    height: 52px;

    flex-shrink: 0;

    border-radius: 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;

    font-weight: 800;

    background:
        linear-gradient(
            135deg,
            #4f7cff,
            #7357ff
        );

    box-shadow:
        0 8px 20px rgba(79,124,255,.25);
}

.brand h1 {
    margin: 0;

    font-size: 25px;

    line-height: 1.25;

    letter-spacing: -.3px;
}

.brand p {
    margin: 4px 0 0;

    color: var(--muted);

    font-size: 13px;
}

.header-actions {
    display: flex;

    align-items: center;

    gap: 9px;

    flex-shrink: 0;
}

.icon-btn,
.export-btn {
    border: 1px solid var(--border);

    background: white;

    border-radius: 12px;

    padding: 11px 15px;

    box-shadow: var(--shadow);

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.icon-btn:hover,
.export-btn:hover {
    transform: translateY(-2px);

    box-shadow:
        0 10px 25px rgba(30,50,90,.10);
}

.icon-btn {
    width: 44px;
    height: 44px;

    padding: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 20px;
}

.icon-btn.loading {
    animation:
        refreshSpin 1s linear infinite;
}

@keyframes refreshSpin {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.export-btn {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    background: #172033;

    color: white;

    border-color: #172033;

    font-weight: 700;
}

.export-btn:hover {
    background: #242f46;
}

.export-icon {
    flex-shrink: 0;
}


/* =========================================
   DATE BAR
========================================= */

.date-bar {
    display: flex;

    justify-content: center;

    align-items: center;

    gap: 12px;

    margin-bottom: 24px;
}

.date-display {
    min-width: 300px;

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 10px;

    padding: 5px;
}

#dateText {
    font-weight: 750;

    font-size: 17px;

    letter-spacing: -.2px;
}

.date-nav {
    width: 42px;
    height: 42px;

    border: 1px solid var(--border);

    border-radius: 12px;

    background: white;

    color: #4e5a6d;

    font-size: 25px;

    line-height: 1;

    box-shadow: var(--shadow);

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.date-nav:hover {
    transform: translateY(-2px);

    background: #fafcff;

    box-shadow:
        0 10px 24px rgba(30,50,90,.10);
}

.today-btn {
    border: 0;

    background: var(--blue-soft);

    color: var(--blue);

    padding: 7px 11px;

    border-radius: 8px;

    font-size: 12px;

    font-weight: 750;

    transition: .2s;
}

.today-btn:hover {
    background: #dfe9ff;
}

#datePicker {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;

    pointer-events: none;
}


/* =========================================
   LOADING
========================================= */

.loading {
    min-height: 280px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    color: var(--muted);
}

.loading-spinner {
    width: 42px;
    height: 42px;

    margin-bottom: 16px;

    border: 4px solid #e7edfa;

    border-top-color: var(--blue);

    border-radius: 50%;

    animation:
        loadingSpin .8s linear infinite;
}

@keyframes loadingSpin {

    to {
        transform: rotate(360deg);
    }
}

.loading-title {
    color: var(--text);

    font-size: 15px;

    font-weight: 750;
}

.loading-date {
    margin-top: 5px;

    color: var(--muted);

    font-size: 12px;
}


/* =========================================
   ERROR
========================================= */

.error {
    padding: 22px;

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            #fff7f6,
            #fff0ef
        );

    border: 1px solid var(--red-border);

    color: #b42318;

    text-align: center;

    box-shadow:
        0 8px 25px rgba(239,83,80,.06);
}

.error-title {
    font-weight: 800;

    font-size: 15px;
}

.error-message {
    margin-top: 5px;

    color: #9d5d5b;

    font-size: 12px;
}

.retry-btn {
    margin-top: 14px;

    padding: 9px 15px;

    border: 0;

    border-radius: 9px;

    background: #172033;

    color: white;

    font-size: 12px;

    font-weight: 700;
}

.retry-btn:hover {
    background: #27334a;
}

.hidden {
    display: none !important;
}


/* =========================================
   SUMMARY
========================================= */

.summary-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 16px;

    margin-bottom: 18px;
}

.summary-card {
    position: relative;

    overflow: hidden;

    min-height: 145px;

    padding: 22px;

    border-radius: 20px;

    background: white;

    border: 1px solid rgba(0,0,0,.03);

    box-shadow: var(--shadow);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.summary-card:hover {
    transform: translateY(-3px);

    box-shadow: var(--shadow-hover);
}

.summary-card::after {
    content: "";

    position: absolute;

    width: 110px;
    height: 110px;

    right: -40px;
    top: -40px;

    border-radius: 50%;

    opacity: .42;

    pointer-events: none;
}

.summary-card.total {
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f2f6ff
        );
}

.summary-card.total::after {
    background: var(--blue);
}

.summary-card.done {
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #effbf5
        );
}

.summary-card.done::after {
    background: var(--green);
}

.summary-card.progress {
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #fff9eb
        );
}

.summary-card.progress::after {
    background: var(--orange);
}

.summary-card.issue {
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #fff2f1
        );
}

.summary-card.issue::after {
    background: var(--red);
}

.card-label {
    color: var(--muted);

    font-weight: 650;
}

.card-value {
    position: relative;

    z-index: 2;

    font-weight: 850;

    margin: 8px 0 2px;

    letter-spacing: -1px;
}

.card-sub {
    color: var(--muted);
}


/* =========================================
   PANELS
========================================= */

.panel {
    background: white;

    border-radius: 20px;

    padding: 22px;

    margin-bottom: 18px;

    border: 1px solid rgba(0,0,0,.03);

    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    margin-bottom: 18px;
}

.panel-header h2 {
    margin: 0;

    font-size: 18px;

    letter-spacing: -.2px;
}

.panel-header p {
    margin: 4px 0 0;

    color: var(--muted);

    font-size: 12px;
}


/* =========================================
   PROGRESS
========================================= */

.progress-panel {
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f8faff
        );
}

.progress-panel strong {
    font-size: 30px;

    color: var(--blue);
}

.progress-track {
    height: 13px;

    background: #edf1f7;

    border-radius: 20px;

    overflow: hidden;
}

.progress-bar {
    height: 100%;

    width: 0%;

    border-radius: 20px;

    background:
        linear-gradient(
            90deg,
            #4f7cff,
            #7357ff
        );

    transition:
        width .6s cubic-bezier(.4,0,.2,1);
}


/* =========================================
   ATTENTION / TRACKING
========================================= */

.attention-panel {
    display: none;

    border: 1px solid #e8edf4;

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #fafcff
        );
}

.attention-panel .panel-header {
    margin-bottom: 14px;
}

.attention-panel .panel-header h2 {
    font-size: 18px;
}

.tracking-group {
    margin-top: 14px;

    padding: 14px;

    border-radius: 16px;

    border: 1px solid;
}

.tracking-progress {
    background:
        linear-gradient(
            135deg,
            #fffdf7,
            #fff8e8
        );

    border-color:
        var(--orange-border);
}

.tracking-issue {
    background:
        linear-gradient(
            135deg,
            #fffafa,
            #fff3f2
        );

    border-color:
        var(--red-border);
}

.tracking-group-header {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-bottom: 10px;
}

.tracking-group-icon {
    width: 34px;
    height: 34px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 10px;

    font-weight: 850;
}

.tracking-progress
.tracking-group-icon {
    background: var(--orange-soft);

    color: var(--orange);
}

.tracking-issue
.tracking-group-icon {
    background: var(--red-soft);

    color: var(--red);
}

.tracking-group-header strong {
    display: block;

    font-size: 13px;
}

.tracking-group-header span {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 11px;
}

.tracking-list {
    display: grid;

    gap: 8px;
}

.attention-item {
    display: flex;

    align-items: flex-start;

    gap: 11px;

    padding: 13px;

    border-radius: 12px;

    background: white;

    border: 1px solid rgba(0,0,0,.035);

    box-shadow:
        0 3px 12px rgba(30,50,90,.04);
}

.attention-item-icon {
    width: 30px;
    height: 30px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;

    font-size: 13px;

    font-weight: 850;
}

.attention-item-icon.status-progress {
    background: var(--orange-soft);

    color: var(--orange);
}

.attention-item-icon.status-issue {
    background: var(--red-soft);

    color: var(--red);
}

.attention-content {
    flex: 1;

    min-width: 0;
}

.attention-status {
    font-size: 10px;

    font-weight: 800;

    text-transform: none;
}

.attention-progress
.attention-status {
    color: #d88a00;
}

.attention-issue
.attention-status {
    color: #df4542;
}

.attention-title {
    margin-top: 3px;

    font-weight: 700;

    font-size: 13px;

    line-height: 1.5;
}

.attention-note {
    margin-top: 5px;

    color: var(--muted);

    font-size: 11px;

    line-height: 1.5;
}


/* =========================================
   FILTERS
========================================= */

.filters {
    display: flex;

    gap: 7px;

    flex-wrap: wrap;
}

.filter {
    border: 0;

    padding: 8px 12px;

    border-radius: 10px;

    background: #f1f4f8;

    color: #667085;

    font-size: 13px;

    font-weight: 650;

    transition:
        transform .2s ease,
        background .2s ease,
        color .2s ease;
}

.filter:hover {
    transform: translateY(-1px);

    background: #e9edf3;
}

.filter.active {
    background: #172033;

    color: white;
}


/* =========================================
   WORK LIST
========================================= */

#workList {
    display: flex;

    flex-direction: column;

    gap: 8px;
}

.work-item {
    position: relative;

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 12px 13px;

    border: 1px solid #edf0f5;

    border-radius: 13px;

    background: #fbfcfe;

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease,
        background .18s ease;
}

.work-item:hover {
    transform: translateX(3px);

    background: white;

    box-shadow:
        0 7px 20px rgba(30,50,90,.07);
}


/*
 * Status accent
 */

.work-item.work-done {
    border-left: 4px solid var(--green);
}

.work-item.work-progress {
    border-left: 4px solid var(--orange);

    background:
        linear-gradient(
            90deg,
            #fffdf8,
            #fbfcfe 35%
        );
}

.work-item.work-issue {
    border-left: 4px solid var(--red);

    background:
        linear-gradient(
            90deg,
            #fffafa,
            #fbfcfe 35%
        );
}


/* =========================================
   WORK NUMBER
========================================= */

.work-number {
    width: 28px;

    flex-shrink: 0;

    text-align: center;

    color: #a1a9b6;

    font-size: 10px;

    font-weight: 800;
}


/* =========================================
   STATUS ICON
========================================= */

.status-icon {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

    display: flex;

    justify-content: center;

    align-items: center;

    border-radius: 11px;

    font-size: 15px;

    font-weight: 850;
}

.status-done {
    color: var(--green);

    background: var(--green-soft);
}

.status-progress {
    color: var(--orange);

    background: var(--orange-soft);
}

.status-issue {
    color: var(--red);

    background: var(--red-soft);
}


/* =========================================
   WORK CONTENT
========================================= */

.work-content {
    flex: 1;

    min-width: 0;
}

.work-title {
    font-weight: 650;

    line-height: 1.5;

    font-size: 13px;

    overflow-wrap: anywhere;
}

.work-note {
    margin-top: 5px;

    display: inline-block;

    max-width: 100%;

    padding: 4px 8px;

    border-radius: 7px;

    background: #f0f3f7;

    color: #727d8f;

    font-size: 11px;

    line-height: 1.45;

    overflow-wrap: anywhere;
}


/* =========================================
   WORK STATUS
========================================= */

.work-status {
    align-self: center;

    padding: 6px 10px;

    border-radius: 8px;

    background: #f3f5f8;

    color: #697386;

    font-size: 10px;

    font-weight: 750;

    white-space: nowrap;
}

.work-status-done {
    background: var(--green-soft);

    color: #178653;
}

.work-status-progress {
    background: var(--orange-soft);

    color: #c27a00;
}

.work-status-issue {
    background: var(--red-soft);

    color: #d83f3d;
}


/* =========================================
   EMPTY
========================================= */

.empty {
    text-align: center;

    padding: 55px 20px;
}

.empty-icon {
    width: 54px;
    height: 54px;

    margin: auto;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--green-soft);

    color: var(--green);

    font-size: 24px;

    font-weight: 800;
}

.empty h3 {
    margin:
        13px 0 5px;

    font-size: 16px;
}

.empty p {
    color: var(--muted);

    margin-top: 0;

    font-size: 13px;
}


/* =========================================
   PRODUCTION REPORT
========================================= */

.production-report {
    width: 1000px;

    font-family:
        "Segoe UI",
        Tahoma,
        Arial,
        sans-serif;

    color: #172033;
}

.report-page {
    width: 1000px;

    padding: 48px;

    background: #f4f7fb;

    min-height: 900px;
}


/* =========================================
   REPORT HEADER
========================================= */

.report-header {
    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    padding-bottom: 25px;

    border-bottom:
        1px solid #e3e8f0;

    margin-bottom: 25px;
}

.report-title {
    font-size: 30px;

    font-weight: 850;

    letter-spacing: -.5px;
}

.report-date {
    margin-top: 5px;

    font-size: 14px;

    color: #7c8799;
}

.report-brand {
    display: flex;

    align-items: center;

    gap: 10px;
}

.report-brand-icon {
    width: 42px;
    height: 42px;

    border-radius: 12px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: white;

    font-weight: 800;

    background:
        linear-gradient(
            135deg,
            #4f7cff,
            #7357ff
        );
}

.report-brand strong {
    display: block;

    font-size: 15px;
}

.report-brand small {
    display: block;

    margin-top: 2px;

    color: #8b95a5;

    font-size: 10px;
}


/* =========================================
   REPORT SECTION TITLE
========================================= */

.report-section-title {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 12px;
}

.report-section-title strong {
    display: block;

    font-size: 16px;
}

.report-section-title span {
    display: block;

    margin-top: 2px;

    color: #8b95a5;

    font-size: 10px;
}

.completion-badge {
    padding: 7px 11px;

    border-radius: 8px;

    background: #edf3ff;

    color: #4f7cff;

    font-size: 11px;

    font-weight: 800;
}


/* =========================================
   REPORT SUMMARY CARDS
========================================= */

.report-cards {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 10px;

    margin-bottom: 15px;
}

.report-stat {
    padding: 15px 17px;

    border-radius: 13px;

    border: 1px solid transparent;
}

.report-stat-label {
    font-size: 10px;

    color: #7c8799;

    font-weight: 600;
}

.report-stat-value {
    margin-top: 3px;

    font-size: 27px;

    font-weight: 850;
}

.report-stat-blue {
    background: #edf3ff;

    border-color: #dce7ff;
}

.report-stat-blue .report-stat-value {
    color: #4f7cff;
}

.report-stat-green {
    background: #eafaf2;

    border-color: #d5f3e4;
}

.report-stat-green .report-stat-value {
    color: #20b26b;
}

.report-stat-orange {
    background: #fff6df;

    border-color: #ffebbd;
}

.report-stat-orange .report-stat-value {
    color: #f59e0b;
}

.report-stat-red {
    background: #fff0ef;

    border-color: #ffd9d7;
}

.report-stat-red .report-stat-value {
    color: #ef5350;
}


/* =========================================
   REPORT PROGRESS
========================================= */

.report-progress {
    padding: 15px;

    border-radius: 13px;

    background: white;

    border: 1px solid #e7ebf1;

    margin-bottom: 18px;
}

.report-progress-head {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 8px;

    font-size: 10px;

    color: #7c8799;
}

.report-progress-head strong {
    color: #4f7cff;

    font-size: 16px;
}

.report-progress-track {
    height: 9px;

    border-radius: 20px;

    overflow: hidden;

    background: #e9edf3;
}

.report-progress-fill {
    height: 100%;

    border-radius: 20px;

    background:
        linear-gradient(
            90deg,
            #4f7cff,
            #7357ff
        );
}


/* =========================================
   REPORT ATTENTION
========================================= */

.report-attention {
    padding: 15px;

    border-radius: 13px;

    margin-bottom: 20px;
}

.report-attention-warning {
    background: #fff5f4;

    border:
        1px solid #ffd9d7;
}

.report-attention-ok {
    display: flex;

    align-items: center;

    gap: 11px;

    background: #eafaf2;

    border:
        1px solid #d5f3e4;
}

.attention-heading {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-bottom: 10px;
}

.attention-icon {
    width: 30px;
    height: 30px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: #ef5350;

    color: white;

    font-weight: 800;
}

.report-attention-ok .attention-icon {
    background: #20b26b;
}

.attention-heading strong {
    display: block;

    color: #c4312f;

    font-size: 13px;
}

.attention-heading span {
    display: block;

    margin-top: 2px;

    color: #9b7775;

    font-size: 10px;
}

.attention-list {
    display: grid;

    gap: 6px;
}

.attention-row {
    display: flex;

    gap: 8px;

    padding: 8px;

    border-radius: 9px;

    background: white;
}

.attention-dot {
    width: 20px;
    height: 20px;

    flex-shrink: 0;

    border-radius: 50%;

    display: flex;

    align-items: center;
    justify-content: center;

    background: #fff0ef;

    color: #ef5350;

    font-size: 10px;

    font-weight: 800;
}

.attention-row strong {
    display: block;

    font-size: 11px;

    line-height: 1.45;
}

.attention-row span {
    display: block;

    margin-top: 2px;

    color: #8b95a5;

    font-size: 9px;
}

.report-attention-ok strong {
    display: block;

    color: #178653;

    font-size: 12px;
}

.report-attention-ok span {
    display: block;

    margin-top: 2px;

    color: #668d7a;

    font-size: 9px;
}


/* =========================================
   REPORT FOOTER
========================================= */

.report-footer {
    display: flex;

    justify-content: space-between;

    margin-top: 18px;

    padding-top: 12px;

    border-top:
        1px solid #e3e8f0;

    color: #a0a8b5;

    font-size: 8px;
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 1000px) {

    .app {
        padding: 20px;
    }

    .summary-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }
}


@media (max-width: 800px) {

    .app {
        padding: 14px;
    }


    /* HEADER */

    .topbar {
        align-items: flex-start;

        gap: 12px;
    }

    .brand {
        align-items: flex-start;
    }

    .brand-icon {
        width: 44px;
        height: 44px;

        border-radius: 13px;
    }

    .brand h1 {
        font-size: 19px;
    }

    .brand p {
        font-size: 11px;
    }

    .header-actions {
        gap: 6px;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
    }

    .export-btn {
        width: 40px;
        height: 40px;

        padding: 0;

        display: flex;

        align-items: center;
        justify-content: center;
    }

    .export-label {
        display: none;
    }


    /* DATE */

    .date-bar {
        gap: 7px;

        margin-bottom: 18px;
    }

    .date-display {
        min-width: 0;

        flex: 1;
    }

    #dateText {
        font-size: 14px;
    }

    .date-nav {
        width: 38px;
        height: 38px;
    }


    /* SUMMARY */

    .summary-grid {
        grid-template-columns:
            repeat(2, 1fr);

        gap: 10px;
    }

    .summary-card {
        min-height: 125px;

        padding: 16px;

        border-radius: 16px;
    }


    /* PANEL */

    .panel {
        padding: 16px;

        border-radius: 16px;

        margin-bottom: 12px;
    }

    .panel-header {
        align-items: flex-start;

        flex-direction: column;

        gap: 12px;
    }


    /* FILTER */

    .filters {
        width: 100%;
    }

    .filter {
        flex: 1;

        padding:
            8px 7px;

        text-align: center;
    }


    /* WORK */

    .work-item {
        align-items: flex-start;

        gap: 9px;

        padding: 11px 10px;
    }

    .work-number {
        width: 22px;

        padding-top: 8px;

        font-size: 9px;
    }

    .status-icon {
        width: 34px;
        height: 34px;

        border-radius: 10px;

        font-size: 14px;
    }

    .work-title {
        font-size: 12px;

        line-height: 1.5;
    }

    .work-note {
        font-size: 10px;
    }

    .work-status {
        display: none;
    }


    /* TRACKING */

    .tracking-group {
        padding: 11px;
    }

    .attention-item {
        padding: 11px;
    }


    /* LOADING */

    .loading {
        min-height: 220px;
    }
}


@media (max-width: 480px) {

    .brand h1 {
        font-size: 17px;
    }

    .brand p {
        display: none;
    }

    .brand-icon {
        width: 40px;
        height: 40px;
    }

    #dateText {
        font-size: 13px;
    }

    .today-btn {
        padding:
            6px 8px;

        font-size: 11px;
    }

    .summary-card {
        min-height: 115px;

        padding: 14px;
    }

    .work-number {
        display: none;
    }
}
/* =================================
   REFRESH BUTTON
================================= */

.icon-btn {
    width: 44px;
    height: 44px;

    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
}

/* =================================
   LOADING OVERLAY
================================= */

.loading-overlay {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;

    align-items: center;
    justify-content: center;

    background: rgba(244, 247, 251, .82);

    backdrop-filter: blur(5px);

    opacity: 1;

    visibility: visible;

    transition:
        opacity .25s ease,
        visibility .25s ease;
}

.loading-overlay.hidden {
    opacity: 0;

    visibility: hidden;

    pointer-events: none;
}


.loading-box {
    width: min(380px, calc(100% - 40px));

    padding: 32px;

    text-align: center;

    background: white;

    border: 1px solid #e7ebf1;

    border-radius: 22px;

    box-shadow:
        0 20px 60px rgba(30, 50, 90, .14);
}


.loading-logo {
    width: 48px;
    height: 48px;

    margin: 0 auto 16px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 14px;

    color: white;

    font-size: 18px;

    font-weight: 800;

    background:
        linear-gradient(
            135deg,
            #4f7cff,
            #7357ff
        );

    box-shadow:
        0 8px 20px rgba(79,124,255,.25);
}


.loading-box h3 {
    margin: 0;

    font-size: 18px;
}


.loading-box p {
    margin: 7px 0 20px;

    color: var(--muted);

    font-size: 13px;
}


.loading-track {
    width: 100%;

    height: 7px;

    overflow: hidden;

    border-radius: 20px;

    background: #edf1f7;
}


.loading-progress {
    width: 40%;

    height: 100%;

    border-radius: 20px;

    background:
        linear-gradient(
            90deg,
            #4f7cff,
            #7357ff
        );

    animation:
        loadingMove 1.2s
        ease-in-out
        infinite;
}


@keyframes loadingMove {

    0% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(300%);
    }

}


.loading-status {
    display: block;

    margin-top: 12px;

    color: #9aa3b2;

    font-size: 11px;
}

/* ==========================================
   CATEGORY SUMMARY
========================================== */

.category-panel {
    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f8faff
        );
}


.category-panel
#categoryTotal,
.category-panel
.category-badge {

    padding: 6px 10px;

    border-radius: 8px;

    background: var(--blue-soft);

    color: var(--blue);

    font-size: 13px;

    font-weight: 800;
}


.category-list {

    display: grid;

    gap: 12px;
}


.category-item {

    padding: 14px 16px;

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f7f9fd
        );

    border: 1px solid #e9edf4;

    transition: .2s;
}


.category-item:hover {

    transform: translateX(3px);

    box-shadow:
        0 5px 18px
        rgba(30,50,90,.07);
}


.category-top {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    margin-bottom: 9px;
}


.category-name {

    display: flex;

    align-items: center;

    gap: 10px;

    min-width: 0;

    font-size: 16px;

    font-weight: 650;

    line-height: 1.5;
}


.category-number {

    width: 27px;

    height: 27px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 8px;

    background: var(--blue-soft);

    color: var(--blue);

    font-size: 13px;

    font-weight: 800;
}


.category-top strong {

    flex-shrink: 0;

    color: var(--text);

    font-size: 21px;

    font-weight: 800;
}


.category-top strong small {

    margin-left: 3px;

    color: var(--muted);

    font-size: 12px;

    font-weight: 600;
}


.category-track {

    height: 7px;

    overflow: hidden;

    border-radius: 20px;

    background: #edf1f6;
}


.category-bar {

    height: 100%;

    border-radius: 20px;

    background:
        linear-gradient(
            90deg,
            #4f7cff,
            #7357ff
        );

    transition:
        width .5s ease;
}

/* ==========================================
   ATTENTION IMPROVED
========================================== */

.attention-item {

    position: relative;

    padding: 15px 17px;

    border-radius: 14px;

    margin-top: 10px;

    border-left: 5px solid;

    background: white;

    box-shadow:
        0 4px 15px
        rgba(30,50,90,.06);
}


.attention-issue {

    border-left-color: var(--red);

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #fff7f6
        );
}


.attention-progress {

    border-left-color: var(--orange);

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #fffbf2
        );
}


.attention-status {

    display: inline-flex;

    align-items: center;

    gap: 5px;

    margin-bottom: 5px;

    font-size: 11px;

    font-weight: 800;
}

.attention-dot-icon {

    display: inline-block;

    width: 9px;
    height: 9px;

    flex-shrink: 0;

    border-radius: 50%;
}

.attention-dot-progress {

    background: var(--orange);
}

.attention-dot-issue {

    background: var(--red);
}


.attention-issue
.attention-status {

    color: var(--red);
}


.attention-progress
.attention-status {

    color: var(--orange);
}


.attention-title {

    font-size: 14px;

    font-weight: 700;

    line-height: 1.55;
}


.attention-category {

    margin-top: 7px;

    display: inline-block;

    padding: 5px 8px;

    border-radius: 7px;

    background: #f1f4f8;

    color: #687386;

    font-size: 13px;

    line-height: 1.4;
}


.attention-note {

    margin-top: 7px;

    padding: 7px 9px;

    border-radius: 8px;

    background: #f7f8fa;

    color: #727d8f;

    font-size: 11px;

    line-height: 1.5;
}
/* ==========================================
   PHASE 4
   MODERN READABILITY
========================================== */

:root {
    --font-base: 16px;
    --font-title: 18px;
    --font-small: 14px;
}


/* ==========================================
   GLOBAL TYPOGRAPHY
========================================== */

body {
    font-size: var(--font-base);
    line-height: 1.6;
}

.brand h1 {
    font-size: 27px;
    line-height: 1.25;
}

.brand p {
    font-size: 16px;
}

.panel-header h2 {
    font-size: 21px;
}

.panel-header p {
    font-size: 14px;
}

#dateText {
    font-size: 18px;
}

.today-btn {
    font-size: 13px;
}


/* ==========================================
   SUMMARY
========================================== */

.card-label {
    font-size: 16px;
}

.card-value {
    font-size: 54px;
}

.card-sub {
    font-size: 14px;
}


/* ==========================================
   WORK LIST
========================================== */

.work-item {

    padding: 17px 10px;

    border-radius: 14px;

    margin-bottom: 8px;

    border-top: 0;

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #fafcff
        );

    border: 1px solid
        #edf1f6;

    box-shadow:
        0 3px 12px
        rgba(30, 50, 90, .035);
}


.work-item:hover {

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f7f9ff
        );

    padding-left: 14px;

    padding-right: 14px;
}


.work-content {
    padding-top: 1px;
}


.work-title {

    font-size: 16px;

    font-weight: 650;

    line-height: 1.6;

    color: #172033;
}


/* CATEGORY */

.work-category {

    display: inline-flex;

    margin-top: 7px;

    padding: 5px 10px;

    border-radius: 8px;

    background: #f0f4ff;

    color: #5269b5;

    font-size: 13px;

    font-weight: 600;

    line-height: 1.35;
}


/* NOTE */

.work-note {

    display: block;

    margin-top: 8px;

    padding: 7px 10px;

    border-radius: 9px;

    background: #f7f8fa;

    color: #697386;

    font-size: 13px;

    line-height: 1.5;
}


/* STATUS */

.work-status {

    font-size: 13px;

    padding: 7px 11px;
}


/* ICON */

.status-icon {

    width: 42px;

    height: 42px;

    border-radius: 13px;

    font-size: 18px;
}


/* ==========================================
   ATTENTION
========================================== */

.attention-status {
    font-size: 14px;
}

.attention-title {
    font-size: 17px;

    line-height: 1.6;
}

.attention-note {
    font-size: 14px;
}


/* ==========================================
   LOADING
========================================== */

.loading {
    padding: 70px 20px;

    font-size: 15px;
}


/* ==========================================
   MOBILE
========================================== */

@media (max-width: 800px) {

    .brand h1 {
        font-size: 20px;
    }

    .brand p {
        font-size: 12px;
    }

    .card-label {
        font-size: 15px;
    }

    .card-value {
        font-size: 42px;
    }

    .panel-header h2 {
        font-size: 18px;
    }

    .work-title {
        font-size: 15px;
    }

    .work-category {
        font-size: 12px;
    }

    .work-note {
        font-size: 12px;
    }

    .work-item {
        padding: 15px 10px;
    }

    .status-icon {
        width: 38px;
        height: 38px;
    }
}


/* ==========================================
   EXECUTIVE REPORT � READABILITY
========================================== */

.production-report {

    width: 1100px;

    font-size: 16px;
}


.report-page {

    width: 1100px;

    padding: 52px;

    min-height: 900px;
}


/* HEADER */

.report-title {
    font-size: 34px;

    line-height: 1.25;
}

.report-title-sub {
    margin-top: 2px;

    font-size: 20px;

    color: #4f5b73;

    letter-spacing: 1px;
}

.report-date {
    margin-top: 10px;

    font-size: 17px;
}

.report-brand strong {
    font-size: 17px;
}

.report-brand small {
    font-size: 12px;
}


/* SECTION */

.report-section-title strong {
    font-size: 20px;
}

.report-section-title span {
    font-size: 13px;
}

.completion-badge {
    font-size: 13px;

    padding: 8px 12px;
}


/* SUMMARY */

.report-stat {
    padding: 18px 20px;
}

.report-stat-label {
    font-size: 13px;
}

.report-stat-value {
    font-size: 32px;
}


/* PROGRESS */

.report-progress-head {
    font-size: 13px;
}

.report-progress-head strong {
    font-size: 19px;
}

.report-progress-track {
    height: 11px;
}


/* ATTENTION */

.attention-heading strong {
    font-size: 16px;
}

.attention-heading span {
    font-size: 12px;
}

.attention-row strong {
    font-size: 14px;

    line-height: 1.55;
}

.attention-row span {
    font-size: 12px;

    line-height: 1.5;
}


/* ==========================================
   CATEGORY SUMMARY
========================================== */

.report-category-section {
    margin-bottom: 26px;
}

.report-category-list {

    display: grid;

    gap: 9px;
}


.report-category {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 13px 15px;

    border-radius: 11px;

    background: white;

    border: 1px solid #e7ebf1;
}


.report-category-rank {

    width: 28px;

    height: 28px;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    border-radius: 8px;

    background: #edf3ff;

    color: #4f7cff;

    font-size: 12px;

    font-weight: 800;
}


.report-category-name {

    flex: 1;

    min-width: 0;

    font-size: 16px;

    font-weight: 650;

    line-height: 1.45;
}


.report-category-count {

    font-size: 20px;

    font-weight: 850;

    color: #172033;

    white-space: nowrap;
}


.report-category-count small {

    font-size: 13px;

    color: #7c8799;

    font-weight: 600;
}


/* ==========================================
   REPORT FOLLOW-UP
========================================== */

.report-followup-wrap {
    margin-bottom: 26px;
}

.report-followup {

    margin-top: 20px;

    padding: 18px;

    border-radius: 14px;

    background: #fffaf9;

    border: 1px solid #f1dddd;
}


.report-followup-title {

    display: flex;

    align-items: center;

    gap: 9px;

    margin-bottom: 12px;
}


.report-followup-title strong {

    font-size: 18px;
}


.report-followup-item {

    padding: 13px 14px;

    margin-top: 8px;

    border-radius: 10px;

    background: white;

    border-left: 4px solid #f59e0b;
}


.report-followup-item.issue {

    border-left-color: #ef5350;
}


.report-followup-status {

    font-size: 12px;

    font-weight: 800;

    margin-bottom: 4px;
}


.report-followup-task {

    font-size: 16px;

    font-weight: 650;

    line-height: 1.5;
}


.report-followup-category {

    margin-top: 4px;

    color: #5269b5;

    font-size: 13px;
}


.report-followup-note {

    margin-top: 5px;

    color: #697386;

    font-size: 13px;

    line-height: 1.5;
}


/* ==========================================
   IOS EXPORT SAFE
========================================== */

.export-canvas {

    position: fixed;

    left: -100000px;

    top: 0;

    width: 1100px;

    pointer-events: none;
}


.export-overlay {

    position: fixed;

    inset: 0;

    z-index: 99999;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        rgba(15, 23, 42, .45);

    backdrop-filter: blur(4px);
}


.export-progress {

    width: min(
        360px,
        calc(100vw - 40px)
    );

    padding: 24px;

    border-radius: 18px;

    background: white;

    box-shadow:
        0 20px 60px
        rgba(0,0,0,.18);

    text-align: center;
}


.export-progress-title {

    font-size: 17px;

    font-weight: 750;
}


.export-progress-text {

    margin-top: 5px;

    color: #7c8799;

    font-size: 13px;
}


.export-progress-track {

    height: 8px;

    margin-top: 17px;

    overflow: hidden;

    border-radius: 20px;

    background: #edf1f7;
}


.export-progress-bar {

    width: 0%;

    height: 100%;

    border-radius: 20px;

    background:
        linear-gradient(
            90deg,
            #4f7cff,
            #7357ff
        );

    transition:
        width .25s ease;
}


/* ==========================================
   EXPORT PREVIEW (PC)
========================================== */

.preview-overlay {

    position: fixed;

    inset: 0;

    z-index: 100000;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 24px;

    background: rgba(15, 23, 42, .55);

    backdrop-filter: blur(4px);
}


.preview-modal {

    width: min(760px, 100%);

    max-height: min(880px, 92vh);

    display: flex;

    flex-direction: column;

    background: var(--white);

    border-radius: 22px;

    border: 1px solid #e7ebf1;

    box-shadow:
        0 24px 70px rgba(15, 23, 42, .28);

    overflow: hidden;
}


.preview-header {

    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: 14px;

    padding: 20px 22px;

    border-bottom: 1px solid var(--border);
}


.preview-header strong {

    display: block;

    font-size: 17px;
}


.preview-header span {

    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 13px;
}


.preview-close {

    width: 34px;
    height: 34px;

    flex-shrink: 0;

    border: 0;

    border-radius: 10px;

    background: #f1f4f8;

    color: #667085;

    font-size: 15px;

    display: flex;

    align-items: center;
    justify-content: center;

    transition: background .2s ease;
}

.preview-close:hover {

    background: #e9edf3;
}


.preview-body {

    flex: 1;

    overflow: auto;

    padding: 18px 22px;

    background:
        radial-gradient(
            circle at top left,
            #eef4ff 0,
            transparent 32%
        ),
        var(--bg);
}


.preview-image {

    display: block;

    width: 100%;
    height: auto;

    border-radius: 14px;

    box-shadow:
        0 8px 30px rgba(30, 50, 90, .12);
}


.preview-actions {

    display: flex;

    justify-content: flex-end;

    gap: 10px;

    padding: 16px 22px;

    border-top: 1px solid var(--border);

    background: var(--white);
}


.preview-btn {

    border: 0;

    border-radius: 12px;

    padding: 11px 18px;

    font-size: 14px;

    font-weight: 700;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}


.preview-btn-secondary {

    background: #f1f4f8;

    color: #4e5a6d;
}

.preview-btn-secondary:hover {

    background: #e9edf3;
}


.preview-btn-primary {

    color: white;

    background:
        linear-gradient(
            135deg,
            #4f7cff,
            #7357ff
        );

    box-shadow:
        0 8px 20px rgba(79, 124, 255, .3);
}

.preview-btn-primary:hover {

    transform: translateY(-2px);

    box-shadow:
        0 10px 25px rgba(79, 124, 255, .35);
}


@media (max-width: 600px) {

    .preview-modal {

        border-radius: 18px;
    }

    .preview-actions {

        flex-direction: column-reverse;
    }

    .preview-btn {

        width: 100%;

        text-align: center;
    }
}


/* ==========================================
   ต้องติดตาม / สรุปตามประเภทงาน
   ขนาดตัวอักษรฉบับ "พอดี" สำหรับมือถือ
   (ใช้กับหน้า index จริง)
========================================== */

@media (max-width: 800px) {

    .attention-panel .panel-header h2,
    .category-panel .panel-header h2 {

        font-size: 22px;
    }

    .attention-panel .panel-header p,
    .category-panel .panel-header p {

        font-size: 15px;
    }


    .category-panel
    #categoryTotal,
    .category-panel
    .category-badge {

        font-size: 14px;
    }

    .category-name {

        font-size: 18px;
    }

    .category-top strong {

        font-size: 24px;
    }

    .category-top strong small {

        font-size: 13px;
    }


    .attention-status {

        font-size: 15px;
    }

    .attention-title {

        font-size: 18px;
    }

    .attention-category {

        font-size: 14px;
    }

    .attention-note {

        font-size: 15px;
    }
}


/* ==========================================
   REPORT EXPORT — ตัวใหญ่เต็มตา เฉพาะตอน
   export จากมือถือเท่านั้น (ไม่กระทบหน้า index)
   .export-render ถูกใส่ให้เฉพาะ wrapper ที่
   export.js สร้างไว้ตอนสร้างรูป Report
========================================== */

@media (max-width: 800px) {

    .export-render .attention-panel .panel-header h2,
    .export-render .category-panel .panel-header h2 {

        font-size: 28px;
    }

    .export-render .attention-panel .panel-header p,
    .export-render .category-panel .panel-header p {

        font-size: 18px;
    }


    .export-render .category-panel
    #categoryTotal,
    .export-render .category-panel
    .category-badge {

        font-size: 17px;

        padding: 8px 12px;
    }

    .export-render .category-item {

        padding: 18px 18px;
    }

    .export-render .category-name {

        font-size: 24px;
    }

    .export-render .category-number {

        width: 34px;
        height: 34px;

        font-size: 16px;
    }

    .export-render .category-top strong {

        font-size: 34px;
    }

    .export-render .category-top strong small {

        font-size: 17px;
    }

    .export-render .category-track {

        height: 10px;
    }


    .export-render .attention-item {

        padding: 18px;
    }

    .export-render .attention-status {

        font-size: 19px;
    }

    .export-render .attention-dot-icon {

        width: 12px;
        height: 12px;
    }

    .export-render .attention-title {

        font-size: 26px;

        line-height: 1.5;
    }

    .export-render .attention-category {

        font-size: 18px;

        padding: 7px 11px;
    }

    .export-render .attention-note {

        font-size: 19px;
    }
}