/* ============================================================
   Dashboard Zones — Desktop-first, 3-zone layout
   ============================================================ */

/* ---- Welcome Banner ---- */
.zone-welcome {
    background: linear-gradient(135deg, #1B5E3B 0%, #2E8B57 50%, #4CAF50 100%);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    color: #fff;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(27, 94, 59, 0.25);
}
.zone-welcome::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}
.zone-welcome::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}
.zone-welcome-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.zone-welcome h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
}
.zone-welcome p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.85;
}
.zone-welcome-date {
    font-size: 1rem;
    opacity: 0.75;
    text-align: right;
}

/* ---- Zone Cards Grid (Dashboard Main) ---- */
.zone-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.zone-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
}
.zone-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
.zone-card-header {
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    position: relative;
}
.zone-card-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 0;
}
.zone-card-icon .material-icons {
    font-size: 36px;
    color: #fff;
}
.zone-card-gradient {
    height: 6px;
    width: 100%;
}
.zone-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.35rem 0;
    color: #1e293b;
}
.zone-card-desc {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 1rem 0;
}
.zone-card-stats {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0 1.5rem;
    margin-bottom: 1.25rem;
}
.zone-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}
.zone-stat-pill.blue { background: #eff6ff; color: #2E8B57; }
.zone-stat-pill.green { background: #ecfdf5; color: #059669; }
.zone-stat-pill.amber { background: #fffbeb; color: #d97706; }
.zone-stat-pill.purple { background: #faf5ff; color: #2E8B57; }
.zone-stat-pill.red { background: #fef2f2; color: #dc2626; }
.zone-stat-pill.orange { background: #fff7ed; color: #ea580c; }
.zone-stat-pill.teal { background: #f0fdfa; color: #0d9488; }

.zone-card-action {
    padding: 1rem 1.5rem 1.5rem;
    text-align: center;
    margin-top: auto;
}
.zone-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 28px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Sarabun', sans-serif;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.zone-card-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.03);
}
.zone-card-btn .material-icons { font-size: 18px; }

/* Zone A — Blue */
.zone-a .zone-card-gradient { background: linear-gradient(90deg, #2E8B57, #4CAF50); }
.zone-a .zone-card-icon { background: linear-gradient(135deg, #2E8B57, #4CAF50); }
.zone-a .zone-card-btn { background: linear-gradient(135deg, #2E8B57, #4CAF50); }
.zone-a:hover { box-shadow: 0 12px 40px rgba(59,130,246,0.2); }

/* Zone B — Green */
.zone-b .zone-card-gradient { background: linear-gradient(90deg, #059669, #10b981); }
.zone-b .zone-card-icon { background: linear-gradient(135deg, #059669, #10b981); }
.zone-b .zone-card-btn { background: linear-gradient(135deg, #059669, #10b981); }
.zone-b:hover { box-shadow: 0 12px 40px rgba(5,150,105,0.2); }

/* Zone C — Purple */
.zone-c .zone-card-gradient { background: linear-gradient(90deg, #2E8B57, #4CAF50); }
.zone-c .zone-card-icon { background: linear-gradient(135deg, #2E8B57, #4CAF50); }
.zone-c .zone-card-btn { background: linear-gradient(135deg, #2E8B57, #4CAF50); }
.zone-c:hover { box-shadow: 0 12px 40px rgba(124,58,237,0.2); }

/* Zone D — Orange */
.zone-d .zone-card-gradient { background: linear-gradient(90deg, #ea580c, #f97316); }
.zone-d .zone-card-icon { background: linear-gradient(135deg, #ea580c, #f97316); }
.zone-d .zone-card-btn { background: linear-gradient(135deg, #ea580c, #f97316); }
.zone-d:hover { box-shadow: 0 12px 40px rgba(234,88,12,0.2); }

/* ---- Recent Activity ---- */
.zone-recent {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}
.zone-recent-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.zone-recent-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.zone-recent-header {
    flex-wrap: wrap;
    gap: 10px;
}
.recent-ftabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.recent-ft {
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.recent-ft:hover {
    background: #f8fafc;
    color: #334155;
}
.recent-ft.active {
    background: var(--bt-green, #2E8B57);
    color: #fff;
    border-color: var(--bt-green, #2E8B57);
}
.recent-fcnt {
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.85;
    margin-left: 2px;
}
.recent-ft.active .recent-fcnt {
    opacity: 1;
}
@media (max-width: 768px) {
    .zone-recent-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .recent-ftabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
        scrollbar-width: none;
    }
    .recent-ftabs::-webkit-scrollbar { display: none; }
}
.zone-recent-table {
    width: 100%;
    border-collapse: collapse;
}
.zone-recent-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.zone-recent-table td {
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}
.zone-recent-table tr:last-child td { border-bottom: none; }
.zone-recent-table tr:hover td { background: #f8fafc; }

.recent-col-requester,
.recent-col-supplier,
.recent-col-project {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.84rem;
    color: #334155;
}

.recent-col-project {
    max-width: 200px;
}

.recent-col-step {
    min-width: 140px;
    max-width: 280px;
}

.recent-col-supplier {
    color: #475569;
}

/* ---- Topbar Settings Icon ---- */
.topbar-settings {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    margin-right: 8px;
}
.topbar-settings:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(30deg);
}
.topbar-settings .material-icons { font-size: 22px; color: #fff; }

/* ==== Zone Hub Pages ==== */

/* ---- Hub Page Header ---- */
.zone-hub-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #4CAF50;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: all 0.2s;
}
.zone-hub-back:hover { color: #1B5E3B; transform: translateX(-4px); }
.zone-hub-back .material-icons { font-size: 20px; }

.zone-hub-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.zone-hub-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.zone-hub-icon .material-icons { font-size: 28px; color: #fff; }
.zone-hub-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #1e293b;
}
.zone-hub-title p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 2px 0 0 0;
}

/* ---- Hub Menu Cards ---- */
.zone-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.zone-hub-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    border-left: 5px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.zone-hub-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}
.zone-hub-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.zone-hub-card-icon .material-icons { font-size: 26px; color: #fff; }
.zone-hub-card-content { flex: 1; min-width: 0; }
.zone-hub-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.3rem 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.zone-hub-card-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}
.zone-hub-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}
.zone-hub-card-arrow {
    display: flex;
    align-items: center;
    color: #cbd5e1;
    transition: all 0.2s;
}
.zone-hub-card:hover .zone-hub-card-arrow { color: #4CAF50; transform: translateX(4px); }

/* ---- Color Variants for Hub Cards ---- */
.hub-blue { border-left-color: #2E8B57; }
.hub-blue .zone-hub-card-icon { background: linear-gradient(135deg, #2E8B57, #4CAF50); }
.hub-green { border-left-color: #10b981; }
.hub-green .zone-hub-card-icon { background: linear-gradient(135deg, #059669, #10b981); }
.hub-orange { border-left-color: #f59e0b; }
.hub-orange .zone-hub-card-icon { background: linear-gradient(135deg, #f59e0b, #fb923c); }
.hub-teal { border-left-color: #14b8a6; }
.hub-teal .zone-hub-card-icon { background: linear-gradient(135deg, #0d9488, #14b8a6); }
.hub-amber { border-left-color: #f59e0b; }
.hub-amber .zone-hub-card-icon { background: linear-gradient(135deg, #d97706, #f59e0b); }
.hub-emerald { border-left-color: #10b981; }
.hub-emerald .zone-hub-card-icon { background: linear-gradient(135deg, #059669, #10b981); }
.hub-purple { border-left-color: #8b5cf6; }
.hub-purple .zone-hub-card-icon { background: linear-gradient(135deg, #2E8B57, #8b5cf6); }
.hub-indigo { border-left-color: #4CAF50; }
.hub-indigo .zone-hub-card-icon { background: linear-gradient(135deg, #1B5E3B, #4CAF50); }
.hub-red { border-left-color: #ef4444; }
.hub-red .zone-hub-card-icon { background: linear-gradient(135deg, #dc2626, #ef4444); }
.hub-gold { border-left-color: #eab308; }
.hub-gold .zone-hub-card-icon { background: linear-gradient(135deg, #ca8a04, #eab308); }
.hub-cyan { border-left-color: #06b6d4; }
.hub-cyan .zone-hub-card-icon { background: linear-gradient(135deg, #0891b2, #06b6d4); }

/* ---- Section Groups in Zone C ---- */
.zone-section-group {
    margin-bottom: 2rem;
}
.zone-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}
.zone-section-title .material-icons { font-size: 22px; }
.zone-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.zone-section-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 8px rgba(0,0,0,0.04);
    border-left: 4px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.zone-section-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.zone-section-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.zone-section-card-icon .material-icons { font-size: 22px; color: #fff; }
.zone-section-card-text {
    flex: 1;
    min-width: 0;
}
.zone-section-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}
.zone-section-card-sub {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 2px;
}
.zone-section-card .badge-count {
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* ---- Big Stat Cards (Zone B) ---- */
.zone-stat-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.zone-stat-big {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border-left: 6px solid #e2e8f0;
    transition: all 0.25s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}
.zone-stat-big:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}
.zone-stat-big-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
.zone-stat-big-icon .material-icons { font-size: 32px; color: #fff; }
.zone-stat-big h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #1e293b;
}
.zone-stat-big-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.75rem;
}
.zone-stat-big-detail {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: #64748b;
}
.zone-stat-big-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 1.25rem;
    padding: 8px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'Sarabun', sans-serif;
}
.stat-amber { border-left-color: #f59e0b; }
.stat-amber .zone-stat-big-icon { background: linear-gradient(135deg, #d97706, #f59e0b); }
.stat-amber .zone-stat-big-number { color: #d97706; }
.stat-amber .zone-stat-big-btn { background: linear-gradient(135deg, #d97706, #f59e0b); }
.stat-green { border-left-color: #10b981; }
.stat-green .zone-stat-big-icon { background: linear-gradient(135deg, #059669, #10b981); }
.stat-green .zone-stat-big-number { color: #059669; }
.stat-green .zone-stat-big-btn { background: linear-gradient(135deg, #059669, #10b981); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .zone-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .zone-hub-grid { grid-template-columns: 1fr; }
    .zone-stat-cards { grid-template-columns: 1fr; }
    .zone-welcome { padding: 1.5rem; }
    .zone-welcome h2 { font-size: 1.35rem; }
}
@media (max-width: 640px) {
    .zone-cards-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .zone-welcome-content { flex-direction: column; align-items: flex-start; }
    .zone-welcome-date { text-align: left; }
    .zone-section-grid { grid-template-columns: 1fr; }
    .zone-recent-table { font-size: 0.82rem; }
    .zone-recent-table th, .zone-recent-table td { padding: 8px 10px; }
    .zone-card h3 { font-size: 1.15rem; }
}

/* ---- Pipeline Workflow (from prpo-dashboard) ---- */
.pipe-cards-wrap {
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(46, 139, 87, 0.12);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 16px 18px;
    margin-bottom: 16px;
}
.pipe-cards-hdr {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}
.pipe-cards-hdr h3 { margin: 0; font-size: 15px; font-weight: 700; color: #1e293b; }
.pipe-cards-hdr p { margin: 2px 0 0; font-size: 11px; color: #94a3b8; }
.pipe-cards-scroll {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.pipe-cards-scroll::-webkit-scrollbar { display: none; }
.pcard {
    flex: 0 0 130px;
    background: #f8faf8;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s;
}
.pcard-clickable { cursor: pointer; }
.pcard-clickable:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(46, 139, 87, 0.15); }
.pcard-active { border-color: #2E8B57 !important; box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.25); }
.pcard-empty { opacity: 0.55; cursor: default; }
.pcard-hint { font-size: 9px; color: #2E8B57; margin-top: 4px; font-weight: 600; }
.plist-clickable { cursor: pointer; }
.plist-clickable:hover .plist-body { background: #f0fdf4; }
.plist-active .plist-body { background: #EAF5E8; border-radius: 8px; }
.recent-pipe-label {
    margin: 4px 0 0;
    font-size: 12px;
    color: #2E8B57;
    font-weight: 600;
}
.recent-pipe-label button {
    margin-left: 8px;
    padding: 2px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    font-size: 11px;
    cursor: pointer;
    font-family: Sarabun, sans-serif;
    color: #64748b;
}
.zone-recent-header > div:first-child { flex: 1; min-width: 0; }
.pcard-count { font-size: 28px; font-weight: 900; line-height: 1; color: #334155; }
.pcard-title { font-size: 14px; font-weight: 800; color: #1e293b; margin-top: 4px; }
.pcard-sub { font-size: 10px; color: #94a3b8; }
.pcard-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #cbd5e1;
    flex-shrink: 0;
    padding: 0 4px;
    align-self: center;
}
.pcard-done { border-color: #059669; background: linear-gradient(135deg, #f0fdf4, #fff); }
.pcard-now { border-color: #2E8B57; background: linear-gradient(135deg, #EAF5E8, #fff); animation: pipe-pulse 2s infinite; }
.pcard-warn { border-color: #d97706; background: linear-gradient(135deg, #fffbeb, #fff); }
.pcard-idle { border-color: #e2e8f0; background: #f8faf8; }
@keyframes pipe-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46, 139, 87, 0.25); }
    50% { box-shadow: 0 0 0 5px rgba(46, 139, 87, 0); }
}
.pipe-list { display: none; }
@media (max-width: 768px) {
    .pipe-cards-wrap { padding: 12px 14px; }
    .pipe-cards-hdr { margin-bottom: 10px; }
    .pipe-cards-hdr h3 { font-size: 14px; }
    .pipe-cards-hdr p { font-size: 10px; }
    .pipe-cards-scroll {
        display: flex;
        gap: 0;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding-bottom: 4px;
    }
    .pcard {
        flex: 0 0 72px;
        padding: 8px 5px;
        border-radius: 8px;
        scroll-snap-align: start;
    }
    .pcard-count { font-size: 20px; }
    .pcard-title { font-size: 11px; margin-top: 2px; line-height: 1.15; }
    .pcard-sub {
        font-size: 8px;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .pcard-hint { display: none; }
    .pcard-arrow { font-size: 14px; padding: 0 1px; }
}
.plist-item { display: flex; align-items: stretch; gap: 0; }
.plist-line-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 44px;
    flex-shrink: 0;
}
.plist-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    border: 2px solid transparent;
    margin-top: 12px;
}
.plist-dot.pdone { background: #d1fae5; border-color: #059669; color: #059669; }
.plist-dot.pnow { background: #EAF5E8; border-color: #2E8B57; color: #2E8B57; animation: pipe-pulse 2s infinite; }
.plist-dot.pwarn { background: #fef3c7; border-color: #d97706; color: #d97706; }
.plist-dot.pidle { background: #f1f5f9; border-color: #e2e8f0; color: #94a3b8; }
.plist-vline { width: 2px; flex: 1; background: #e2e8f0; min-height: 8px; }
.plist-vline.vdone { background: #059669; }
.plist-vline.vnow { background: #2E8B57; }
.plist-body { flex: 1; padding: 10px 10px 10px 4px; border-bottom: 1px solid #f1f5f9; }
.plist-item:last-child .plist-body { border-bottom: none; }
.plist-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.plist-title { font-size: 15px; font-weight: 800; color: #1e293b; }
.plist-sub-inline { font-size: 11px; font-weight: 400; color: #94a3b8; }
.plist-step-no { font-size: 10px; color: #94a3b8; }
.plist-count { font-size: 26px; font-weight: 900; line-height: 1; }

.team-dept-banner {
    background: linear-gradient(135deg, #1B5E3B, #2E8B57);
    border-radius: 12px;
    padding: 14px 18px;
    color: #fff;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.team-dept-banner strong { font-size: 1.05rem; }

/* ---- Recent list action rows ---- */
.recent-action-row { background: #fffbeb !important; }
.recent-action-row td { border-left: 3px solid #f59e0b; }
.recent-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    margin-left: 6px;
    white-space: nowrap;
}
.recent-action-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}
.recent-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: 'Sarabun', sans-serif;
    white-space: nowrap;
    transition: transform 0.15s;
}
.recent-btn:hover { transform: translateY(-1px); }
.recent-btn .material-icons { font-size: 15px; }
.recent-btn-approve { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.recent-btn-reject { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.recent-btn-view { background: #eff6ff; color: #1e40af; border: 1px solid #93c5fd; }
.recent-btn-edit { background: #ecfdf5; color: #047857; border: 1px solid #6ee7b7; }
.zone-stat-pill.amber { background: #fef3c7; color: #92400e; }

.recent-cards { display: none; }
.recent-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
}
.recent-card.action-needed {
    border-color: #fbbf24;
    background: #fffbeb;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
}
.recent-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.recent-card-num { font-weight: 800; font-size: 15px; color: #1e293b; }
.recent-card-project {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin: 4px 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recent-card-meta { font-size: 12px; color: #64748b; margin-bottom: 4px; }
.recent-card-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.recent-card-step { flex: 1 1 auto; min-width: 0; }
.recent-card-amount { font-weight: 700; color: #059669; font-size: 14px; }
.recent-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #f1f5f9; }

.dash-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.55);
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.dash-modal-overlay.open { display: flex; }
.dash-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.dash-modal-hdr {
    padding: 16px 20px;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}
.dash-modal-hdr.approve { background: linear-gradient(135deg, #059669, #10b981); }
.dash-modal-hdr.reject { background: linear-gradient(135deg, #ef4444, #dc2626); }
.dash-modal-body { padding: 20px; }
.dash-modal-body p { margin: 0 0 12px; color: #475569; font-size: 14px; }
.dash-modal-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    font-size: 13px;
    margin-bottom: 14px;
}
.dash-modal-summary strong { color: #1e293b; }
.dash-modal-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    font-family: Sarabun, sans-serif;
    font-size: 14px;
    resize: vertical;
    min-height: 90px;
}
.dash-modal-textarea:focus { outline: none; border-color: #ef4444; }
.dash-modal-footer {
    padding: 14px 20px;
    background: #f8fafc;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.dash-modal-btn {
    padding: 9px 18px;
    border-radius: 9px;
    border: none;
    font-family: Sarabun, sans-serif;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
}
.dash-modal-btn-cancel { background: #e2e8f0; color: #475569; }
.dash-modal-btn-primary { background: #059669; color: #fff; }
.dash-modal-btn-danger { background: #ef4444; color: #fff; }

/* Payment detail modal (Dashboard) */
.dash-modal.dash-pay-detail-box {
    max-width: min(98vw, 720px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.dash-modal.dash-pay-detail-box.dash-pay-detail-wide {
    max-width: min(98vw, 1200px);
}
.dash-modal-hdr.detail { background: linear-gradient(135deg, #0d9488, #047857); }
.dash-pay-detail-scroll {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.dash-pay-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}
@media (max-width: 600px) {
    .dash-pay-detail-grid { grid-template-columns: 1fr; }
}
.dash-pay-detail-item label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}
.dash-pay-detail-item .val {
    font-size: 13px;
    color: #1e293b;
    word-break: break-word;
}
.dash-pay-detail-item.dash-pay-detail-full {
    grid-column: 1 / -1;
}

.dash-voucher-section {
    margin-top: 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #faf5ff, #f5f3ff);
    border: 1.5px solid #c4b5fd;
    border-radius: 12px;
}
.dash-voucher-section-hdr {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 700;
    color: #5b21b6;
    margin-bottom: 10px;
}
.dash-voucher-section-hdr .material-icons { font-size: 20px; color: #7c3aed; }
.dash-voucher-badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
}
.dash-voucher-print-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    font-family: Sarabun, sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.dash-voucher-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
}
.dash-voucher-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    font-size: 12px;
}
.dash-voucher-table thead tr {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
}
.dash-voucher-table th { padding: 9px 10px; font-size: 11px; font-weight: 700; }
.dash-voucher-empty {
    text-align: center;
    padding: 24px 12px;
    color: #94a3b8;
    font-size: 13px;
}
.dash-voucher-empty .material-icons { font-size: 36px; color: #cbd5e1; display: block; margin-bottom: 6px; }

.dash-pay-detail-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}
.dash-pay-detail-footer .dash-pay-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-right: auto;
}

/* Payment detail modal tabs */
.dash-pay-detail-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 16px 0 0;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}
.dash-pay-detail-tab {
    flex: 1 1 auto;
    min-width: 120px;
    padding: 9px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-family: Sarabun, sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.dash-pay-detail-tab:hover {
    background: #e2e8f0;
    color: #334155;
}
.dash-pay-detail-tab.active {
    background: linear-gradient(135deg, #0d9488, #047857);
    color: #fff;
    box-shadow: 0 2px 8px rgba(4, 120, 87, 0.25);
}
.dash-pay-detail-tabpanels {
    margin-top: 12px;
}
.dash-pay-tab-panel {
    display: none;
}
.dash-pay-tab-panel.active {
    display: block;
}
.dash-pay-tab-empty {
    text-align: center;
    padding: 28px 16px;
    color: #94a3b8;
    font-size: 13px;
}
.dash-pay-tab-empty .material-icons {
    font-size: 36px;
    color: #cbd5e1;
    display: block;
    margin: 0 auto 6px;
}
.dash-pay-tab-loading {
    text-align: center;
    padding: 28px 16px;
    color: #64748b;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.dash-po-detail-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    font-family: Sarabun, sans-serif;
}
.dash-po-detail-link:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

@media (max-width: 600px) {
    .dash-pay-detail-tab {
        min-width: calc(50% - 6px);
        font-size: 12px;
        padding: 10px 8px;
    }
}

/* ===== Dashboard — PR Odoo tab ===== */
.recent-ft-odoo.active {
    background: #ede9fe !important;
    color: #5b21b6 !important;
    border-color: #c4b5fd !important;
}
.recent-ft-odoo .recent-fcnt {
    background: #7c3aed;
}

/* ===== Dashboard — ยืนยันจ่าย tab badge ===== */
.recent-ft-pay .pay-tab-badge,
.recent-ft-pending .pending-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    opacity: 1;
    box-shadow: 0 0 0 2px #fff;
}
.recent-ft-pay.active .pay-tab-badge,
.recent-ft-pending.active .pending-tab-badge {
    box-shadow: 0 0 0 2px var(--bt-green, #2E8B57);
}
.odoo-dash-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    padding: 0.75rem 1rem;
    background: #f5f3ff;
    border-bottom: 1px solid #ede9fe;
    margin-bottom: 0;
}
.odoo-dash-stat {
    font-size: 0.8rem;
    color: #5b21b6;
}
.odoo-dash-stat strong {
    font-size: 1.05rem;
    font-weight: 800;
    color: #4c1d95;
    margin-right: 4px;
}
.odoo-dash-table thead th {
    background: #ede9fe;
    color: #4c1d95;
}
.odoo-dash-row {
    cursor: pointer;
    border-left: 3px solid #7c3aed;
}
.odoo-dash-row:hover td {
    background: #f5f3ff !important;
}
.odoo-dash-prid {
    font-weight: 800;
    color: #5b21b6;
}
.odoo-dash-dept {
    background: #ede9fe;
    color: #5b21b6;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 600;
}
.odoo-dash-badge {
    display: inline-block;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.odoo-dash-badge-default { background: #f5f3ff; color: #5b21b6; }
.odoo-dash-badge-converted { background: #ede9fe; color: #5b21b6; }
.odoo-dash-badge-deleted { background: #fee2e2; color: #991b1b; }
.odoo-dash-badge-returned { background: #fce7f3; color: #9d174d; }
.odoo-dash-convert {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    font-family: Sarabun, sans-serif;
}
.odoo-dash-convert .material-icons { font-size: 15px; }
.odoo-dash-convert:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
}
.odoo-dash-card {
    border-left: 4px solid #7c3aed;
}
.odoo-dash-footnote {
    margin: 0;
    padding: 0.65rem 1rem;
    font-size: 0.75rem;
    color: #7c3aed;
    text-align: right;
    background: #faf9ff;
    border-top: 1px solid #ede9fe;
}

@media (max-width: 768px) {
    .zone-recent-table-wrap { display: none; }
    .recent-cards { display: block; }
    .recent-action-col { display: none; }
}
