/* 1. IMPORTS & VARIABLES */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --border: #e5e7eb;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #1e40af;
    --secondary: #64748b;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 8px;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);


    /* Login Specific */
    --login-primary: #1e3a8a;
    --login-secondary: #3b82f6;
    --login-accent: #fbbf24;
    --login-text: #0f172a;
}

/* 2. BASE STYLES */
* {
    box-sizing: border-box;
    font-family: 'Prompt', sans-serif;
}

.fas,
.far,
.fab,
.fa,
.fa-solid,
.fa-regular,
.fa-brands,
[class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}

html {
    height: 100%;
    margin: 0;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    overflow-y: auto;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: 0.2s;
}

a:hover {
    text-decoration: none;
    opacity: 0.8;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 24px 32px;
}

/* Typography */
.page-title {
    font-size: 26px;
    margin: 0 0 6px;
    font-weight: 700;
}

.page-subtitle {
    margin: 0 0 16px;
    color: var(--muted);
}

.section-title {
    font-size: 18px;
    margin: 0 0 10px;
    font-weight: 600;
}

.card-title {
    font-size: 18px;
    margin: 0;
    font-weight: 600;
}

/* 3. GLOBAL COMPONENTS */

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-narrow {
    max-width: 560px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    border-color: var(--border);
    background: #fff;
    color: var(--text) !important;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-warning {
    background: #3b82f6;
    border-color: #2563eb;
    color: #ffffff !important;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* Tables */
.table-wrap {
    overflow: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

.table th,
.table td {
    border: 1px solid var(--border);
    padding: 12px;
    text-align: left;
    vertical-align: middle;
}

.table th {
    background: #f9fafb;
    font-weight: 700;
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tr:hover td {
    background-color: #f8fafc;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Badges & Status */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #f9fafb;
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
}

.status-danger {
    color: var(--danger);
}

.status-success {
    color: var(--success);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

nav[role="navigation"] a,
nav[role="navigation"] span {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
}

nav[role="navigation"] a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

nav[role="navigation"] span[aria-current="page"] {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(30, 64, 175, 0.05);
}

/* 4. LAYOUTS */

/* Admin Layout (Original Left Sidebar) */
body.admin-layout {
    background-color: #f9fafb !important;
    display: flex !important;
    flex-direction: row !important;
    height: 100vh !important;
    overflow: hidden !important;
}

.sidebar {
    width: 270px;
    background-color: #1e293b;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid #1e293b;
}

.sidebar-header {
    padding: 24px 20px;
    font-size: 1.25rem;
    font-weight: 800;
    background-color: #0f172a;
    text-align: left;
    border-bottom: none;
    color: #ffffff;
    letter-spacing: 0px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.sidebar .nav-item {
    margin: 2px 0;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 1px 0;
}

.sidebar .nav-link:hover {
    background-color: #334155;
    color: #ffffff;
}

.sidebar .nav-link.active {
    background-color: #0f172a;
    color: #ffffff;
}

.submenu {
    display: none;
    padding: 2px 0;
    background-color: #0f172a;
}

.submenu.open {
    display: block;
}

.submenu .nav-link {
    margin: 1px 0 !important;
    padding: 8px 12px 8px 36px !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: #94a3b8 !important;
}

.submenu .nav-link:hover {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

.submenu .nav-link.active {
    background-color: #1e293b !important;
    color: #10b981 !important;
    font-weight: 600 !important;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #f9fafb;
}

.topbar {
    background-color: #fff;
    padding: 6px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.content {
    padding: 32px;
}

/* Custom Scrollbar for Admin */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Province Layout (New Top Nav) */
body.province-layout {
    background-color: #f8fafc !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important;
}

.province-nav {
    width: 100%;
    height: auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow-x: auto;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.05);
    z-index: 20;
    padding: 0 20px;
}

.province-nav-header {
    padding: 16px 24px;
    font-size: 1.25rem;
    font-weight: 800;
    background-color: transparent;
    text-align: center;
    border-right: 1px solid rgba(226, 232, 240, 0.8);
    letter-spacing: 1px;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-right: 15px;
}

.province-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 18px 20px;
    color: #64748b;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    font-size: 0.95rem;
    white-space: nowrap;
}

.province-nav .nav-link i {
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

.province-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    transition: width 0.3s ease;
}

.province-nav .nav-link:hover {
    color: var(--primary);
    background: transparent;
}

.province-nav .nav-link:hover i {
    transform: scale(1.1);
}

.province-nav .nav-link:hover::after {
    width: 30%;
}

.province-nav .nav-link.active {
    color: var(--primary);
    background: transparent;
}

.province-nav .nav-link.active::after {
    width: 100%;
}

.province-nav>div[style*="padding: 15px"] {
    display: none !important;
}

.province-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #f8fafc;
}

.province-content-inner {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* 5. PAGE SPECIFIC STYLES */

/* Login Page */
body.login-page {
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
}

.login-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.hero-side {
    flex: 1.2;
    background: linear-gradient(rgba(30, 58, 138, 0.8), rgba(30, 58, 138, 0.6)),
        url('https://images.unsplash.com/photo-1500382017468-9049fee74a62?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px;
    color: white;
    position: relative;
}

.hero-side::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent, rgba(0, 0, 0, 0.3));
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
}

.hero-logo {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-logo i {
    color: var(--login-accent);
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
}

.hero-title {
    font-size: 48px;
    line-height: 1.2;
    margin-bottom: 24px;
    font-weight: 700;
}

.hero-desc {
    font-size: 18px;
    opacity: 0.9;
    line-height: 1.6;
    font-weight: 300;
}

.form-side {
    flex: 0.8;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    position: relative;
}

.login-box {
    width: 100%;
    max-width: 400px;
}

.form-header {
    margin-bottom: 40px;
    text-align: center;
}

.form-header h2 {
    font-size: 32px;
    color: var(--login-text);
    margin: 0 0 10px 0;
    font-weight: 700;
}

.form-header p {
    color: #64748b;
    margin: 0;
    font-size: 16px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 20px;
}

.login-page .form-control {
    width: 100%;
    padding: 16px 16px 16px 54px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: 0.3s;
    box-sizing: border-box;
    font-family: inherit;
}

.login-page .form-control:focus {
    outline: none;
    border-color: var(--login-secondary);
    background: #f8fafc;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--login-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-submit:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(30, 58, 138, 0.2);
}

/* Province Selection */
body.province-select-page {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 60px 20px !important;
}

body.province-select-page .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
}

.province-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.card-base {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(30, 58, 138, 0.15);
    padding: 12px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    height: 55px;
}

.card-base:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    background: white;
}

.admin-card {
    background: #1e3a8a;
    color: white !important;
    border-color: #1e3a8a;
}

.admin-card i {
    color: #fbbf24;
    font-size: 20px;
}

.admin-card:hover {
    background: #1e40af;
}

.province-card {
    color: #1e3a8a !important;
}

.province-card i {
    font-size: 20px;
    color: #3b82f6;
}

.province-card:hover {
    border-color: #3b82f6;
    color: #3b82f6 !important;
}

/* Dashboard Specs */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.dashboard-title-area {
    flex: 0 0 300px;
}

.dashboard-kpi-row {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.chart-row-maps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.chart-row-top {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.chart-row-bottom {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.filter-section {
    flex: 0 0 150px;
    text-align: center;
}

.year-selector {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #fff;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
}

.year-btn {
    padding: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    text-decoration: none;
    border-radius: 4px;
    transition: 0.3s;
}

.year-btn:hover {
    background: #f1f5f9;
}

.year-btn.active {
    background: var(--accent);
    color: white;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

.kpi-compact {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: var(--shadow);
}

.kpi-compact .kpi-label {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    padding: 6px;
    border-radius: 6px 6px 0 0;
    margin: -15px -15px 12px -15px;
    text-transform: uppercase;
}

.kpi-compact .kpi-val {
    font-size: 24px;
    font-weight: 800;
    color: #1e3a8a;
}

.kpi-blue .kpi-label {
    background: #1e40af;
}

.kpi-teal .kpi-label {
    background: #0d9488;
}

.kpi-indigo .kpi-label {
    background: #4f46e5;
}

.kpi-slate .kpi-label {
    background: #334155;
}

.chart-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.chart-title {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 12px;
}

/* Map Elements */
#realMap,
#serviceMap {
    height: 550px;
    width: 100%;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    box-shadow: var(--shadow);
}

.stat-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

.stat-label-val {
    font-size: 12px;
    font-weight: 800;
    color: #1e293b;
    text-shadow: -1.5px -1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px 1.5px 0 #fff;
    line-height: 1;
}

.stat-label-name {
    font-size: 9px;
    font-weight: 700;
    color: #4b5563;
    margin-top: 2px;
}

/* 6. UTILITIES & RESPONSIVE */
.flex {
    display: flex;
    gap: 12px;
    align-items: center;
}

.flex-between {
    justify-content: space-between;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* 7. GLOBAL SHARP CORNERS OVERRIDE */
/* * {
    border-radius: 20px !important;
} */

.panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    box-shadow: none !important;
}

.panel-hd {
    padding: 12px 15px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.panel-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-body {
    padding: 15px;
}

.search-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    padding: 12px;
    font-size: 0.9rem;
    outline: none;
    background: #f8fafc;
    color: #475569;
    transition: all 0.2s;
}

.search-input:focus {
    border-color: #1e3a8a;
    background: #fff;
}

.bo-btn-primary, .search-btn {
    background: #15803d !important;
    color: #fff !important;
    border: none !important;
    font-weight: 700 !important;
}

/* 10. PREMIUM CARD UI (NEW DESIGN) */
.hppr-card-premium {
    background: #fff;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none !important;
    color: inherit;
    border-radius: 10px;
}

.hppr-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.hppr-card-header {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #15803d; /* Default green gradient placeholder */
    border-top-right-radius: 10px;
    border-top-left-radius: 10px;
}

.hppr-card-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hppr-header-badge-left {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
}

.hppr-header-badge-right {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #15803d;
    color: #fff;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}

.hppr-card-body-premium {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hppr-org-line {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #15803d;
    font-size: 0.8rem;
    font-weight: 600;
}

.hppr-title-line {
    font-size: 1rem;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.hppr-date-line {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 0.8rem;
}

.hppr-desc-line {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 5px;
}

.hppr-card-footer-premium {
    padding: 12px 15px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hppr-status-badge {
    background: #f0fdf4;
    color: #15803d;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #dcfce7;
    border-radius: 5px;
}

.hppr-details-link {
    color: #15803d;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hppr-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

@media (max-width: 1200px) {
    .hppr-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .hppr-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hppr-grid-5 {
        grid-template-columns: 1fr;
    }
}

/* 8. UPLOAD PROGRESS BAR */
.upload-progress-container {
    display: none;
    margin-top: 15px;
    background: #f1f5f9;
    height: 12px;
    position: relative;
    overflow: hidden;
}

.upload-progress-bar {
    width: 0%;
    height: 100%;
    background: #15803d;
    transition: width 0.3s ease;
}

.upload-progress-text {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 5px;
    text-align: right;
}






/* 6. PREMIUM DASHBOARD STYLES */
:root {
    --p-primary: #3b82f6;
    --p-primary-light: #eff6ff;
    --p-secondary: #1e3a8a;
    --p-accent: #10b981;
    --p-bg: #f8fafc;
    --p-text: #1e293b;
}

/* ═══════════════════════════════════════════════════════
   DASHBOARD PAGE WRAPPERS
   Compensates for the fixed 90px top navbar on all
   upstream / midstream / downstream dashboard pages.
═══════════════════════════════════════════════════════ */

body {
    overflow-x: hidden;
}

.up-wrap,
.mid-wrap,
.ds-wrap {
    padding-top: 100px;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════
   DASHBOARD SHARED COMPONENT STYLES
   Defines all classes used across up/mid/ds dashboards
═══════════════════════════════════════════════════════ */

/* ── Stats Strip ── */
.ds-stats-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ds-stat-item {
    flex: 1 1 160px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    min-width: 130px;
    box-sizing: border-box;
}

.ds-stat-icon {
    font-size: 1.5rem;
    color: #3b82f6;
    margin-bottom: 4px;
}

.ds-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ds-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1e3a8a;
    line-height: 1.1;
}

.ds-stat-sub {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 500;
}

/* ── Chart Cards ── */
.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    box-sizing: border-box;
}

.card-hd {
    padding: 16px 20px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.card-ttl {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 16px 20px;
}

/* ── Horizontal bar table inside cards ── */
.hosp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.hosp-table th {
    text-align: left;
    padding: 8px 10px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    border-bottom: 2px solid #f1f5f9;
}

.hosp-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f8fafc;
}

.h-no {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 700;
    width: 24px;
}

.h-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.8rem;
}

.h-spend {
    font-weight: 700;
    color: #059669;
    white-space: nowrap;
    text-align: right;
}

.h-bar-wrap {
    background: #f1f5f9;
    height: 5px;
    border-radius: 2px;
    margin-top: 4px;
}

.h-bar-fill {
    background: #3b82f6;
    height: 100%;
    border-radius: 2px;
}

/* ── Filter row ── */
.frow {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.fg {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fg label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fg input,
.fg select {
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.2s;
}

.fg input:focus,
.fg select:focus {
    border-color: #3b82f6;
}

.btn-f {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-f:hover {
    background: #2563eb;
}

.btn-cl {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 0.2s;
}

.btn-cl:hover {
    background: #e2e8f0;
}

/* ── Data wrap (scrollable table container) ── */
.d-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.dt {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    font-size: 0.85rem;
}

.dt th {
    background: #f8fafc;
    padding: 10px 14px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.dt td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.dt tr:hover td {
    background: #f8fafc;
}

/* Badge styles for d-wrap */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
}

.b-local {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.b-gen {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fef08a;
}


/* ═══════════════════════════════════════════════════════
   HAMBURGER + OVERLAY NAVIGATION
═══════════════════════════════════════════════════════ */

.top-nav-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 90px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 48px;
    gap: 0;
}

/* ── Logo ── */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    height: 100%;
    transition: opacity 0.2s;
    background: transparent;
}

.nav-logo:hover {
    opacity: 0.85;
}

/* ── Center Inline Nav Pills (desktop) ── */
.inline-pill-bar {
    position: static;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0;
}

.inline-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    height: 72px;
    min-width: 82px;
    font-size: 0.72rem;
    font-weight: 500;
    font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif;
    color: #475569 !important;
    text-decoration: none !important;
    white-space: nowrap;
    border-radius: 8px;
    background: #f1f5f9;
    box-sizing: border-box;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.inline-pill i {
    font-size: 1.1rem;
    color: #475569;
    opacity: 0.9;
    transition: transform 0.2s ease;
}

.inline-pill:hover:not(.active) {
    background: #e2e8f0;
    color: #1e293b !important;
}

.inline-pill:hover:not(.active) i {
    color: #1e293b;
    transform: translateY(-2px);
}

/* Active style (White button with Neutral accent) */
.inline-pill.active {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.inline-pill.active i {
    color: #15803d !important;
    opacity: 1 !important;
}

/* Hide inline pills on smaller screens — hamburger only */


/* Compact pills on intermediate desktop sizes to prevent overlapping */


.logo-img {
    height: 72px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Hamburger Button ── */
.hamburger-menu {
    z-index: 2100;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    padding: 8px;
    border-radius: 10px;
    transition: background 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.hamburger-menu:hover {
    background: rgba(6, 95, 70, 0.07);
}

.menu-bar1,
.menu-bar2,
.menu-bar3 {
    width: 28px;
    height: 2.5px;
    background-color: #1e293b;
    margin: 4px 0;
    border-radius: 4px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-bar2 {
    /* width: 18px; */
    margin-left: 0;
}

.hamburger-menu.active .menu-bar1 {
    transform: rotate(-45deg) translate(-6px, 7px);
}

.hamburger-menu.active .menu-bar2 {
    opacity: 0;
    transform: translateX(10px);
}

.hamburger-menu.active .menu-bar3 {
    transform: rotate(45deg) translate(-5px, -7px);
}

/* ── Full-Screen Overlay ── */
.nav-overlay {
    position: fixed;
    top: 90px;
    left: 0;
    width: 100%;
    height: calc(100vh - 90px);
    height: calc(100svh - 90px);
    z-index: 1999;
    display: flex;
    flex-direction: column;
}

.overlay-slide-right {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
    pointer-events: all;
}

.overlay-slide-left {
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-100%);
    pointer-events: none;
}

/* ── Nav Items List ── */
.overlay-nav {
    flex: 1;
    overflow: hidden;
}

.overlay-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.overlay-nav ul li {
    flex: 1;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

/* Colour steps: deep forest → emerald */
.overlay-nav li:nth-of-type(1) {
    background-color: #022c22;
}

.overlay-nav li:nth-of-type(2) {
    background-color: #064e3b;
}

.overlay-nav li:nth-of-type(3) {
    background-color: #065f46;
}

.overlay-nav li:nth-of-type(4) {
    background-color: #047857;
}

.overlay-nav li:nth-of-type(5) {
    background-color: #059669;
}

.overlay-nav li:nth-of-type(6) {
    background-color: #0d9488;
}

.overlay-nav li:nth-of-type(7) {
    background-color: #0f766e;
}

.overlay-nav li:nth-of-type(8) {
    background-color: #115e59;
}

.overlay-nav li:nth-of-type(9) {
    background-color: #134e4a;
}

.overlay-nav ul li a {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding: 0 48px;
    text-decoration: none !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-family: 'IBM Plex Sans Thai', 'Prompt', sans-serif;
    letter-spacing: 0.04em;
    transition: all 0.25s ease;
    border-left: 4px solid transparent;
}

.overlay-nav ul li a i {
    font-size: 1.5rem;
    width: 36px;
    text-align: center;
    opacity: 0.85;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.overlay-nav ul li a span {
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.overlay-nav ul li a small {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.6;
    letter-spacing: 0.05em;
    margin-left: 4px;
    text-transform: none;
    white-space: nowrap;
}

.overlay-nav ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    border-left-color: rgba(255, 255, 255, 0.6);
    padding-left: 60px;
}

.overlay-nav ul li a:hover i {
    transform: scale(1.2) translateX(4px);
    opacity: 1;
}

/* ── Auth bar at overlay bottom ── */
.overlay-auth-bar {
    background: #022c22;
    /* Solid color, no transparency to prevent map leaking */
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 48px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.overlay-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #ffffff !important;
    text-decoration: none !important;
    background: #e67e22;
    /* Brand Orange */
    border: 1px solid #e67e22;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'IBM Plex Sans Thai', 'Prompt', sans-serif;
}

.overlay-auth-btn:hover {
    background: #d35400;
    border-color: #d35400;
    color: #ffffff !important;
}


.overlay-logout-btn {
    color: rgba(252, 165, 165, 0.9) !important;
    border-color: rgba(239, 68, 68, 0.25);
}

.overlay-logout-btn:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

/* ── Slide-in Animations (open) ── */
.slide-in-1 {
    animation: nav-slide-in 0.4s ease 0.1s both;
}

.slide-in-2 {
    animation: nav-slide-in 0.4s ease 0.18s both;
}

.slide-in-3 {
    animation: nav-slide-in 0.4s ease 0.26s both;
}

.slide-in-4 {
    animation: nav-slide-in 0.4s ease 0.34s both;
}

.slide-in-5 {
    animation: nav-slide-in 0.4s ease 0.42s both;
}

.slide-in-6 {
    animation: nav-slide-in 0.4s ease 0.50s both;
}

.slide-in-7 {
    animation: nav-slide-in 0.4s ease 0.58s both;
}

.slide-in-8 {
    animation: nav-slide-in 0.4s ease 0.66s both;
}

.slide-in-9 {
    animation: nav-slide-in 0.4s ease 0.74s both;
}

@keyframes nav-slide-in {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ── Slide-out Animations (close) ── */
.slide-out-1 {
    animation: nav-slide-out 0.3s ease 0.35s both;
}

.slide-out-2 {
    animation: nav-slide-out 0.3s ease 0.28s both;
}

.slide-out-3 {
    animation: nav-slide-out 0.3s ease 0.21s both;
}

.slide-out-4 {
    animation: nav-slide-out 0.3s ease 0.14s both;
}

.slide-out-5 {
    animation: nav-slide-out 0.3s ease 0.07s both;
}

.slide-out-6 {
    animation: nav-slide-out 0.3s ease 0.03s both;
}

.slide-out-7 {
    animation: nav-slide-out 0.3s ease 0.01s both;
}

.slide-out-8 {
    animation: nav-slide-out 0.3s ease 0.00s both;
}

.slide-out-9 {
    animation: nav-slide-out 0.3s ease 0.00s both;
}

@keyframes nav-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* ── Responsive adjustments ── */



/* Dashboard Layout */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.p-page-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.p-page-title h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--p-secondary);
    margin: 0;
}

/* Stats Cards */
.p-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}





.p-stat-card {
    background: white;
    padding: 25px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    gap: 20px;
}

.p-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.p-stat-info h3 {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.p-stat-info .value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--p-secondary);
}

/* Main Grid & Cards */
.p-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}



.p-content-card {
    background: white;
    padding: 30px;
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.p-card-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--p-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

/* Filter Bar */
.p-filter-bar {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.p-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.p-filter-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    padding-left: 5px;
}

.p-filter-group select,
.p-filter-group input {
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    min-width: 150px;
}

.p-btn-filter {
    background: var(--p-primary);
    color: white;
    border: none;
    padding: 11px 25px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.p-btn-filter:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Tables */
.p-table-responsive {
    overflow-x: auto;
}

.p-table {
    width: 100%;
    border-collapse: collapse;
}

.p-table th {
    text-align: left;
    padding: 15px;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 700;
    border-bottom: 2px solid #f1f5f9;
}

.p-table td {
    padding: 15px;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.p-table tr:hover {
    background: #f8fafc;
}

.p-badge {
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
}

.p-badge-success {
    background: #dcfce7;
    color: #166534;
}

.p-badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

.p-badge-danger {
    background: #fee2e2;
    color: #ef4444;
}

/* Map Page Specifics */
.p-map-controls {
    position: absolute;
    top: 100px;
    left: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.p-map-btn {
    background: white;
    border: 1px solid #cbd5e1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    color: #334155;
    box-arc: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    border-radius: 8px;
}

.p-map-key {
    position: absolute;
    top: 100px;
    right: 20px;
    z-index: 1000;
}

.p-key-toggle {
    background: white;
    border: 1px solid #cbd5e1;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}

.p-legend-panel {
    position: absolute;
    top: 65px;
    right: 0;
    background: white;
    border: 1px solid #cbd5e1;
    padding: 15px;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 220px;
    display: none;
    border-radius: 16px;
}

/* Premium Login Styles */
.p-login-body {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    overflow: hidden;
}

.p-login-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    z-index: 0;
}

.p-login-card {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(30px);
    padding: 50px;
    border-radius: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: pFadeInScale 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes pFadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.p-login-header {
    text-align: center;
    margin-bottom: 40px;
}

.p-login-logo {
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: var(--p-primary);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2);
}

.p-input-pill-wrapper {
    position: relative;
}

.p-input-pill-wrapper i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
}

.p-form-control-pill {
    width: 100%;
    padding: 15px 15px 15px 55px;
    border-radius: 100px;
    border: 2px solid rgba(226, 232, 240, 0.8);
    background: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-family: inherit;
    transition: 0.3s;
    box-sizing: border-box;
}

.p-form-control-pill:focus {
    outline: none;
    border-color: var(--p-primary);
    background: white;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.1);
}

.p-btn-login-pill {
    width: 100%;
    padding: 16px;
    background: var(--p-primary);
    color: white;
    border: none;
    border-radius: 100px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.3);
    margin-top: 10px;
}

.p-btn-login-pill:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.4);
    background: var(--p-secondary);
}

.p-back-home {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 100;
}

/* 7. PREMIUM BACK-OFFICE SYSTEM STYLES */
.bo-header-card {
    background: #ffffff;
    border-radius: 0 !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    padding: 24px 30px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.bo-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bo-title-group h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bo-title-group p {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

.bo-filter-card {
    background: #ffffff;
    border-radius: 0 !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    padding: 20px 24px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
}

.bo-filter-grid {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.bo-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 200px;
}

.bo-input-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bo-input-group input,
.bo-input-group select,
.bo-input-group textarea {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #1e293b;
    border-radius: 0 !important;
    padding: 10px 14px;
    font-size: 0.9rem;
    transition: all 0.2s ease-in-out;
    width: 100%;
    outline: none;
}

.bo-input-group input:focus,
.bo-input-group select:focus,
.bo-input-group textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: #f8fafc;
}

.bo-table-card {
    background: #ffffff;
    border-radius: 0 !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    padding: 0 !important;
    margin-bottom: 24px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02) !important;
    overflow: hidden;
}

.bo-table {
    width: 100%;
    border-collapse: collapse !important;
}

.bo-table th {
    background: #f8fafc !important;
    font-weight: 700 !important;
    color: #475569 !important;
    font-size: 0.78rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 16px 20px !important;
    border-bottom: 2px solid #cbd5e1 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    text-align: left !important;
}

.bo-table td {
    padding: 16px 20px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    font-size: 0.88rem !important;
    color: #334155 !important;
    vertical-align: middle !important;
}

.bo-table tr:last-child td {
    border-bottom: none !important;
}

.bo-table tr:hover td {
    background-color: rgba(21, 128, 61, 0.015) !important;
}

.bo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 0 !important;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: none;
    text-decoration: none;
    box-sizing: border-box;
}

/* Default & Admin Layout Buttons (Green Theme) */
.bo-btn-primary {
    background: #15803d;
    color: #ffffff !important;
}

.bo-btn-primary:hover {
    background: #166534;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.2);
}

/* Province Layout Buttons (Blue Theme) */
.province-layout .bo-btn-primary {
    background: #2563eb;
    color: #ffffff !important;
}

.province-layout .bo-btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.bo-btn-secondary {
    background: #e2e8f0;
    color: #475569 !important;
}

.bo-btn-secondary:hover {
    background: #cbd5e1;
    transform: translateY(-1px);
}

.bo-btn-danger {
    background: #fee2e2;
    color: #ef4444 !important;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.bo-btn-danger:hover {
    background: #fca5a5;
}

.bo-btn-warning {
    background: #eaf7ec;
    color: #15803d !important;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.bo-btn-warning:hover {
    background: #dcfce7;
}

.bo-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 0 !important;
    font-size: 0.75rem;
    font-weight: 700;
}

.bo-badge-success {
    background: #dcfce7;
    color: #166534;
}

.bo-badge-neutral {
    background: #f1f5f9;
    color: #475569;
}

/* Hide duplicate redundant titles in province back-office pages */
.province-content-inner .page-title {
    display: none !important;
}


/* ═══════════════════════════════════════════════════════════════
   PAGE: home  (provinces/home.blade.php)
═══════════════════════════════════════════════════════════════ */
/* base reset handled by global CSS */

/* ─── Page Layout ─── */
.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 110px;
    /* Sits flush against the 85px top nav bar */
    min-height: 100vh;
    width: 100%;
}

/* ─── Shared width container ─── */
.content-wrap {
    width: 95%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* ─── Category Tab Grid ─── */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 16px auto;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    color: #2d3748;
    transition: opacity 0.2s, transform 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    min-height: 165px;
}

.cat-item:hover {
    opacity: 0.85;
    transform: translateY(-3px);
}

/* Themed colors representing each category segment beautifully */
.cat-item:nth-child(1) {
    background: #e8f5e9;
    color: #1b5e20;
}

/* Upstream - Green */
.cat-item:nth-child(2) {
    background: #e1f5fe;
    color: #01579b;
}

/* Crops - Blue */
.cat-item:nth-child(3) {
    background: #fff3e0;
    color: #e65100;
}

/* Midstream - Orange */
.cat-item:nth-child(4) {
    background: #e0f2f1;
    color: #004d40;
}

/* Join - Teal */
.cat-item:nth-child(5) {
    background: #fce4ec;
    color: #880e4f;
}

/* Downstream - Rose/Pink */
.cat-item:nth-child(6) {
    background: #f3e5f5;
    color: #4a148c;
}

/* Health Data - Purple */

.cat-item .cat-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
    opacity: 0.85;
}

.cat-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    opacity: 0.8;
}

.cat-value {
    font-size: 1.45rem;
    font-weight: 800;
    margin: 6px 0;
    letter-spacing: -0.5px;
}

.cat-sub {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.75;
}

/* ─── Map Container ─── */
.map-section {
    width: 100%;
    /* overflow hidden clips the rotated map edges cleanly */
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

/* Remove default browser focus outline on interactive map paths */
path:focus,
path:active,
.leaflet-interactive:focus,
.leaflet-interactive:active,
.leaflet-container:focus,
.leaflet-container:active {
    outline: none !important;
    box-shadow: none !important;
}

.map-wrapper {
    position: relative;
    width: 100%;
    transform: translate(-10px, 0) rotate(18deg) scale(0.85);
    transform-origin: center center;
    margin-top: -280px;
    /* Shift up further */
    --map-rotation: 18deg;
    --map-scale: 0.85;
}

/* The actual Leaflet map div */
#homeMap {
    width: 100%;
    height: 1100px;
    background: transparent;
}

/* Hide default leaflet chrome for clean look */
.leaflet-container {
    background: transparent !important;
}

.leaflet-control-attribution,
.leaflet-control-zoom {
    display: none !important;
}

/* Premium Map Tooltip Container (Set transparent to use our upright glassmorphic card inside) */
.custom-map-tooltip {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    pointer-events: none !important;
}

/* Hide default leaflet tooltip tail */
.custom-map-tooltip::before {
    display: none !important;
}

/* Beautiful Upright Floating Glassmorphic Card */
.map-tooltip-content {
    background: rgba(15, 23, 42, 0.95) !important;
    /* Dark Slate background */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
    font-family: 'IBM Plex Sans Thai', sans-serif !important;
    pointer-events: none !important;
    transform: rotate(calc(-1 * var(--map-rotation))) scale(calc(1 / var(--map-scale))) !important;
    /* Auto-cancels parent rotation and scale */
    transform-origin: center center;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.tooltip-district {
    font-size: 10px;
    font-weight: 500;
    color: #94a3b8;
    /* Light slate gray */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tooltip-tambon {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    /* Crisp white */
}


/* ═══════════════════════════════════════════════════════════════
   PAGE: upstream  (provinces/dashboard/upstream.blade.php)
═══════════════════════════════════════════════════════════════ */
.up-wrap {
    max-width: 1650px;
    margin: 0 auto;
    padding: 130px 24px 48px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Premium executive stats grid similar to downstream/midstream page */
.ds-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    width: 100%;
    max-width: 820px;
    margin: 0 auto 0 auto !important;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #cbd5e1;
    border-radius: 0 !important;
}

.ds-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Align all items starting from the top */
    padding: 12px 6px;
    text-align: center;
    border-radius: 0;
    box-shadow: none;
    border: none;
    transition: all 0.2s ease;
    min-height: 125px;
    /* Extremely compact vertical room */
}

.ds-stat-item:hover {
    opacity: 0.88;
}

.ds-stat-item:nth-child(1) {
    background: #e8f5e9;
    color: #1b5e20;
}

/* Mint Green */
.ds-stat-item:nth-child(2) {
    background: #fff3e0;
    color: #e65100;
}

/* Warm Orange */
.ds-stat-item:nth-child(3) {
    background: #e3f2fd;
    color: #0d47a1;
}

/* Ice Blue */
.ds-stat-item:nth-child(4) {
    background: #f3e5f5;
    color: #4a148c;
}

/* Lavender Purple */
.ds-stat-item:nth-child(5) {
    background: #fce4ec;
    color: #880e4f;
}

/* Pink Red */

.ds-stat-icon {
    font-size: 1.2rem;
    opacity: 0.9;
    height: 24px;
    /* Rigid identical height ensures all titles align perfectly */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.ds-stat-label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.85;
    height: 16px;
    /* Rigid height ensures all main values align perfectly */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.ds-stat-value {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.3px;
    height: 26px;
    /* Rigid height ensures all subtexts align perfectly */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.ds-stat-sub {
    font-size: 0.65rem;
    font-weight: 500;
    opacity: 0.75;
    line-height: 1.1;
}

/* ── Crop Tiles Row ── */
.crop-row {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 8px;
}

.crop-tile {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0 !important;
    padding: 12px 10px;
    text-align: center;
    transition: .2s;
}

.crop-tile:hover {
    background: #f8fafc;
    border-color: #3b82f6;
}

.crop-name {
    font-size: .7rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crop-qty {
    font-size: 1.1rem;
    font-weight: 800;
    color: #2563eb;
}

.crop-unit {
    font-size: .6rem;
    color: #64748b;
    margin-top: 2px;
}

.crop-bar {
    height: 6px;
    border-radius: 0 !important;
    margin-top: 8px;
}

/* ── Bottom Grid ── */
.bottom-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 14px;
    align-items: start;
}

.panel {
    background: white;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    overflow: hidden;
}

.panel-hd {
    padding: 12px 16px;
    border-bottom: 1px solid #cbd5e1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    font-size: .85rem;
    font-weight: 700;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 7px;
}

.panel-body {
    padding: 14px 16px;
}

/* Filter Row */
.frow {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 12px;
}

.fg {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.fg label {
    font-size: .63rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.fg input,
.fg select {
    background: white;
    border: 1.5px solid #cbd5e1;
    color: #334155;
    border-radius: 0 !important;
    padding: 5px 9px;
    font-size: .78rem;
    font-family: inherit;
    height: 30px;
}

.fg input:focus,
.fg select:focus {
    outline: none;
    border-color: #3b82f6;
}

.fg select option {
    background: white;
    color: #334155;
}

.btn-f {
    height: 30px;
    padding: 0 12px;
    background: #475569;
    color: white;
    border: none;
    border-radius: 0 !important;
    font-size: .75rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.btn-cl {
    height: 30px;
    padding: 0 10px;
    background: #e2e8f0;
    color: #475569;
    border: none;
    border-radius: 0 !important;
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
}

/* Dense Table */
.dt {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}

.dt th {
    padding: 8px 10px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    font-size: .63rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid #cbd5e1;
    white-space: nowrap;
}

.dt td {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    color: #1e293b;
}

.dt tr:hover td {
    background: #f8fafc;
}

.dt tr:last-child td {
    border-bottom: none;
}

.d-wrap {
    overflow-x: auto;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 0 !important;
    font-size: .63rem;
    font-weight: 700;
}

.b-gap {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.b-org {
    background: #e0f2f1;
    color: #004d40;
    border: 1px solid #bbf7d0;
}

.b-gen {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* Right: GAP donut */
.gap-label {
    font-size: .68rem;
    color: #64748b;
    text-align: center;
    margin-top: 4px;
}


/* ═══════════════════════════════════════════════════════════════
   PAGE: midstream  (provinces/dashboard/midstream.blade.php)
═══════════════════════════════════════════════════════════════ */
.mid-wrap {
    max-width: 1650px;
    margin: 0 auto;
    padding: 130px 24px 48px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── midstream: override ds-stats-grid to 4 columns ── */
.mid-wrap .ds-stats-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    max-width: 1200px !important;
}

.mid-wrap .ds-stat-item:nth-child(1) {
    background: #e8f5e9;
    color: #1b5e20;
}

.mid-wrap .ds-stat-item:nth-child(2) {
    background: #fff3e0;
    color: #e65100;
}

.mid-wrap .ds-stat-item:nth-child(3) {
    background: #e3f2fd;
    color: #0d47a1;
}

.mid-wrap .ds-stat-item:nth-child(4) {
    background: #f3e8ff;
    color: #6b21a8;
}

/* ── Main layout: left full table, right panels ── */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 14px;
    align-items: start;
}

/* ── Left: Table Card ── */
.card {
    background: white;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: 1px solid #cbd5e1;
    overflow: hidden;
}

.card-hd {
    padding: 12px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-ttl {
    font-size: .85rem;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 7px;
}

.card-body {
    padding: 14px 18px;
}

.b-local {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* ── Right Panels ── */
.right-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* KPI stack — tourism style */
.kpi-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kpi-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* High-contrast solid MOPH rectangular blocks for KPIs */
.kpi-box {
    border-radius: 0 !important;
    padding: 16px;
    color: white !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100px;
    box-shadow: none !important;
    border: none !important;
    transition: transform 0.2s, filter 0.2s;
}

.kpi-box:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.kpi-box.k-blue {
    background: #4e79a7 !important;
}

.kpi-box.k-purple {
    background: #b07aa1 !important;
}

.kpi-box.k-green {
    background: #59a14f !important;
}

.kpi-box.k-orange {
    background: #f28e2b !important;
}

.kpi-lbl {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: 0.9;
}

.kpi-num {
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1;
    margin-top: 8px;
}

.kpi-sub {
    font-size: .65rem;
    opacity: 0.85;
    margin-top: 4px;
}

/* Hospital ranking — like tourism province table */
.hosp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}

.hosp-table thead tr {
    background: #f1f5f9;
}

.hosp-table th {
    padding: 8px 10px;
    color: #475569;
    font-weight: 700;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid #cbd5e1;
}

.hosp-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.hosp-table tr:hover td {
    background: #f8fafc;
}

.h-no {
    font-size: .7rem;
    font-weight: 700;
    color: #94a3b8;
    text-align: center;
}

.h-name {
    font-weight: 600;
    color: #1e293b;
}

.h-bar-wrap {
    height: 6px;
    background: #e2e8f0;
    border-radius: 0 !important;
    margin-top: 5px;
}

.h-bar-fill {
    height: 100%;
    border-radius: 0 !important;
    background: #59a14f;
}

.h-spend {
    font-weight: 700;
    color: #59a14f;
    text-align: right;
    white-space: nowrap;
}


/* ═══════════════════════════════════════════════════════════════
   PAGE: downstream  (provinces/dashboard/downstream.blade.php)
═══════════════════════════════════════════════════════════════ */
.ds-wrap {
    max-width: 1650px;
    margin: 0 auto;
    padding: 130px 24px 48px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── downstream: override ds-stats-grid to 3 columns ── */
.ds-wrap .ds-stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    max-width: 720px !important;
}

.ds-wrap .ds-stat-item:nth-child(1) {
    background: #e0f2fe;
    color: #0369a1;
}

.ds-wrap .ds-stat-item:nth-child(2) {
    background: #e0f8e9;
    color: #15803d;
}

.ds-wrap .ds-stat-item:nth-child(3) {
    background: #fef3c7;
    color: #b45309;
}

.banner {
    background: #ffffff;
    border-radius: 0 !important;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    margin: 0 0 14px 0 !important;
    max-width: 680px;
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.banner-ico {
    width: 48px;
    height: 48px;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #be123c;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.banner:hover .banner-ico {
    transform: scale(1.05) rotate(5deg);
    background: #e2e8f0;
    border-color: #94a3b8;
}

.banner-ico i {
    animation: heartBeat 1.5s infinite;
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.12);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.12);
    }

    70% {
        transform: scale(1);
    }
}

.banner-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.015em;
}

.banner-sub {
    font-size: 0.72rem;
    color: #475569;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.banner-sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 0 !important;
    border: 1px solid #e2e8f0;
    font-size: 0.68rem;
    color: #475569;
    font-weight: 600;
}

.banner-sub-pulse {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #22c55e;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        transform: scale(0.9);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(0.9);
        opacity: 0.6;
    }
}

.stat-chip {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 0 !important;
    padding: 10px 18px;
    text-align: center;
    min-width: 108px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.stat-chip:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.stat-chip-num {
    font-size: 1.4rem;
    font-weight: 855;
    color: #1e293b;
    line-height: 1;
}

.stat-chip-lbl {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 600;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.banner-right {
    display: flex;
    gap: 12px;
    position: relative;
    z-index: 2;
}

/* ── MOPH-Inspired Grid Cards (Flat Rectangles, Solid Colors) ── */
.moph-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.moph-card {
    border-radius: 0 !important;
    /* Perfect flat design from screenshot */
    padding: 18px 20px;
    color: white !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 130px;
    box-shadow: none !important;
    border: none !important;
    transition: transform 0.2s, filter 0.2s;
    text-decoration: none;
}

.moph-card:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.moph-card-hd {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    opacity: 0.95;
    white-space: nowrap;
}

.moph-card-hd i {
    font-size: 0.95rem;
    opacity: 0.8;
}

.moph-card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 10px;
}

.moph-card-num {
    font-size: 2.3rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
}

.moph-card-sub {
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.85;
    margin-top: 6px;
}

/* Colspan utilities */
.moph-col-2 {
    grid-column: span 2;
}

/* Colors from MOPH screenshot */
.moph-blue {
    background: #4e79a7 !important;
}

.moph-purple {
    background: #b07aa1 !important;
}

.moph-grey {
    background: #5c6b73 !important;
}

.moph-green {
    background: #59a14f !important;
}

.moph-orange {
    background: #f28e2b !important;
}

.moph-red {
    background: #e15759 !important;
}

.moph-teal {
    background: #76b7b2 !important;
}

.moph-brown {
    background: #9c755f !important;
}

/* ── Category Navigation Grid ── */
.cat-icon {
    font-size: 1.6rem;
    margin-bottom: 8px;
    opacity: 0.85;
}

/* Bucket bars (MOPH flat rectangular style) */
.bk-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.bk-row:last-child {
    border-bottom: none;
}

.bk-range {
    font-size: .72rem;
    font-weight: 700;
    color: #475569;
    min-width: 55px;
}

.bk-bar-wrap {
    flex: 1;
    background: #f1f5f9;
    border-radius: 0 !important;
    height: 8px;
}

.bk-bar-fill {
    height: 100%;
    border-radius: 0 !important;
}

.bk-count {
    font-size: .72rem;
    font-weight: 800;
    min-width: 36px;
    text-align: right;
}

.hval {
    font-weight: 800;
    font-size: .9rem;
}

.hval-good {
    color: #15803d;
}

.hval-mid {
    color: #854d0e;
}

.hval-high {
    color: #991b1b;
}

.leaflet-tooltip-own {
    background: white;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 5px 10px;
    border-radius: 0 !important;
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
}

.leaflet-container {
    font-family: inherit;
}

#hba1cMap {
    background: #ffffff !important;
}

.hospital-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hospital-marker-pin {
    width: 26px;
    height: 26px;
    background: #ffffff;
    border: 2px solid #3b82f6;
    /* premium tech blue border */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    color: #3b82f6;
    font-size: 10px;
    transition: all 0.2s ease-in-out;
}

.hospital-marker-pin:hover {
    transform: scale(1.2) translateY(-2px);
    background: #3b82f6;
    color: #ffffff;
    border-color: #ffffff;
}


/* ═══════════════════════════════════════════════════════════════
   PAGE: public posts  (posts/public.blade.php)
═══════════════════════════════════════════════════════════════ */
.wrap {
    max-width: 1300px;
    margin: 0 auto;
    padding: 14px 16px 48px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Header ── */
.ph {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    border-radius: 14px;
    padding: 20px 28px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ph-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ph-icon {
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, .15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.ph-title {
    font-size: 1.1rem;
    font-weight: 800;
}

.ph-sub {
    font-size: .75rem;
    opacity: .78;
    margin-top: 3px;
}

.ph-actions {
    display: flex;
    gap: 8px;
}

.ph-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.ph-btn-solid {
    background: white;
    color: #1e3a8a;
}

.ph-btn-outline {
    background: rgba(255, 255, 255, .15);
    color: white;
    border: 1px solid rgba(255, 255, 255, .3);
}

.ph-btn-solid:hover {
    background: #f1f5f9;
}

.ph-btn-outline:hover {
    background: rgba(255, 255, 255, .25);
}

/* ── Org Filter Chips ── */
.org-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.org-chip {
    padding: 6px 16px;
    border-radius: 100px;
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border: 1.5px solid transparent;
    transition: .2s;
    flex-shrink: 0;
}

.org-chip:hover {
    transform: translateY(-1px);
}

.org-chip-blue {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.org-chip-green {
    background: #dcfce7;
    color: #15803d;
    border-color: #bbf7d0;
}

.org-chip-amber {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde047;
}

.org-chip-purple {
    background: #ede9fe;
    color: #5b21b6;
    border-color: #c4b5fd;
}

.org-chip-rose {
    background: #ffe4e6;
    color: #9f1239;
    border-color: #fecdd3;
}

/* ── Org Section ── */
.org-section {
    scroll-margin-top: 100px;
}

.org-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    margin-bottom: 12px;
}

.org-stripe {
    width: 5px;
    height: 40px;
    border-radius: 3px;
    background: linear-gradient(180deg, #1d4ed8, #3b82f6);
    flex-shrink: 0;
}

.org-name {
    font-size: 1rem;
    font-weight: 800;
    color: #1e3a8a;
}

.org-detail {
    font-size: .75rem;
    color: #64748b;
    margin-top: 2px;
}

.org-count {
    margin-left: auto;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 100px;
    padding: 3px 10px;
    font-size: .72rem;
    font-weight: 700;
}

/* ── Content Grid ── */
.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

/* ── Mini Cards (Policy/Project/Research) ── */
.mini-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    overflow: hidden;
}

.mini-card-hd {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .8rem;
    font-weight: 700;
}

.mini-card-body {
    padding: 10px 14px;
}

.mini-item {
    padding: 8px 0;
    border-bottom: 1px solid #f8fafc;
}

.mini-item:last-child {
    border-bottom: none;
}

.mini-item-title {
    font-size: .8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 3px;
}

.mini-item-desc {
    font-size: .72rem;
    color: #64748b;
    line-height: 1.4;
}

.mini-link {
    font-size: .7rem;
    color: #3b82f6;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 4px;
}

.mini-link:hover {
    text-decoration: underline;
}

/* ── News Cards ── */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.news-card {
    background: white;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    overflow: hidden;
    transition: .2s;
}

.news-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, .1);
    transform: translateY(-2px);
}

.news-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.news-body {
    padding: 14px 16px;
}

.news-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.news-date {
    font-size: .7rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.news-org-tag {
    font-size: .68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    background: #dbeafe;
    color: #1d4ed8;
}

.news-title {
    font-size: .9rem;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.4;
    margin-bottom: 6px;
}

.news-detail {
    font-size: .78rem;
    color: #64748b;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.news-files {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.news-file-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: .7rem;
    color: #334155;
    text-decoration: none;
}

.news-file-link:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

/* ── All Posts Section ── */
.section-title {
    font-size: .88rem;
    font-weight: 800;
    color: #1e3a8a;
    padding: 10px 0 4px;
    border-bottom: 2px solid #dbeafe;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}

/* ── Empty State ── */
.empty {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: 12px;
    color: #94a3b8;
}

.empty i {
    font-size: 2.5rem;
    opacity: .3;
    margin-bottom: 12px;
    display: block;
}

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 20px;
    font-size: .75rem;
    color: #94a3b8;
}




/* ═══════════════════════════════════════════════════════════════
   PAGE: login  (auth/login.blade.php)
═══════════════════════════════════════════════════════════════ */

/* Login body — full-screen, centered, no scroll */
body.login-body {
    position: relative;
    height: 100vh;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b5494 0%, #147cd1 50%, #023b6b 100%);
    padding: 0 !important;
    font-family: 'IBM Plex Sans Thai', sans-serif !important;
}

/* Polygon overlay layer 1 — top-left & bottom-right triangles */
body.login-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        /* top-left dark triangle */
        linear-gradient(135deg, rgba(0, 0, 0, 0.1) 30%, transparent 30%),
        /* bottom-right dark triangle */
        linear-gradient(315deg, rgba(0, 0, 0, 0.12) 25%, transparent 25%);
    pointer-events: none;
    z-index: 1;
}

/* Polygon overlay layer 2 — center crossing light shapes */
body.login-body::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.04) 40%, rgba(255, 255, 255, 0.04) 60%, transparent 60%),
        linear-gradient(135deg, transparent 35%, rgba(255, 255, 255, 0.03) 35%, rgba(255, 255, 255, 0.03) 55%, transparent 55%);
    pointer-events: none;
    z-index: 1;
}


.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 900px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0;
}

/* Left Branding Side */
.left-side {
    flex: 1;
    padding-right: 60px;
    text-align: right;
    color: #ffffff;
}

.left-title {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.left-subtitle {
    font-size: 1.15rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 24px;
}

.left-badge {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Divider Line */
.divider {
    width: 1px;
    height: 300px;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Right Form Side */
.right-side {
    flex: 1;
    padding-left: 60px;
    min-width: 0;
    overflow: hidden;
}

.users-icon-container {
    text-align: center;
    margin-bottom: 36px;
}

.users-icon {
    font-size: 3.6rem;
    color: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

/* Input field container */
.input-box-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    margin-bottom: 20px;
    height: 48px;
    padding: 0 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-box-container:focus-within {
    background: rgba(255, 255, 255, 0.32);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
}

.input-box-icon {
    font-size: 1.1rem;
    color: #ffffff;
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.input-box-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.4);
    margin-right: 16px;
}

.input-box-field {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.98rem;
    font-family: inherit;
    width: 100%;
}

.input-box-field::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

/* Login Options Row */
.login-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    margin-bottom: 30px;
}

.login-remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.login-remember-check {
    accent-color: #147cd1;
}

.login-back-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    transition: color 0.2s;
}

.login-back-link:hover {
    color: #ffffff;
}

/* Login Button */
.btn-login-blue {
    width: 100%;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
}

.btn-login-blue:hover {
    background: #ffffff;
    color: #074780;
    border-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.25);
}

.btn-login-blue:active {
    transform: translateY(0);
}

.error-banner {
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.error-banner i {
    color: #ef4444;
}

/* Responsive Layout */


/* ═══ PAGE: chemical ═══ */
:root {
    --p-primary: #3b82f6;
    --p-primary-hover: #2563eb;
    --p-bg: #f8fafc;
    --p-card-bg: #ffffff;
    --p-text-main: #0f172a;
    --p-text-muted: #475569;
    --p-border: #cbd5e1;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'IBM Plex Sans Thai', sans-serif;
    background-color: var(--p-bg);
    color: var(--p-text-main);
}

.chem-wrap {
    padding: 130px 24px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ── Header ── */
.chem-header {
    margin-bottom: 24px;
    background: var(--p-card-bg);
    border: 1px solid var(--p-border);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.chem-title-area h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e3a8a;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chem-title-area p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--p-text-muted);
}

/* ── Stats Grid ── */
.ds-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    width: 100%;
    max-width: 820px;
    margin: 0 auto 24px auto !important;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #cbd5e1;
    border-radius: 0 !important;
}

.ds-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 6px;
    text-align: center;
    border-radius: 0;
    box-shadow: none;
    border: none;
    transition: all 0.2s ease;
    min-height: 125px;
}

.ds-stat-item:hover {
    opacity: 0.88;
}

.ds-stat-item:nth-child(1) {
    background: #e0f2fe;
    color: #0369a1;
}

/* Sky Blue */
.ds-stat-item:nth-child(2) {
    background: #e0f8e9;
    color: #15803d;
}

/* Mint Green */
.ds-stat-item:nth-child(3) {
    background: #fef3c7;
    color: #b45309;
}

/* Amber Orange */
.ds-stat-item:nth-child(4) {
    background: #fee2e2;
    color: #b91c1c;
}

/* Light Red */
.ds-stat-item:nth-child(5) {
    background: #faf5ff;
    color: #6b21a8;
}

/* Purple */

.ds-stat-icon {
    font-size: 1.2rem;
    opacity: 0.9;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.ds-stat-label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.85;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.ds-stat-value {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.3px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.ds-stat-sub {
    font-size: 0.65rem;
    font-weight: 500;
    opacity: 0.75;
    line-height: 1.1;
}

/* ── Main Layout Grid ── */
.chem-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    align-items: start;
}

.panel {
    background: white;
    border: 1px solid var(--p-border);
}

.panel-hd {
    padding: 16px 20px;
    border-bottom: 1px solid var(--p-border);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.panel-body {
    padding: 20px;
}

/* Search input bar */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--p-border);
    background: #ffffff;
    color: var(--p-text-main);
    font-family: inherit;
    font-size: 0.85rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--p-primary);
}

.search-btn {
    background: var(--p-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.85rem;
}

.search-btn:hover {
    background: var(--p-primary-hover);
}

/* ── Custom Table Design ── */
.chem-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.chem-table th {
    text-align: left;
    padding: 12px 14px;
    background: #f1f5f9;
    color: var(--p-text-muted);
    font-weight: 700;
    border-bottom: 2px solid var(--p-border);
}

.chem-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    color: var(--p-text-main);
    vertical-align: middle;
}

.chem-table tr:hover {
    background: #f8fafc;
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 4px;
}

.badge-safe {
    background: #dcfce7;
    color: #15803d;
}

.badge-unsafe {
    background: #fee2e2;
    color: #b91c1c;
}

/* ── Info block ── */
.info-card {
    background: #f8fafc;
    border-left: 4px solid var(--p-primary);
    padding: 14px 16px;
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--p-text-muted);
    line-height: 1.5;
}

.info-card h4 {
    margin: 0 0 6px 0;
    color: var(--p-text-main);
    font-weight: 700;
}

/* ── Pagination ── */
.pagination-container {
    margin-top: 20px;
}

.pagination-container .pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-container .page-item .page-link {
    padding: 8px 12px;
    border: 1px solid var(--p-border);
    background: white;
    color: var(--p-text-main);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    transition: 0.2s;
}

.pagination-container .page-item.active .page-link {
    background: var(--p-primary);
    color: white;
    border-color: var(--p-primary);
}

.pagination-container .page-item .page-link:hover {
    background: #f1f5f9;
}





/* ═══ PAGE: downstream_show ═══ */
.show-wrap-body {
    background: #f8fafc;
    font-family: 'IBM Plex Sans Thai', sans-serif;
    color: #1e293b;
}

.show-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 14px 18px 60px;
}

/* Banner */
.show-banner {
    background: linear-gradient(120deg, #3b0764, #6d28d9, #7c3aed);
    border-radius: 0;
    padding: 20px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.show-banner-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.show-banner-ico {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, .15);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
}

.show-banner-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
}

.show-banner-sub {
    font-size: .73rem;
    color: rgba(255, 255, 255, .65);
    margin-top: 3px;
}

.show-banner-badge {
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 0;
    padding: 7px 16px;
    font-size: .78rem;
    font-weight: 700;
    color: white;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .3);
    color: white;
    padding: 6px 14px;
    font-size: .75rem;
    font-weight: 700;
    text-decoration: none;
    transition: .2s;
    font-family: inherit;
}

.back-btn:hover {
    background: rgba(255, 255, 255, .25);
}

/* Grid layout */
.show-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.show-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0;
}

.show-card-full {
    grid-column: span 2;
}

.show-card-hd {
    padding: 12px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    font-weight: 700;
    color: #334155;
}

.show-card-hd i {
    color: #8b5cf6;
    font-size: .9rem;
}

.show-card-body {
    padding: 18px;
}

/* Fields */
.field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.field-row:last-child {
    border-bottom: none;
}

.field-label {
    font-size: .75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.field-value {
    font-size: .85rem;
    font-weight: 600;
    color: #1e293b;
    text-align: right;
}

/* HbA1c Badge */
.hba1c-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    text-align: center;
    gap: 6px;
}

.hba1c-big {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.04em;
}

.hba1c-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .75;
}

.hba1c-badge {
    font-size: .75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 6px;
    display: inline-block;
}

.hba1c-good {
    color: #15803d;
}

.hba1c-mid {
    color: #854d0e;
}

.hba1c-high {
    color: #991b1b;
}

.badge-good {
    background: #dcfce7;
    color: #15803d;
}

.badge-mid {
    background: #fef3c7;
    color: #854d0e;
}

.badge-high {
    background: #fee2e2;
    color: #991b1b;
}

/* BP Display */
.bp-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    text-align: center;
}

.bp-val {
    font-size: 2.2rem;
    font-weight: 900;
    color: #334155;
    line-height: 1;
}

.bp-sep {
    font-size: 2rem;
    color: #94a3b8;
    font-weight: 300;
}

.bp-label {
    font-size: .65rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 4px;
}

/* BMI */
.bmi-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    gap: 4px;
}

.bmi-big {
    font-size: 2.8rem;
    font-weight: 900;
    color: #475569;
    line-height: 1;
}

.bmi-label {
    font-size: .7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.bmi-badge {
    font-size: .73rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    margin-top: 6px;
    display: inline-block;
}

.bmi-under {
    background: #dbeafe;
    color: #1e40af;
}

.bmi-normal {
    background: #dcfce7;
    color: #15803d;
}

.bmi-over {
    background: #fef3c7;
    color: #854d0e;
}

.bmi-obese {
    background: #fee2e2;
    color: #991b1b;
}

/* ═══ PAGE: index ═══ */

.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 100px;
    padding-bottom: 50px;
    min-height: 100vh;
    width: 100%;
}

.content-wrap {
    width: 90%;
    max-width: 1300px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 30px;
}

/* ─── Premium Header Card ─── */
.admin-header-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 0 !important;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.02), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    flex-wrap: wrap;
    gap: 20px;
}

.admin-title-group h2 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.admin-title-group p {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f1f5f9;
    padding: 10px 20px;
    border-radius: 0 !important;
    border: 1px solid #e2e8f0;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #3b82f6, #1e3a8a);
    color: white;
    border-radius: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
}

.user-info span {
    display: block;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: #0f172a;
}

.user-role {
    font-size: 0.72rem;
    color: #3b82f6;
    font-weight: 700;
    text-transform: uppercase;
}

/* ─── Modern Grid Layout ─── */
.management-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    width: 100%;
}





/* ─── Stream Cards ─── */
.stream-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

.stream-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    border-color: rgba(59, 130, 246, 0.2);
}

.stream-header {
    padding: 24px;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stream-icon {
    font-size: 1.6rem;
    background: rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 !important;
    backdrop-filter: blur(4px);
}

.stream-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.stream-desc {
    font-size: 0.72rem;
    opacity: 0.85;
    font-weight: 500;
}

.stream-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    background: #ffffff;
}

.stream-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 0 !important;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    text-decoration: none !important;
    color: #334155;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s ease-in-out;
}

.stream-link i:first-child {
    font-size: 1.05rem;
    width: 24px;
    text-align: center;
    transition: transform 0.2s ease-in-out;
}

.stream-link:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
    transform: translateX(4px);
}

.stream-link:hover i:first-child {
    transform: scale(1.15);
}

.stream-link i.fa-chevron-right {
    margin-left: auto;
    font-size: 0.7rem;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.stream-link:hover i.fa-chevron-right {
    opacity: 0.9;
}

/* ─── Province Select Card ─── */
.province-select-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 0 !important;
    padding: 30px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.02);
    margin-top: 10px;
}

.province-select-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e3a8a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.province-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.province-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: #ffffff;
    border: 2px solid #3b82f6;
    border-radius: 0 !important;
    text-decoration: none !important;
    transition: all 0.2s ease-in-out;
}

.province-card i {
    font-size: 1.4rem;
    color: #3b82f6;
}

.province-card span {
    color: #1e3a8a;
    font-weight: 800;
    font-size: 0.95rem;
}

.province-card:hover {
    background: #eff6ff;
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.1);
}

/* ─── Stream Header Accent Gradients ─── */
.accent-upstream {
    background: linear-gradient(135deg, #10b981, #059669);
}

.accent-midstream {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.accent-downstream {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.accent-safety {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

/* ─── Flat MOPH Style Adaptation (Posts Page) ─── */
body.posts-public-body {
    background-color: #f8fafc;
    color: #1e293b;
    font-family: 'IBM Plex Sans Thai', sans-serif;
    min-height: 100vh;
}

/* Override to enforce flat design layout matching other dashboards */
.org-pill,
.btn-read-flat,
.stats-item-flat,
.res-item-flat,
.modal-card {
    border-radius: 16px;
    overflow: hidden;
}

.modal-close-btn {
    border-radius: 0;
}

.modal-org-tag {
    border-radius: 0;
}

.modal-gallery-img {
    border-radius: 0;
}

.pagination-container * {
    border-radius: 0;
}

.search-input {
    border-radius: 0;
    border: 1.5px solid #cbd5e1;
    padding: 8px 16px;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: #10b981;
    box-shadow: none;
}

.search-btn {
    border-radius: 0;
    background: #10b981;
    color: white;
    border: 1.5px solid #10b981;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background: #059669;
    border-color: #059669;
}

.tag-flat {
    border-radius: 0;
}

.hero-panel {
    border-radius: 0;
    overflow: hidden;
}

.org-filter-wrap {
    border-radius: 0;
}

.news-card-flat {
    border-radius: 0 !important;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

.card-pic-thumb {
    border-radius: 0;
}

.news-file-link {
    border-radius: 0;
}

.modal-gallery-wrap,
.modal-attachments-wrap {
    border-radius: 0;
}

.panel {
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.panel-hd {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.posts-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 110px 20px 48px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ─── Org Scroller & Search (Filter Bar) ─── */
.org-filter-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0 !important;
    padding: 16px 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.org-scroller-container {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.org-scroller-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 12px;
    border-right: 2px solid #e2e8f0;
}

.org-scroller {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 0;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.org-scroller::-webkit-scrollbar {
    display: none;
}

.filter-search-wrap {
    flex-shrink: 0;
    margin-left: 10px;
}

.org-pill {
    padding: 8px 18px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 0 !important;
    transition: all 0.2s ease-in-out;
    box-shadow: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.org-pill:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-2px);
}

.org-pill.active {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

/* ─── Category Filter (New) ─── */
.category-filter-wrap {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 5px;
    padding: 0 5px;
}

.category-filter-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.category-filter-scroller {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 5px 0;
}

.category-filter-scroller::-webkit-scrollbar {
    display: none;
}

.type-filter-pill {
    padding: 6px 14px;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* ─── Layout Grid ─── */
.main-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
    align-items: start;
}

/* ─── News Feed ─── */
.feed-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feed-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #ecfdf5;
    padding-bottom: 12px;
    margin-bottom: 8px;
}

.feed-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feed-count {
    font-size: 0.8rem;
    color: #059669;
    background: #ecfdf5;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
}

/* Flat News Grid & Cards */
.news-grid-flat {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}







.news-card-flat {
    background: white;
    border: 1px solid #cbd5e1;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: border-color 0.2s;
    position: relative;
    border-radius: 0 !important;
}

.news-card-flat:hover {
    border-color: #94a3b8;
}

.news-card-flat:hover .card-image-zoom {
    transform: scale(1.06) !important;
}

.news-card-flat:hover .read-more-link {
    gap: 8px !important;
    color: #059669 !important;
}

.card-img-flat {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 1px solid #e2e8f0;
}

.card-body-flat {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.card-meta-flat {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.7rem;
    color: #64748b;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tag-flat {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    background: #e2e8f0;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.card-title-flat {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.4;
    margin: 0 0 6px;
}

.card-text-flat {
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 12px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.card-bottom-flat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
    margin-top: auto;
    flex-wrap: wrap;
    gap: 10px;
}

.card-attach-flat {
    font-size: 0.68rem;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 2px 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.btn-read-flat {
    height: 28px;
    padding: 0 12px;
    background: #475569;
    color: white;
    border: none;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s;
}

.btn-read-flat:hover {
    background: #1e3a8a;
}

.card-pics-row {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.card-pic-thumb {
    width: 48px;
    height: 36px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #cbd5e1;
}

.card-pic-thumb:hover {
    opacity: 0.85;
}

/* ─── Sidebar Containers ─── */
.sidebar-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Stats List (Flat items) */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stats-item-flat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0 !important;
    font-size: 0.75rem;
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.15s ease;
}

.stats-item-flat:hover {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
    transform: translateX(2px);
}

.stats-label-flat {
    display: flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-stripe-flat {
    width: 4px;
    height: 12px;
    display: inline-block;
    margin-right: 8px;
}

.stats-badge-flat {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
}

.stats-item-flat:hover .stats-badge-flat {
    background: #2563eb;
    color: white;
}

/* Mini card items list */
.resource-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.res-item-flat {
    padding: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.res-type-tag-flat {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 4px;
    margin-bottom: 5px;
    display: inline-block;
    text-transform: uppercase;
}

.tag-policy-flat {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.tag-project-flat {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.tag-research-flat {
    background: #fefce8;
    color: #ca8a04;
    border: 1px solid #fef08a;
}

.res-title-flat {
    font-size: 0.75rem;
    font-weight: 700;
    color: #334155;
    line-height: 1.4;
    margin-bottom: 2px;
}

.res-desc-flat {
    font-size: 0.68rem;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 6px;
}

.res-link-flat {
    font-size: 0.68rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.res-link-flat:hover {
    text-decoration: underline;
}

/* Empty state style */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border: 1px solid #cbd5e1;
    color: #64748b;
}

.empty-state i {
    font-size: 2rem;
    color: #cbd5e1;
    margin-bottom: 10px;
    display: block;
}

.empty-state p {
    font-size: 0.8rem;
    font-weight: 600;
}

/* ─── Reusable Details Modal Overlay (Flat Style) ─── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card {
    background: white;
    border: 1px solid #cbd5e1;
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
    background: #e2e8f0;
    color: #475569;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.modal-close-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.modal-header-new {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.modal-org-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.modal-date-text {
    font-size: 0.72rem;
    color: #64748b;
}

.modal-title-text {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e3a8a;
    line-height: 1.4;
    margin-bottom: 6px;
}

.modal-author-text {
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal-detail-text {
    font-size: 0.82rem;
    color: #334155;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 20px;
}

.modal-gallery-wrap {
    margin-top: 18px;
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
}

.modal-gallery-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #1e3a8a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

.modal-gallery-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: opacity 0.15s;
}

.modal-gallery-img:hover {
    opacity: 0.85;
}

.modal-attachments-wrap {
    margin-top: 18px;
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
}

/* ─── Responsive Styles ─── */




/* ─── Moved from blade views ─── */
.moph-card,
.card,
.card *,
.btn-f,
.btn-cl,
.moph-grid,
.moph-grid * {
    border-radius: 0 !important;
}

/* Tooltip text styling optimized for original Dark Slate Map Tooltip */
.tooltip-title-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 4px;
    margin-bottom: 6px;
}

.tooltip-district {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    line-height: 1.2;
}

.tooltip-tambon {
    font-size: 15px;
    color: #ffffff;
    font-weight: 600;
    line-height: 1.3;
}

.tooltip-data-section {
    font-size: 12px;
    color: #e2e8f0;
}

.tooltip-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 3px;
}

.tooltip-crop-name {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.tooltip-crop-val {
    font-weight: 600;
    color: #ffffff;
}

.tooltip-no-data {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
    margin-top: 4px;
}

/* Map Legend & Toggle controls */
.map-section {
    position: relative;
}

.map-dashboard-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    width: 210px;
    font-family: 'IBM Plex Sans Thai', sans-serif;
    pointer-events: auto;
}

.control-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 6px;
}

.legend-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid #fff;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.content-wrap {
    max-width: 1600px !important;
    width: 90% !important;
}

/* Unified Dashboard Layout Styling */
.dashboard-charts-container {
    margin-top: 35px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    font-family: 'IBM Plex Sans Thai', sans-serif;
    width: 100%;
}

/* Shift Map Down visually to create space and balance */
.map-wrapper {
    margin-top: -230px !important;
    transition: margin-top 0.3s ease;
}

.value-chain-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
}

.value-chain-grid .card {
    grid-column: span 2;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0;
    padding: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 365px;
    height: 365px;
    box-sizing: border-box;
    transition: all 0.25s ease;
}

.value-chain-grid .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    border-color: #cbd5e1;
}

/* Counter-rotate Leaflet popups on home map to keep them upright and fix blurriness */
#homeMap .leaflet-popup-content-wrapper {
    transform: rotate(-18deg) translateZ(0) !important;
    transform-origin: center center;
    border-radius: 0 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

#homeMap .leaflet-popup-tip-container {
    transform: rotate(-18deg) translateZ(0) !important;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Fix blurriness for map tooltips */
.custom-map-tooltip,
.map-tooltip-content {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transform: translateZ(0);
}

/* Leaflet Popups, containers and Map Overrides */
.leaflet-popup-content-wrapper {
    border-radius: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid #cbd5e1 !important;
    padding: 2px !important;
}

.leaflet-popup-tip {
    border-radius: 0 !important;
    border: 1px solid #cbd5e1 !important;
}

#spendingMap,
#hba1cMap,
#productionMap {
    background: #ffffff !important;
}

#homeMap.leaflet-container,
#homeMap {
    background: transparent !important;
}

.popup-btn:hover {
    background: #f8fafc !important;
    color: #1e293b !important;
    border-color: #94a3b8 !important;
}

.popup-btn-primary:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: white !important;
}

/* ─────────────────────────────────────────────────────── */
/* Home Page (provinces/home.blade.php) Premium Styles    */
/* ─────────────────────────────────────────────────────── */

/* ─── Premium Redesign Custom Styles ─── */
body {
    background: #f8fafc;
    font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif;
    color: #1e293b;
}

/* body.home-page-layout {
    background: linear-gradient(rgba(248, 250, 252, 0.55), rgba(248, 250, 252, 0.55)), url('/images/bk.png') center/cover no-repeat fixed;
} */

.page-wrapper {
    padding: 110px 0 60px;
}

.content-wrap {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 0px;
    box-sizing: border-box;
    background: transparent;
}

.hero-section {
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(240, 253, 244, 0.1) 25%, rgba(240, 253, 244, 0.8) 55%, rgba(240, 253, 244, 0.96) 80%, rgba(240, 253, 244, 1) 100%), url("/images/bk.png") no-repeat center bottom;
    background-size: cover;
    width: 100%;
    margin-bottom: 0px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    overflow: visible;
    padding-top: 90px;
}

.hero-section-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    height: 620px;
}

.hero-left {
    position: absolute;
    top: 28px;
    left: 10px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
}

.hero-title {
    font-size: 2.1rem;
    font-weight: 700;
    color: #065f46;
    margin: 0 0 8px 0;
    line-height: 1.3;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

.hero-subtitle {
    font-size: 1.05rem;
    color: #475569;
    margin: 0;
    font-weight: 400;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.hero-center-map {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 60%;
    bottom: 0;
    background: transparent;
    border: none;
    overflow: visible;
    z-index: 5;
}

#mapOrientBtn {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    border: 1.5px solid #cbd5e1;
    border-radius: 20px;
    padding: 5px 14px;
    font-family: 'Prompt', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #047857;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s;
}

#mapOrientBtn:hover {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #047857;
}

.btn-back-province {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #065f46;
    color: #ffffff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
    cursor: pointer;
    width: fit-content;
    border: none;
    z-index: 999;
    position: relative;
}

.btn-back-province:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

#homeMap {
    width: 100%;
    height: 100%;
    max-height: 480px;
    border-radius: 0;
    background: transparent !important;
}

.leaflet-container {
    background: transparent !important;
}

/* Hero Right Column Container */
.hero-right-col {
    position: absolute;
    top: 28px;
    right: 48px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-end;
    z-index: 20;
}

/* Hero Date Selector Badge */
.hero-date-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    width: fit-content;
}

.hero-date-label {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
}

.hero-date-val {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
}

/* Map Legend Overlays */
.hero-map-legend {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0;
    padding: 16px;
    width: 100%;
    max-width: 220px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.legend-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #475569;
    margin-bottom: 6px;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.btn-legend-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    background: #ffffff;
    color: #15803d;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 10px;
    transition: all 0.2s;
    text-decoration: none !important;
}

.btn-legend-action:hover {
    border-color: #15803d;
    background: #f0fdf4;
}



.metrics-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    /* margin-bottom: 40px; */
    margin-top: -50px;
    position: relative;
    z-index: 30;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

.metric-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 12px;
    text-decoration: none !important;
    transition: all 0.2s ease-in-out;
    min-height: 170px;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.metric-card:hover {
    transform: translateY(-4px);
    z-index: 10;
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1) !important;
}

.card-green {
    background: #eaf7ec;
    color: #15803d;
}

.card-blue {
    background: #e8f4fd;
    color: #1d4ed8;
}

.card-orange {
    background: #fef3e2;
    color: #c2410c;
}

.card-teal {
    background: #e6f4f1;
    color: #0f766e;
}

.card-pink {
    background: #fdf0f4;
    color: #be185d;
}

.card-purple {
    background: #f5f3ff;
    color: #7e22ce;
}

.metric-icon-old {
    font-size: 2rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
}

.metric-title-old {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
    opacity: 0.9;
}

.metric-value-old {
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 6px;
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.metric-value-old span {
    font-size: 1.05rem;
    font-weight: 700;
    margin-left: 5px;
}

.metric-subtitle-old {
    font-size: 0.76rem;
    opacity: 0.7;
    font-weight: 500;
}

.metric-val-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: auto;
}

.metric-number {
    font-size: 2.1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

.trend-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    background: #dcfce7;
    color: #15803d;
}

.trend-down {
    background: #fee2e2;
    color: #b91c1c;
}

.metric-sub {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    margin-top: 8px;
}

/* Section Headings */






/* 4-Column Card Grid */
.dashboard-gridauto {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0px;
    margin-bottom: 0px;
}

.dashboard-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0px;
    margin-bottom: 0px;
}

.dashboard-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0px;
    margin-bottom: 0px;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgb(196 195 195 / 50%) !important;
    border-radius: 20px !important;
    margin: 10px;
    padding: 20px;
    box-shadow: 0 10px 32px 0 rgb(73 73 73 / 10%) !important;
    display: flex;
    flex-direction: column;
    min-height: 290px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.75) !important;
}

.card-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.card-header-bar h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
    margin: 0;
}

.card-header-bar span {
    font-size: 0.72rem;
    font-weight: 500;
    color: #94a3b8;
}

/* Stat Details Box inside Card */
.card-stat-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.stat-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed #f1f5f9;
}

.stat-item-row:last-child {
    border-bottom: none;
}

.stat-item-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: #64748b;
}

.stat-item-value-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-item-num {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f172a;
}

.stat-item-sub {
    font-size: 0.72rem;
    font-weight: 600;
}

/* 2-Column Connectivity & Alerts Grid */
.connectivity-grid-2 {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    margin-top: 40px;
}

.network-map-container {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-grow: 1;
}

.network-visual {
    width: 190px;
    height: 190px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.network-list {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.network-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 6px;
}

.network-label {
    font-weight: 500;
    color: #475569;
}

.network-val {
    font-weight: 700;
    color: #0f172a;
}

/* Alerts List */
.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.alert-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.alert-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fee2e2;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-icon-box.medium {
    background: #ffedd5;
    color: #f97316;
}

.alert-content-box {
    flex-grow: 1;
}

.alert-title-text {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
}

.alert-desc-text {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 2px;
}

.alert-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.alert-date {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 500;
}

.badge-alert {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.badge-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.badge-warning {
    background: #ffedd5;
    color: #d97706;
    border: 1px solid #fed7aa;
}

.news-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    height: 100%;
}

.news-card:hover {
    transform: translateY(-4px);
    border-color: #e2e8f0 !important;
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.08) !important;
}

.news-card:hover i.fa-arrow-right {
    transform: translateX(4px);
}

/* ─── Specialized Document Type Styles ─── */

/* 1. Policies Layout: Horizontal Cards */




















.policy-desc {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.0em;
}

.policy-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.8rem;
    color: #475569;
}

.policy-footer i {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.policy-horizontal-card:hover .policy-footer i {
    transform: translateX(4px);
}

/* 2. Projects Layout: Status & Progress Cards */
.project-action-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    height: 100%;
    min-height: 260px;
}

.project-action-card:hover {
    transform: translateY(-4px);
    border-color: #94a3b8 !important;
    box-shadow: 0 12px 20px -5px rgba(100, 116, 139, 0.15) !important;
}

.project-card-header {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-org-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.project-action-card .project-card-body {
    padding: 16px;
    flex-grow: 1;
    text-align: left;
}

.project-action-card .project-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.project-action-card .project-desc {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 7.5em;
}

.project-card-footer {
    padding: 12px 16px;
    background: #fafafa;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-dates {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
}

.date-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.date-item i {
    color: #a1a1aa;
}

.date-item-sep {
    color: #d4d4d8;
    font-size: 0.65rem;
}

.project-action-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

.project-action-trigger i {
    font-size: 0.85rem;
    transition: transform 0.2s;
}

.project-action-card:hover .project-action-trigger i {
    transform: translateX(3px);
}

/* 3. Research Layout: Academic Paper Cards */
.research-paper-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    height: 100%;
    min-height: 320px;
    position: relative;
}

.research-paper-card:hover {
    transform: translateY(-4px);
    border-color: #94a3b8 !important;
    box-shadow: 0 12px 20px -5px rgba(100, 116, 139, 0.15) !important;
}

.research-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.research-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.research-area-tag {
    font-size: 0.68rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.research-year {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

.research-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
    text-align: left;
}

.research-desc {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 4.5em;
    text-align: left;
}

.research-meta-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 14px;
    font-size: 0.7rem;
    color: #475569;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.research-meta-item {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.research-meta-item strong {
    font-weight: 700;
    margin-right: 4px;
}

.research-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    margin-top: auto;
}

.research-org-name {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 500;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.research-read-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
}

.research-read-btn i {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.research-paper-card:hover .research-read-btn i {
    transform: translateY(2px);
}

.flow-step-card:hover {
    transform: translateY(-5px);
    border-color: #10b981 !important;
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.08) !important;
}

/* 5-Column Reports & Documents Grid */
.reports-grid-5 {
    display: grid;
    grid-template-columns: repeat(4, 1fr) 1.2fr;
    gap: 20px;
    margin-top: 40px;
    margin-bottom: 60px;
}

.report-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
}

.report-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.report-icon-row {
    font-size: 2.2rem;
    color: #10b981;
    margin-bottom: 16px;
}

.report-title-text {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 4px;
}

.report-meta-text {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 16px;
}

.btn-download-report {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none !important;
    margin-top: auto;
    transition: all 0.2s;
}

.btn-download-report:hover {
    background: #dcfce7;
    color: #15803d;
}

/* Help Card (Green style) */
.help-card {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    border: none;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    color: #ffffff;
    justify-content: space-between;
}

.help-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.help-desc {
    font-size: 0.78rem;
    color: #a7f3d0;
    line-height: 1.5;
    margin-bottom: 20px;
}

.btn-help-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px;
    background: #ffffff;
    color: #065f46;
    border-radius: 8px;
    text-decoration: none !important;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.btn-help-action:hover {
    background: #f8fafc;
    transform: translateY(-1px);
}

/* Leaflet custom overrides */
.leaflet-container {
    font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif !important;
}

.map-tooltip-content {
    background: #1e293b !important;
    border: 1px solid #475569 !important;
    border-radius: 6px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3) !important;
}

/* Chart Empty States */
.chart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    padding: 20px;
    text-align: center;
    min-height: 210px;
    width: 100%;
}

.chart-empty-state i {
    font-size: 2.8rem;
    color: #cbd5e1;
    margin-bottom: 12px;
    opacity: 0.7;
}

.chart-empty-state span {
    font-size: 0.8rem;
    font-weight: 500;
    color: #94a3b8;
}

/* MOPH Card colors (used in crop production grid) */
.moph-card.moph-green {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.moph-card.moph-red {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.moph-card.moph-blue {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE IMPROVEMENTS FOR ALL SCREENS (MOBILE, TABLET, NOTEBOOK)
   ═══════════════════════════════════════════════════════ */

/* Mobile & Tablet Header and General Page Wrapper */


/* Responsive Hero Section (Map & Overlay Stack on Tablet/Mobile) */


/* Metric Cards Responsive Grid (3 columns on small screens/tablets, 2 or 1 columns on mobile) */






/* Value Chain Grid Responsiveness */






/* Dashboard Grids Responsiveness */






/* Support Map visual shift adjustments on notebook/mobile */


/* ─── Grid Overrides for Inline Style Prevention ─── */
.news-grid-4 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
}

.crop-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 15px !important;
}

.policies-grid-2 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
}

.projects-grid-4 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
}

.research-grid-4 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
}











/* ═══════════════════════════════════════════════════════
   COMPREHENSIVE RESPONSIVE STYLES — ALL SCREEN SIZES
═══════════════════════════════════════════════════════ */

/* 2026 UI Refresh */
.top-nav-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1200;
    height: 88px;
    padding: 0 32px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2-level wrap for intermediate laptop / tablet view */
@media (max-width: 1600px) and (min-width: 993px) {
    .top-nav-container {
        /* display: grid !important; */
        grid-template-columns: 1fr auto !important;
        grid-template-rows: auto auto !important;
        height: auto !important;
        padding: 5px 24px !important;
        gap: 12px 18px !important;
    }
    
    .top-nav-container .nav-brand {
        grid-column: 1 !important;
        grid-row: 1 !important;
        justify-self: start !important;
        display: inline-flex !important;
        width: auto !important;
    }
    
    .top-nav-container .nav-right-actions {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: end !important;
        position: static !important;
        margin-left: auto !important;
    }
    
    .top-nav-container .inline-pill-bar {
        grid-column: 1 / span 2 !important;
        grid-row: 2 !important;
        width: 100% !important;
        justify-content: center !important;
        /* border-top: 1px solid rgba(226, 232, 240, 0.8) !important; */
        padding-top: 0px !important;
        display: flex !important;
    }
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: #0f172a;
}

.nav-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    box-shadow: none;
    border: none;
}

.logo-img {
    height: 70px;
    width: auto;
    object-fit: contain;
}

.nav-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nav-brand-copy strong {
    font-size: 1.18rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.nav-brand-copy small {
    font-size: 0.85rem;
    color: #64748b;
    white-space: nowrap;
}

.inline-pill-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    position: relative !important;
    left: auto !important;
    transform: none !important;
    margin: 0 auto !important;
}

.inline-pill {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 12px !important;
    height: 76px !important;
    min-width: 88px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    color: #475569 !important;
    background: #f1f5f9 !important;
    border: 1px solid transparent !important;
    transition: all 0.2s ease !important;
    white-space: nowrap;
    text-decoration: none !important;
}

.inline-pill i {
    font-size: 1.25rem !important;
    color: #475569 !important;
}

.inline-pill:hover:not(.active) {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

.inline-pill.active {
    background-color: #ffffff !important;
    color: #065f46 !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.inline-pill.active i {
    color: #15803d !important;
}

.nav-right-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-bell {
    position: relative;
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 1.35rem;
    padding: 6px;
}

.notification-bell:hover {
    color: #065f46;
    background: transparent;
    border-color: transparent;
    opacity: 1;
}

.bell-badge {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ef4444;
    box-shadow: 0 0 0 3px #ffffff;
}

.nav-admin-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 12px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #065f46, #0f766e);
    color: #ffffff;
    font-size: 0.94rem;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(6, 95, 70, 0.18);
}

.nav-admin-shortcut:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.hamburger-menu {
    width: auto;
    height: auto;
    border: none;
    background: transparent;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 6px;
}

.hamburger-menu:hover {
    background: #f8fafc;
}

.hamburger-menu .menu-bar1,
.hamburger-menu .menu-bar2,
.hamburger-menu .menu-bar3 {
    /* width: 18px;
    height: 2px; */
    /* border-radius: 999px; */
    background: #15803d;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger-menu.active .menu-bar1 {
    transform: translateY(14px) rotate(45deg);
}

.hamburger-menu.active .menu-bar2 {
    opacity: 0;
}

.hamburger-menu.active .menu-bar3 {
    transform: translateY(-16px) rotate(-45deg);
}

.home-page-wrapper {
    padding-top: 104px;
    padding-bottom: 72px;
}

.home-page-wrapper .content-wrap {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.home-page-wrapper .hero-section {
    margin-bottom: 0;
    padding: 0 20px;
    background: transparent;
    border: 0;
}

.home-page-wrapper .hero-section-inner {
    max-width: 1440px;
    min-height: 500px;
    margin: 0 auto;
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.7), transparent 34%),
        linear-gradient(120deg, rgba(6, 95, 70, 0.14), rgba(255, 255, 255, 0.08) 44%, rgba(14, 116, 144, 0.12));
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.1);
}

.home-page-wrapper .hero-section-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(248, 250, 252, 0.94) 0%, rgba(248, 250, 252, 0.78) 32%, rgba(248, 250, 252, 0.1) 68%);
    z-index: 1;
}

.hero-center-map {
    inset: 0;
    z-index: 0;
}

.hero-glass-panel {
    position: absolute;
    top: 34px;
    left: 34px;
    z-index: 3;
    width: min(560px, calc(100% - 460px));
    padding: 28px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(14px);
    box-shadow: 0 24px 40px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.72);
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hero-title {
    margin: 18px 0 12px;
    font-size: clamp(2rem, 3.6vw, 3.6rem);
    line-height: 1.08;
    font-weight: 800;
    color: #0f172a;
    white-space: normal;
    text-shadow: none;
}

.hero-title span {
    display: block;
    color: #047857;
}

.hero-subtitle {
    margin: 0;
    max-width: 46ch;
    font-size: 1rem;
    line-height: 1.7;
    color: #475569;
    white-space: normal;
    text-shadow: none;
}

.hero-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(203, 213, 225, 0.88);
}

.hero-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.hero-action-btn,
.hero-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 16px;
    font-size: 0.88rem;
    font-weight: 700;
}

.hero-action-primary {
    background: linear-gradient(135deg, #065f46, #0f766e);
    color: #ffffff;
    box-shadow: 0 16px 28px rgba(6, 95, 70, 0.18);
}

.hero-action-secondary,
.hero-back-link {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #dbe4ee;
}

.hero-back-link {
    margin-top: 12px;
    width: fit-content;
}

.hero-right-col {
    position: absolute;
    top: 34px;
    right: 34px;
    z-index: 3;
    width: 310px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
}

.hero-date-card,
.hero-map-legend {
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
}

.hero-date-card {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hero-date-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-date-card i {
    color: #64748b;
    font-size: 1.05rem;
}

.hero-date-label {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
}

.hero-date-val {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
}

.hero-map-legend {
    padding: 18px;
}

.legend-title-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.legend-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
}

.legend-caption {
    font-size: 0.74rem;
    color: #64748b;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: #334155;
    margin-bottom: 8px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    flex-shrink: 0;
}

.legend-safe {
    background: #22c55e;
}

.legend-medium {
    background: #f59e0b;
}

.legend-high {
    background: #ef4444;
}

.btn-legend-action {
    margin-top: 10px;
    min-height: 42px;
    border-radius: 14px;
    background: #f8fafc;
    color: #166534;
    border: 1px solid #cfe6d6;
    font-size: 0.8rem;
    font-weight: 700;
}

.btn-legend-action i {
    font-size: 0.78rem;
}

.quick-access-shell {
    position: relative;
    z-index: 20;
    margin-top: -88px;
    padding: 24px;
    border-radius: 28px;
    background: rgba(248, 250, 252, 0.82);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 24px 46px rgba(15, 23, 42, 0.08);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.section-header-soft {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 18px;
}

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title-wrap i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: #ecfdf5;
    color: #047857;
    font-size: 1rem;
}

.section-title-wrap h3 {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 700;
    color: #0f172a;
}

.section-support-text {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.quick-access-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.quick-access-card:hover {
    opacity: 1;
    transform: translateY(-2px);
    border-color: #bbf7d0;
}

.quick-access-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #047857;
    font-size: 1rem;
    flex-shrink: 0;
}

.quick-access-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
}

.quick-access-copy strong {
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 700;
}

.quick-access-copy span {
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.45;
}

.quick-access-arrow {
    margin-left: auto;
    color: #94a3b8;
    font-size: 0.84rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

.metric-card {
    min-height: 220px;
    padding: 22px 20px;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
    border-radius: 24px !important;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.65) !important;
}

.metric-card-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.metric-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.78;
}

.metric-icon-old {
    width: 52px;
    height: 52px;
    margin: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.18rem;
}

.metric-title-old {
    margin-bottom: 2px;
    font-size: 1rem;
    opacity: 1;
}

.metric-value-old {
    justify-content: flex-start;
    margin-bottom: 0;
    font-size: 2rem;
}

.metric-subtitle-old {
    font-size: 0.84rem;
    line-height: 1.5;
    opacity: 0.82;
}

.metric-footer {
    width: 100%;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.metric-link-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: rgba(15, 23, 42, 0.68);
}

.trend-neutral {
    background: #e2e8f0;
    color: #475569;
}

.surface-section {
    padding: 26px;
    border-radius: 28px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.05);
    margin-top: 20px;
}

.btn-view-all {
    min-height: 42px;
    border-radius: 14px;
    padding: 0 16px;
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    color: #334155;
}

.btn-view-all i {
    font-size: 0.78rem;
}

.news-grid-4 {
    margin-bottom: 0;
}

.news-card-media {
    height: 190px;
    border-bottom: 1px solid #eef2f7;
    background: #f1f5f9;
}

.news-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-card-placeholder {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(135deg, #065f46, #10b981);
    color: rgba(255, 255, 255, 0.9);
}

.news-card-placeholder i {
    font-size: 2.8rem;
    color: rgba(255, 255, 255, 0.22);
}

.news-card-placeholder span {
    position: absolute;
    left: 16px;
    bottom: 14px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.18);
    font-size: 0.72rem;
    font-weight: 700;
}

.news-card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    text-align: left;
    flex-grow: 1;
}

.news-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.news-card-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 0.74rem;
    font-weight: 600;
}

.news-card-badge {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 4px 9px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid #bbf7d0;
}

.news-card-title {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.news-card-desc {
    margin: 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.news-card-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #047857;
    font-size: 0.8rem;
    font-weight: 700;
}

.empty-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 32px;
    border-radius: 20px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
}

.empty-card-wide {
    grid-column: 1 / -1;
}

.crop-grid {
    gap: 16px !important;
}

.moph-card {
    min-height: 148px;
    padding: 18px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: #ffffff;
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.moph-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 36px rgba(15, 23, 42, 0.12);
}

.moph-neutral {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #dbe4ee;
    box-shadow: none;
}

.moph-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.moph-card-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.45;
}

.moph-card-tag {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    color: inherit;
    font-size: 0.74rem;
    font-weight: 700;
}

.moph-neutral .moph-card-tag {
    background: #ffffff;
    border: 1px solid #dbe4ee;
}

.moph-card-body {
    margin-top: auto;
}

.moph-card-num {
    font-size: 2.2rem;
    line-height: 1;
    font-weight: 800;
}

.moph-card-sub {
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.84;
}

.dashboard-card {
    border-radius: 24px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.05);
}

.site-footer {
    margin-top: 35px;
    padding: 0 20px 32px;
    background: transparent;
}

.site-footer-inner,
.site-footer-bottom {
    width: 94%;
    max-width: 1600px;
    margin: 0 auto;
}

.site-footer-inner {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 24px;
    padding: 28px;
    border-radius: 30px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.05);
}

.site-footer-logo-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.site-footer-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 18px;
    background: #ffffff;
    padding: 8px;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.site-footer-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.site-footer-brand-copy strong {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.site-footer-brand-copy span {
    font-size: 0.82rem;
    color: #64748b;
}

.site-footer-desc {
    margin: 16px 0 0;
    max-width: 52ch;
    font-size: 0.86rem;
    line-height: 1.75;
    color: #475569;
}

.site-footer-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.site-footer-group h4 {
    margin: 0 0 4px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}

.site-footer-group a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-size: 0.84rem;
}

.site-footer-group a:hover {
    color: #065f46;
    opacity: 1;
}

.site-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0 0;
    color: #64748b;
    font-size: 0.77rem;
    flex-wrap: wrap;
}

/* ── Mobile Layout Fixes (Appended at the bottom to resolve media query override issues) ── */




/* ── Dashboard Grid Responsive Fixes (Appended to ensure correct column spans and avoid layout breakage on mobile/tablet) ── */




/* ── Additional responsive fixes for /dashboard/upstream, /dashboard/midstream, /dashboard/downstream, /dashboard/chemical, and /posts ── */






/* ── Fix Map and Side Panel Flex Squeezing on Mobile (Midstream/Downstream Dashboards) ── */


/* ─── News Section V2 Redesign ─── */
.news-section-v2 {
    position: relative;
    margin-top: -15px;
    padding-top: 20px;
    background-color: #f1f5f9;
    overflow: hidden;
    width: 100%;
}

.news-section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
}

.news-section-title span:first-child {
    color: #84cc16;
    /* light green */
}

.news-section-title span:last-child {
    color: #65a30d;
    /* darker green */
}

.news-tabs-container {
    display: flex;
    justify-content: center;
    gap: 5px;
    position: relative;
    z-index: 10;
    margin-bottom: -50px;
}

.news-tab-modern {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
}

.news-tab-modern .tab-icon {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.news-tab-modern:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-5px);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.1);
}

.news-tab-modern:hover .tab-icon {
    transform: scale(1.2);
}

/* Unique glowing gradients for each category when active */
.news-tab-modern.tab-activity.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
    border-color: transparent;
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.4);
    transform: translateY(-4px);
}

.news-tab-modern.tab-agri.active {
    background: linear-gradient(135deg, #84cc16 0%, #16a34a 100%);
    color: #ffffff !important;
    border-color: transparent;
    box-shadow: 0 10px 20px -5px rgba(132, 204, 22, 0.4);
    transform: translateY(-4px);
}

.news-tab-modern.tab-market.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    color: #ffffff !important;
    border-color: transparent;
    box-shadow: 0 10px 20px -5px rgba(14, 165, 233, 0.4);
    transform: translateY(-4px);
}

.news-tab-modern.tab-health.active {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    color: #ffffff !important;
    border-color: transparent;
    box-shadow: 0 10px 20px -5px rgba(168, 85, 247, 0.4);
    transform: translateY(-4px);
}

.news-tab-modern.tab-safety.active {
    background: linear-gradient(135deg, #f97316 0%, #dc2626 100%);
    color: #ffffff !important;
    border-color: transparent;
    box-shadow: 0 10px 20px -5px rgba(249, 115, 22, 0.4);
    transform: translateY(-4px);
}

.news-curve-bg {
    background: transparent;
    border-radius: 0;
    padding: 0px 0px 20px 0px;
    position: relative;
    min-height: auto;
    box-shadow: none;
}

.news-card-v2 {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); */
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-card-v2:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.news-card-v2-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: #f1f5f9;
}

.news-card-v2-body {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-card-v2-title {
    font-size: 0.95rem;
    color: #1e293b;
    line-height: 1.5;
    margin-bottom: 15px;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-v2-new {
    background: #10b981;
    color: white;
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 2px;
    margin-left: 5px;
    text-transform: uppercase;
    vertical-align: middle;
}

.news-card-v2-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    border: 1px solid #06C755;
    color: #06C755;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    width: fit-content;
    transition: all 0.2s;
}

.news-card-v2-btn:hover {
    background: #06C755;
    color: white;
}

.news-swiper {
    width: 100%;
    padding: 20px 0 50px 0;
}

.news-swiper-button {
    color: #15803d !important;
    background: rgba(21, 128, 61, 0.08);
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
}

.news-swiper-button::after {
    font-size: 1rem !important;
    font-weight: bold;
}

.news-swiper-button:hover {
    background: rgba(21, 128, 61, 0.15);
}

.swiper-pagination-bullet {
    background: #15803d !important;
    opacity: 0.3;
}

.swiper-pagination-bullet-active {
    opacity: 1;
}

.btn-view-all-v2 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #15803d;
    background: transparent;
    color: #15803d;
    border-radius: 30px;
    padding: 8px 24px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    position: absolute;
    right: 5%;
}

.btn-view-all-v2:hover {
    background: #15803d;
    color: white;
    box-shadow: 0 4px 10px rgba(21, 128, 61, 0.15);
}


/* Moved from home.blade.php */

.transparent-metrics {
    display: flex !important;
    justify-content: center !important;
    gap: 0 !important;
    /* Zero gap to make them stick together */
    flex-wrap: wrap !important;
    margin-bottom: 0 !important;
    /* Remove default grid margin */
}

.transparent-metrics .metric-card {
    background: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #0f172a !important;
    /* Dark color for high contrast */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
    width: auto !important;
    /* Let content dictate width */
    min-width: 140px;
    /* Prevent being too narrow */
    padding: 18px 12px !important;
    border-radius: 12px !important;
    margin: 5px !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.transparent-metrics .metric-card::before {
    display: none !important;
}

.transparent-metrics .metric-card:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    transform: translateY(-8px) scale(1.04) !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12) !important;
}


.gallery-tabs-wrap {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 35px;
    flex-wrap: wrap;
}

.gallery-tab {
    font-size: 1.15rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    padding: 8px 26px;
    transition: all 0.3s ease;
    text-decoration: none !important;
    user-select: none;
}

.gallery-tab:hover {
    color: #0f172a;
}

.gallery-tab.active-brush {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.75) 20%, rgba(22, 163, 74, 0.9) 50%, rgba(34, 197, 94, 0.75) 80%, rgba(34, 197, 94, 0.1) 100%);
    color: #ffffff !important;
    border-radius: 15% 85% 12% 88% / 50% 30% 70% 50%;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
}

/* Swiper Coverflow custom adjustments */
.gallery-swiper {
    padding: 20px 0 50px 0 !important;
    width: 100%;
    overflow: hidden;
}

.gallery-swiper .swiper-slide {
    transition: opacity 0.4s ease, transform 0.4s ease !important;
}

.gallery-slide-card {
    width: 320px;
    height: 420px;
    background: #475569;
    /* Solid dark slate instead of image */
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swiper-slide-active .gallery-slide-card {
    border: 4px solid #ffffff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
}

.gallery-slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-slide-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    box-sizing: border-box;
}

.gallery-slide-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.gallery-pagination .swiper-pagination-bullet-active {
    background: #15803d !important;
}


/* Document Section Original Layout */
.doc-section-wrapper {
    background-color: #f8fafc;
    width: 100%;
    padding: 40px 0;
    margin-top: -40px;
    /* pull up over the gallery margin */
}

.doc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.section-title-wrap {
    display: flex;
    align-items: center;
}

.section-title-wrap h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin: 0;
    font-family: 'Prompt', sans-serif;
}

.btn-view-all {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    font-family: 'Prompt', sans-serif;
}

.btn-view-all:hover {
    border-color: #94a3b8;
    color: #1e293b;
}

/* Policy Cards (2 cols) */
.policies-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.policy-horizontal-card {
    display: flex;
    background: #ffffff;
    border-radius: 0;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    height: 180px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.policy-horizontal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.policy-card-visual {
    background: #475569;
    width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.policy-card-visual i {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.6);
}

.policy-badge-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
}

.policy-card-body {
    flex-grow: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.policy-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.policy-date {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.policy-org {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 8px;
    border-radius: 0;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.policy-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    font-family: 'Prompt', sans-serif;
}

.policy-footer-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
}

/* Standard Cards (4 cols) */
.doc-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.std-doc-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    height: 240px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.std-doc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.std-card-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f8fafc;
}

.std-org-name {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.std-status-tag {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 0;
    font-weight: 700;
}

.tag-pending {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fdba74;
}

.tag-research {
    background: #eff6ff;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.std-card-body {
    padding: 16px;
    flex-grow: 1;
}

.std-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    font-family: 'Prompt', sans-serif;
}

.std-card-footer {
    padding: 12px 16px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid #f1f5f9;
}

.std-card-footer-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.std-card-date {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
}

.std-footer-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
}

.icon-circle-btn {
    background: #e2e8f0;
    color: #64748b;
    width: 22px;
    height: 22px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* --- Premium 50/50 Split Layout Styles --- */
.hero-split-layout {
    display: flex;
    flex-direction: row;
    gap: 120px;
    align-items: center;
    justify-content: space-between;
    height: 620px;
    padding: 0 80px;
    box-sizing: border-box;
}

.hero-split-right {
    flex: 1.1;
    min-width: 0;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0 0 20px 0;
    box-sizing: border-box;
    position: relative;
}

.hero-map-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    overflow: visible;
}

.hero-map-wrapper #homeMap {
    width: 100%;
    height: 100%;
    max-height: none;
    background: transparent !important;
    border-radius: 24px;
    overflow: hidden;
}

/* Glassmorphic Overlays on Map */
.hero-date-overlay {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1000;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: none;
}

.hero-date-overlay i {
    color: #0d9488;
    font-size: 1.2rem;
}

.hero-date-overlay .date-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.hero-date-overlay .label {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
}

.hero-date-overlay .val {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 1px;
}

.hero-legend-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    bottom: auto;
    z-index: 1000;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    box-shadow: none;
    width: auto;
    max-width: 500px;
    box-sizing: border-box;
}

.hero-legend-overlay .legend-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.hero-legend-overlay .legend-title i {
    color: #64748b;
}

.hero-legend-overlay .legend-items {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    width: auto;
}

.hero-legend-overlay .legend-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    width: auto;
    box-sizing: border-box;
}

.hero-legend-overlay .legend-badge.green {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.hero-legend-overlay .legend-badge.green i {
    color: #22c55e;
}

.hero-legend-overlay .legend-badge.orange {
    background: rgba(245, 158, 11, 0.12);
    color: #9a3412;
}

.hero-legend-overlay .legend-badge.orange i {
    color: #f59e0b;
}

.hero-legend-overlay .legend-badge.red {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

.hero-legend-overlay .legend-badge.red i {
    color: #ef4444;
}

.hero-map-wrapper #mapOrientBtn {
    position: absolute;
    bottom: 25px;
    top: auto;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 172px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    padding: 10px 16px;
    font-family: 'Prompt', sans-serif;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.hero-map-wrapper #mapOrientBtn:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.1);
}

/* Right Column (Narrative) Styles */
.hero-split-left {
    flex: 1.1;
    min-width: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 10px 40px 17px 33px;
    gap: 20px;
    /* background: transparent !important; */
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.hero-title-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hero-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0d9488;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: rgba(13, 148, 136, 0.1);
    width: fit-content;
    padding: 4px 10px;
    border-radius: 20px;
}

.hero-split-left .hero-title {
    position: static;
    font-size: 2.15rem;
    font-weight: 800;
    color: #115e59;
    margin: 0;
    line-height: 1.2;
    white-space: normal;
    text-shadow: none;
}

.hero-split-left .hero-subtitle {
    position: static;
    font-size: 1.15rem;
    color: #64748b;
    margin: 0;
    font-weight: 500;
    white-space: normal;
    text-shadow: none;
}

.hero-narrative-card {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-narrative-card .narrative-intro {
    font-size: 0.95rem;
    color: #475569;
    font-weight: 500;
    line-height: 1.6;
    margin: 0;
}

.hero-narrative-card .narrative-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hero-narrative-card .step-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-narrative-card .step-badge {
    font-size: 0.85rem;
    font-weight: 700;
    width: fit-content;
    padding: 2px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-narrative-card .step-badge.upstream {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.hero-narrative-card .step-badge.midstream {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.hero-narrative-card .step-badge.downstream {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.hero-narrative-card .step-desc {
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.5;
}

/* Responsive Overrides */



/* User Import Preview styles */
.form-control-sm {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    width: 100%;
}


/* --- Public Details Page (show.blade.php) styles --- */
.post-show-wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 120px 20px 48px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 20px;
    transition: all 0.2s;
    text-decoration: none;
}

.back-btn:hover {
    transform: translateX(-3px);
}

.post-detail-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 16px;
}

.post-org-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-date-label {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-title-header {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.4;
    margin: 0 0 16px 0;
}

.post-type-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    color: #ffffff;
    text-transform: uppercase;
}

.post-content-body {
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.8;
    white-space: pre-wrap;
    margin-bottom: 30px;
}

.post-featured-image {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.post-gallery-section {
    margin-top: 30px;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.post-gallery-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.post-gallery-thumbnail {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: opacity 0.2s;
}

.post-gallery-thumbnail:hover {
    opacity: 0.85;
}

.post-files-section {
    margin-top: 30px;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.post-files-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-file-link {
    font-size: 0.78rem;
    padding: 8px 16px;
    border: 1px solid;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.15s;
}

.result-box {
    background: #fdfbf7;
    border-left: 4px solid #ca8a04;
    padding: 16px 20px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.7;
}

/* Color Themes for Detail Pages */
/* Blue Theme (Policies / Posts) */
.theme-blue .back-btn {
    color: #2563eb;
}

.theme-blue .back-btn:hover {
    color: #1d4ed8;
}

.theme-blue .post-org-label {
    color: #2563eb;
}

.theme-blue .post-type-badge {
    background: #2563eb;
}

.theme-blue .post-file-link {
    color: #2563eb;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.theme-blue .post-file-link:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Purple Theme (Researches) */
.theme-purple .back-btn {
    color: #7c3aed;
}

.theme-purple .back-btn:hover {
    color: #6d28d9;
}

.theme-purple .post-org-label {
    color: #7c3aed;
}

.theme-purple .post-type-badge {
    background: #9333ea;
}

.theme-purple .post-file-link {
    color: #7c3aed;
    background: #faf5ff;
    border-color: #e9d5ff;
}

.theme-purple .post-file-link:hover {
    background: #e9d5ff;
    color: #6d28d9;
}

/* Green Theme (Posts / General) */
.theme-green .back-btn {
    color: #059669;
}

.theme-green .back-btn:hover {
    color: #047857;
}

.theme-green .post-org-label {
    color: #059669;
}

.theme-green .post-type-badge {
    background: #059669;
}

.theme-green .post-file-link {
    color: #059669;
    background: #ecfdf5;
    border-color: #d1fae5;
}

.theme-green .post-file-link:hover {
    background: #d1fae5;
    color: #047857;
}

/* Orange Theme (Projects) */
.theme-orange .back-btn {
    color: #ea580c;
}

.theme-orange .back-btn:hover {
    color: #c2410c;
}

.theme-orange .post-org-label {
    color: #ea580c;
}

.theme-orange .post-type-badge {
    background: #ea580c;
}

.theme-orange .post-file-link {
    color: #ea580c;
    background: #fff7ed;
    border-color: #fed7aa;
}

.theme-orange .post-file-link:hover {
    background: #fed7aa;
    color: #c2410c;
}

/* Standalone forms CSS (Organizes/Users CRUD) */
.standalone-form-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.text-danger {
    color: #ef4444;
    font-size: 0.875rem;
}

/* Provinces Home Analytics Styles */
.analytics-section-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin: 35px 0 15px 0;
    border-left: 4px solid #10b981;
    padding-left: 10px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.analytics-horizontal-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0px;
    margin-bottom: 0px;
}



.horizontal-stat-card {
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-radius: 0px !important;
    padding: 24px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 245px;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.horizontal-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(rgba(255, 255, 255, 0.15), transparent);
    pointer-events: none;
}

.horizontal-stat-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.horizontal-stat-card .card-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.6) 100%) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1), inset 0 2px 4px rgba(255, 255, 255, 0.9);
    transition: transform 0.3s ease;
}

.horizontal-stat-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.horizontal-stat-card .card-info-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.horizontal-stat-card .card-title {
    font-size: 0.82rem;
    font-weight: 750;
    margin-bottom: 6px;
    line-height: 1.3;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

.horizontal-stat-card .card-value {
    font-size: 1.45rem;
    font-weight: 850;
    line-height: 1.1;
    margin: 2px 0 6px;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
}

.horizontal-stat-card .card-subtitle {
    font-size: 0.68rem;
    font-weight: 600;
    opacity: 0.9;
    background: rgba(0, 0, 0, 0.08);
    padding: 3px 8px;
    border-radius: 20px;
    display: inline-block;
}

/* Upstream Theme Colors (3D Green) */
.upstream-card-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border-top: 2px solid rgba(255, 255, 255, 0.45) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.4), inset 0 -5px 0 rgba(4, 120, 87, 0.6);
}

.upstream-card-active:hover {
    box-shadow: 0 16px 24px -2px rgba(16, 185, 129, 0.55), inset 0 -5px 0 rgba(4, 120, 87, 0.7);
}

/* Midstream Theme Colors (3D Orange) */
.midstream-card-active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    border-top: 2px solid rgba(255, 255, 255, 0.45) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 10px 20px -5px rgba(245, 158, 11, 0.4), inset 0 -5px 0 rgba(180, 83, 9, 0.6);
}

.midstream-card-active:hover {
    box-shadow: 0 16px 24px -2px rgba(245, 158, 11, 0.55), inset 0 -5px 0 rgba(180, 83, 9, 0.7);
}

/* Downstream Theme Colors (3D Red) */
.downstream-card-active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    border-top: 2px solid rgba(255, 255, 255, 0.45) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 10px 20px -5px rgba(239, 68, 68, 0.4), inset 0 -5px 0 rgba(185, 28, 28, 0.6);
}

.downstream-card-active:hover {
    box-shadow: 0 16px 24px -2px rgba(239, 68, 68, 0.55), inset 0 -5px 0 rgba(185, 28, 28, 0.7);
}

/* Responsive adjustments for Top Nav Bar on Tablet and Mobile */

/* ===== Consolidated @media (sorted) ===== */

@media (max-width: 360px) {

    .analytics-horizontal-row {
        grid-template-columns: 1fr !important;
    }

}

@media (max-width: 380px) {

    .metrics-grid {
        grid-template-columns: 1fr 1fr !important;
    }

}

@media (max-width: 400px) {

    .moph-grid {
        grid-template-columns: 1fr !important;
    }

    .ds-stats-grid {
        grid-template-columns: 1fr;
    }

    .moph-card-num {
        font-size: 1.2rem !important;
    }

    div[style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: 1fr !important;
    }

    .logo-img {
        height: 36px;
    }

    .top-nav-container {
        height: 58px;
    }

    .nav-overlay {
        top: 58px;
        height: calc(100svh - 58px);
    }

    .up-wrap {
        padding: 68px 6px 12px !important;
    }

}

@media (max-width: 480px) {

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .value-chain-grid .card {
        grid-column: span 12;
        /* 1 card per row */
        min-height: auto;
    }

    .crop-grid {
        grid-template-columns: 1fr !important;
    }

    .metrics-grid {
        grid-template-columns: 1fr !important;
    }

    /* Extra narrow screens */
    .ds-stats-grid,
    .moph-grid {
        grid-template-columns: 1fr !important;
    }

    /* Inline defined grid-template-columns overrides */
    div[style*="grid-template-columns: repeat(4, 1fr)"],
    div[style*="grid-template-columns: repeat(3, 1fr)"],
    div[style*="grid-template-columns: repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
    }

    .content-wrap {
        padding: 16px 12px !important;
    }

    .news-tabs-container {
        gap: 2px !important;
        margin-bottom: -20px !important;
    }

    .news-tab {
        width: 68px !important;
        height: 68px !important;
    }

    .news-tab-content {
        font-size: 0.62rem !important;
    }

    .news-curve-bg {
        padding: 50px 12px 24px 12px !important;
    }

    .crop-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .analytics-horizontal-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .horizontal-stat-card .card-value {
        font-size: 1.2rem !important;
    }

    .gallery-swiper .swiper-slide {
        width: 220px !important;
    }

    [style*="grid-template-columns: repeat(6, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    [style*="padding: 40px 0"] {
        padding: 16px 0 !important;
    }

    .analytics-horizontal-row {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 600px) {

    .overlay-nav ul li a {
        padding: 0 24px;
        gap: 14px;
    }

    .overlay-nav ul li a span {
        font-size: 1.1rem;
    }

    .overlay-nav ul li a small {
        display: none;
    }

    .overlay-nav ul li a:hover {
        padding-left: 32px;
    }

    .overlay-auth-bar {
        padding: 14px 24px;
    }

    .top-nav-container {
        padding: 0 20px;
    }

    .logo-img {
        height: 44px;
    }

    .p-stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card {
        min-height: 240px !important;
    }

    .doc-grid-4 {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

}

@media (max-width: 640px) {

    .grid-4,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .province-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .content,
    .province-content-inner {
        padding: 16px;
    }

    .province-nav {
        justify-content: flex-start;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }



    .dashboard-grid-4 {
        grid-template-columns: 1fr;
    }

    .dashboard-grid-4 .dashboard-card {
        grid-column: span 1 !important;
    }

    .dashboard-grid-3 {
        grid-template-columns: 1fr;
    }

    .reports-grid-5 {
        grid-template-columns: 1fr;
    }

    .connectivity-grid-2 {
        grid-template-columns: 1fr;
    }

    .network-map-container {
        flex-direction: column;
        align-items: stretch;
    }

    .network-visual {
        width: 100%;
        height: 200px;
    }

    .news-grid-4 {
        grid-template-columns: 1fr !important;
    }

    .policies-grid-2 {
        grid-template-columns: 1fr !important;
    }

    .policies-grid-2 .policies-grid-2 .policies-grid-2 .projects-grid-4 {
        grid-template-columns: 1fr !important;
    }

    .research-grid-4 {
        grid-template-columns: 1fr !important;
    }

    /* Body scrollable */
    body.province-layout,
    body.admin-layout {
        height: auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .main-content {
        overflow-y: visible;
    }

    /* Nav */
    .top-nav-container {
        height: 64px;
        padding: 0 12px;
    }

    .logo-img {
        height: 44px;
    }

    .nav-overlay {
        top: 64px;
        height: calc(100svh - 64px);
    }

    .overlay-nav ul li a {
        padding: 0 20px;
        gap: 12px;
    }

    .overlay-nav ul li a span {
        font-size: 1.05rem;
    }

    .overlay-nav ul li a small {
        display: none;
    }

    .overlay-auth-bar {
        padding: 12px 20px;
        flex-wrap: wrap;
    }

    /* up-wrap */
    .up-wrap {
        padding: 74px 8px 16px !important;
    }

    /* Stats */
    .ds-stats-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .ds-stat-item {
        padding: 12px 8px;
        min-width: unset;
    }

    .ds-stat-icon {
        font-size: 1.2rem !important;
    }

    .ds-stat-value {
        font-size: 1.1rem !important;
    }

    .ds-stat-label {
        font-size: 0.68rem !important;
    }

    /* moph grid → single col */
    .moph-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    .moph-card-num {
        font-size: 1.4rem !important;
    }

    /* Summary cards (inline 4-col grid) */
    div[style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Dashboard KPI */
    .dashboard-kpi-row {
        grid-template-columns: 1fr;
    }

    .p-stats-grid {
        grid-template-columns: 1fr;
    }

    .p-main-grid {
        grid-template-columns: 1fr;
    }

    /* Upstream chart grid */
    #districtBarChart {
        min-height: 280px !important;
    }

    #productionMap {
        height: 280px !important;
    }

    /* bo layout */
    .content {
        padding: 12px 8px;
    }

    .bo-header-card {
        padding: 16px !important;
    }

    .bo-filter-card {
        padding: 14px !important;
    }

    .bo-btn {
        padding: 8px 12px !important;
        font-size: 0.82rem !important;
    }

    /* bo table full scroll */
    .bo-table-card {
        overflow-x: auto;
    }

    .bo-table {
        min-width: 560px;
        font-size: 0.8rem;
    }

    .bo-table th,
    .bo-table td {
        padding: 10px 12px !important;
    }

    /* admin layout: hide sidebar completely — place topbar */
    body.admin-layout {
        flex-direction: column !important;
    }

    .sidebar {
        display: none !important;
    }

    /* Forms */
    .bo-input-group {
        min-width: unset;
    }

    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Public page grids */
    .news-grid-4 {
        grid-template-columns: 1fr !important;
    }

    .projects-grid-4 {
        grid-template-columns: 1fr !important;
    }

    .research-grid-4 {
        grid-template-columns: 1fr !important;
    }

    .crop-grid {
        grid-template-columns: 1fr !important;
    }

    /* Policy horizontal card */




    /* Button groups */
    .frow {
        flex-direction: column;
        align-items: stretch;
    }

    .fg {
        width: 100%;
    }

    .fg input,
    .fg select {
        width: 100% !important;
    }

    /* Map legend text */
    div[style*="font-size: 0.72rem"] span {
        font-size: 0.62rem !important;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        margin-top: 0 !important;
    }

    .metric-card {
        min-height: 140px !important;
        padding: 16px 8px !important;
    }

    .metric-value-old {
        font-size: 1.3rem !important;
    }

    .metric-title-old {
        font-size: 0.8rem !important;
    }

}

@media(max-width: 640px) {

    .ds-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 650px) {

    .management-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 1200px) {
    .dashboard-gridauto {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .p-main-grid {
        grid-template-columns: 1fr;
    }

    .value-chain-grid .card {
        grid-column: span 4;
        /* 3 cards per row */
    }

    .map-wrapper {
        margin-top: 0 !important;
    }

    .analytics-horizontal-row {
        grid-template-columns: repeat(4, 1fr);
    }

}

@media(max-width:768px) {

    .content-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-gridauto {
        grid-template-columns: 1fr !important;
    }

    .news-grid-flat {
        grid-template-columns: 1fr;
    }

    .org-filter-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .org-scroller-container {
        width: 100%;
    }

    .filter-search-wrap {
        width: 100%;
    }

    .filter-search-wrap .search-box {
        width: 100%;
    }

    .filter-search-wrap .search-input {
        width: 100% !important;
    }

    .logo-img {
        height: 48px;
    }

    .top-nav-container {
        height: 70px;
        padding: 0 16px;
    }

    .page-wrapper,
    .posts-wrap {
        padding-top: 70px !important;
    }

    .content-wrap {
        padding: 0 0px;
    }

    .hero-section {
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
    }

    .hero-section-inner {
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 16px 0;
    }

    .hero-left {
        position: relative;
        top: auto;
        left: auto;
        padding: 0 16px;
        z-index: 20;
    }

    .hero-title {
        font-size: 1.4rem;
        white-space: normal;
        text-shadow: none;
        margin-bottom: 4px;
    }

    .hero-subtitle {
        font-size: 0.85rem;
        white-space: normal;
        text-shadow: none;
    }

    .hero-center-map {
        position: relative;
        height: 320px;
        width: 100%;
        padding: 0 16px;
        box-sizing: border-box;
    }

    #homeMap {
        border-radius: 12px;
        border: 1px solid #e2e8f0;
    }

    .hero-right-col {
        position: relative;
        top: auto;
        right: auto;
        align-items: stretch;
        padding: 0 16px;
        width: 100%;
        box-sizing: border-box;
        gap: 12px;
    }

    .hero-date-card {
        width: 100%;
        justify-content: space-between;
        box-sizing: border-box;
    }

    .hero-map-legend {
        max-width: none;
        width: 100%;
        box-sizing: border-box;
    }

    .value-chain-grid .card {
        grid-column: span 6;
        /* 2 cards per row */
        height: auto;
        min-height: 280px;
    }

    .crop-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* General nav */
    .top-nav-container {
        height: 70px;
        padding: 0 16px;
    }

    .logo-img {
        height: 52px;
    }

    .nav-overlay {
        top: 70px;
        height: calc(100svh - 70px);
    }

    .up-wrap {
        padding: 80px 10px 20px !important;
    }

    /* Province layout */
    .province-content-inner {
        padding: 16px 10px;
    }

    /* Dashboard KPI */
    .dashboard-kpi-row {
        grid-template-columns: 1fr 1fr;
    }

    .chart-row-top {
        grid-template-columns: 1fr;
    }

    .chart-row-maps {
        grid-template-columns: 1fr;
    }

    /* Upstream dashboard special grids (inline style overrides) */
    div[style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    div[style*="flex: 1 1 35%"],
    div[style*="flex: 1 1 60%"],
    div[style*="flex: 1 1 30%"] {
        flex: 1 1 100% !important;
        min-width: unset !important;
    }

    /* moph grid */
    .moph-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr)) !important;
    }

    /* ds-stats */
    .ds-stats-grid {
        gap: 8px;
    }

    .ds-stat-item {
        min-width: 120px;
        padding: 14px 10px;
    }

    .ds-stat-value {
        font-size: 1.4rem !important;
    }

    /* bo header */
    .bo-header-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .bo-header-card>div[style*="display: flex"] {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* bo filter */
    .bo-filter-grid {
        flex-direction: column;
    }

    .bo-input-group {
        min-width: unset;
        width: 100%;
    }

    /* bo table scroll */
    .bo-table {
        min-width: 600px;
    }

    /* card grids in province admin */
    .card-hd {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Frow (filter row) */
    .frow {
        flex-wrap: wrap;
        gap: 8px;
    }

    .fg {
        min-width: 120px;
    }

    /* d-wrap scrollable */
    .d-wrap {
        overflow-x: auto;
    }

    .dt {
        min-width: 600px;
    }

    /* Public pages news/policy/projects */
    .news-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .projects-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .research-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .policies-grid-2 {
        grid-template-columns: 1fr !important;
    }

    .hero-section-inner {
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        padding: 16px 0 !important;
    }

    .hero-left {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        padding: 0 16px !important;
        z-index: 20 !important;
        max-width: 100% !important;
    }

    .hero-title {
        font-size: 1.4rem !important;
        white-space: normal !important;
        text-shadow: none !important;
        margin-bottom: 4px !important;
    }

    .hero-subtitle {
        font-size: 0.85rem !important;
        white-space: normal !important;
        text-shadow: none !important;
    }

    .hero-center-map {
        position: relative !important;
        height: 320px !important;
        width: 100% !important;
        padding: 0 16px !important;
        box-sizing: border-box !important;
    }

    #homeMap {
        height: 320px !important;
        border-radius: 12px !important;
        border: 1px solid #e2e8f0 !important;
    }

    .hero-right-col {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        align-items: stretch !important;
        padding: 0 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        gap: 12px !important;
    }

    .hero-date-card {
        width: 100% !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
    }

    .hero-map-legend {
        max-width: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        margin-top: 20px !important;
        gap: 1px !important;
        border-radius: 12px !important;
    }

    .metric-card {
        min-height: 130px !important;
        padding: 16px 8px !important;
    }



    /* Upstream, Midstream, Downstream Stat Grid (ds-stats-grid) */
    .ds-stats-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .ds-stat-item {
        min-width: unset !important;
        flex: unset !important;
    }

    /* Moph-inspired grid layout */
    .moph-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* Filter forms layout on mobile dashboards */
    .frow,
    .bo-filter-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        align-items: stretch !important;
    }

    .fg,
    .bo-input-group {
        width: 100% !important;
        min-width: unset !important;
    }

    .fg input,
    .fg select,
    .bo-input-group input,
    .bo-input-group select {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Table Scroll wrapping */
    .bo-table-card,
    .table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        border: 1px solid #e2e8f0 !important;
        margin-bottom: 20px !important;
    }

    .bo-table,
    .table {
        min-width: 600px !important;
    }

    /* Organization horizontal scrolls on public /posts page */
    .org-scroller {
        display: flex !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        gap: 8px !important;
        padding-bottom: 8px !important;
    }

    .org-pill {
        flex-shrink: 0 !important;
    }

    div[style*="display: flex; gap: 16px; margin-bottom: 20px"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    div[style*="display: flex; gap: 16px; margin-bottom: 20px"]>div {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Adjust the quick access panel alignment inside vertical stack */
    div[style*="flex: 0 0 230px"] {
        flex: 1 1 auto !important;
        width: 100% !important;
    }

    /* --- Hide text section, show map only --- */
    .hero-split-left {
        display: none !important;
    }

    /* --- Hero section: compact, snug below nav --- */
    .hero-section {
        padding-top: 60px;
        margin-bottom: 0;
        background: #f8fafc;
    }

    /* --- Override fixed 620px height from .hero-section-inner --- */
    .hero-section-inner,
    .hero-split-layout {
        height: auto !important;
        min-height: unset !important;
        padding: 0 !important;
        gap: 0 !important;
        flex-direction: column;
    }

    /* --- Map container takes full width --- */
    .hero-split-right {
        width: 100% !important;
        height: 280px !important;
        padding: 0 !important;
        position: relative;
        order: 1;
    }

    /* --- Override absolute position on hero-center-map --- */
    .hero-center-map {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
    }

    .hero-map-wrapper {
        height: 280px !important;
        width: 100% !important;
        position: relative;
    }

    .hero-map-wrapper #homeMap {
        border-radius: 0 !important;
    }

    .hero-date-overlay {
        top: 8px;
        right: 8px;
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    .hero-legend-overlay {
        top: 8px;
        left: 8px;
        padding: 6px 10px;
    }

    .hero-map-wrapper #mapOrientBtn,
    #mapOrientBtn {
        bottom: 8px;
        right: 8px;
        left: auto !important;
        transform: none !important;
        width: auto !important;
        padding: 5px 10px;
        font-size: 0.72rem;
    }

    .page-wrapper {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .content-wrap {
        padding: 0px 0px !important;
    }

    .news-section-title {
        font-size: 1.5rem !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .btn-view-all-v2 {
        position: static !important;
        margin-top: 8px !important;
    }

    .news-tabs-container {
        gap: 3px !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        margin-bottom: -30px !important;
    }

    .news-tab {
        width: 80px !important;
        height: 80px !important;
    }

    .news-tab-content {
        font-size: 0.7rem !important;
    }

    .news-tab.active .news-tab-content {
        font-size: 0.78rem !important;
    }

    .news-curve-bg {
        padding: 40px 0px 0px 0px !important;
        border-top-left-radius: 30% 60px !important;
        border-top-right-radius: 30% 60px !important;
        min-height: 300px !important;
    }

    .news-card-v2-img {
        height: 180px !important;
    }

    .news-card-v2 {
        min-height: 300px !important;
    }

    .crop-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }

    .analytics-horizontal-row {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .horizontal-stat-card {
        height: auto !important;
        min-height: 180px !important;
        padding: 16px 10px !important;
    }

    .gallery-section-inner,
    .gallery-swiper-wrap {
        padding: 0 12px !important;
    }

    .gallery-swiper .swiper-slide {
        width: 260px !important;
    }

    .gallery-card-title {
        font-size: 0.85rem !important;
    }

    .inline-pill-bar {
        display: none !important;
    }

    [style*="grid-template-columns: repeat(6, 1fr)"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    [style*="max-width: 1200px"] {
        padding: 0 12px !important;
    }

    [style*="max-width: 1400px"],
    [style*="max-width: 1440px"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    [style*="padding: 40px 0"] {
        padding: 24px 0 !important;
    }

    .bo-header-card {
        padding: 16px 20px !important;
    }

    .header-top-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .header-top-row .bo-btn {
        width: 100% !important;
    }

    .header-actions-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
    }

    .action-buttons-group {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
        gap: 8px !important;
    }

    .import-form {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
        gap: 8px !important;
    }

    .import-form>div {
        width: 100%;
    }

    .import-form label {
        width: 100% !important;
        justify-content: center !important;
    }

    .search-form {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .search-form input {
        width: 100% !important;
    }

    .action-buttons-group .bo-btn,
    .search-form .bo-btn {
        width: 100% !important;
    }

    .preview-actions-row {
        flex-direction: column !important;
    }

    .preview-actions-row .btn {
        width: 100% !important;
        text-align: center;
    }

    .analytics-horizontal-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .top-nav-container {
        height: 64px !important;
        padding: 0 16px !important;
    }

    .logo-img {
        height: 42px !important;
    }

    .nav-overlay {
        top: 64px !important;
        height: calc(100vh - 64px) !important;
        height: calc(100svh - 64px) !important;
    }

    .hamburger-menu {
        padding: 4px !important;
    }

}

@media (max-width: 860px) {

    body {
        overflow-y: auto;
    }

    .login-container {
        flex-direction: column;
        text-align: center;
    }

    .left-side {
        padding-right: 0;
        text-align: center;
        margin-bottom: 40px;
    }

    .divider {
        display: none;
    }

    .right-side {
        padding-left: 0;
        width: 100%;
        max-width: 420px;
    }

}

@media (max-width: 992px) {

    .hero-section-inner {
        height: 340px;
    }

    .hero-left {
        left: 20px;
        bottom: 20px;
    }

    .hero-right-col {
        right: 20px;
        top: 16px;
    }

    .hero-map-legend {
        max-width: 180px;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

}

@media (max-width: 1024px) {

    .hero-side {
        display: none;
    }

    .form-side {
        flex: 1;
        padding: 40px;
    }

    .province-nav {
        width: 100%;
        flex-wrap: wrap;
    }

    .province-nav-header {
        font-size: 1rem;
        border-right: none;
        border-bottom: 1px solid rgba(226, 232, 240, 0.8);
        width: 100%;
    }

    .province-nav .nav-link {
        padding: 10px;
        font-size: 0.85rem;
    }

    .province-nav .nav-link span {
        display: inline;
    }

    /* Admin mobile sidebar */
    .sidebar {
        width: 80px;
    }

    .sidebar-header {
        font-size: 0.8rem;
        padding: 15px 5px;
    }

    .sidebar .nav-link span {
        display: none;
    }

    /* Keep text visible since it's a top nav now */
    .grid-4,
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .p-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-grid-flat {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
        margin-top: 20px;
        gap: 16px;
        border-radius: 12px;
    }

    .metric-card {
        min-height: 130px;
        padding: 16px 8px;
    }

    .news-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .crop-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .policies-grid-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .projects-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .research-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Admin sidebar → icon-only */
    body.admin-layout {
        overflow: hidden !important;
    }

    .sidebar {
        width: 64px;
        min-width: 64px;
    }

    .sidebar-header {
        padding: 12px 6px;
        font-size: 0;
        gap: 0;
        justify-content: center;
    }

    .sidebar-header img,
    .sidebar-header span {
        display: none !important;
    }

    .sidebar .nav-link span {
        display: none !important;
    }

    .sidebar .nav-link {
        justify-content: center;
        padding: 12px 8px;
        margin: 2px 6px;
    }

    .sidebar .nav-link i {
        font-size: 1.1rem;
        margin: 0 !important;
    }

    .submenu {
        display: none !important;
    }

    .content {
        padding: 20px 16px;
    }

    /* Province layout — top nav scroll */
    body.province-layout {
        overflow-y: auto !important;
        height: auto !important;
    }

    .province-content {
        overflow-y: visible;
    }

    .province-content-inner {
        padding: 20px 16px;
    }

    /* Dashboard grids */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-title-area {
        flex: none;
        width: 100%;
    }

    .dashboard-kpi-row {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
    }

    .chart-row-maps {
        grid-template-columns: 1fr;
    }

    .chart-row-top {
        grid-template-columns: 1fr 1fr;
    }

    /* ds/us/ms stat grids */
    .ds-stats-grid {
        flex-wrap: wrap;
        gap: 10px;
    }

    .ds-stat-item {
        min-width: 140px;
        flex: 1 1 140px;
    }

    /* moph grid */
    .moph-grid {
        grid-template-columns: repeat(3, minmax(120px, 1fr)) !important;
    }

    /* up-wrap */
    .up-wrap {
        padding: 100px 12px 20px !important;
    }

    /* bo tables — scrollable */
    .bo-table-card {
        overflow-x: auto;
    }

    .bo-table {
        min-width: 700px;
    }

    /* Flat layout for rotated maps on tablet & mobile */
    .map-wrapper {
        transform: none !important;
        margin-top: 0 !important;
    }

    .hero-section {
        padding-top: 70px;
    }

    .hero-split-layout {
        height: auto;
        padding: 40px 20px;
        gap: 30px;
    }

    .hero-map-wrapper {
        height: 440px;
    }

    .hero-split-left .hero-title {
        font-size: 2rem;
        white-space: normal;
    }

    .surface-section,
    .quick-access-shell {
        padding: 22px;
    }

    .metrics-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .crop-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }



    .doc-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
    }

    .top-nav-container {
        height: 70px !important;
        padding: 0 24px !important;
    }

    .logo-img {
        height: 48px !important;
    }

    .nav-overlay {
        top: 70px !important;
        height: calc(100vh - 70px) !important;
        height: calc(100svh - 70px) !important;
    }

}

@media(max-width: 1024px) {

    .chem-grid {
        grid-template-columns: 1fr;
    }

    .ds-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

}

@media (max-width: 1100px) {

    .up-wrap,
    .mid-wrap,
    .ds-wrap {
        padding-top: 92px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .moph-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .moph-card-num {
        font-size: 1.7rem !important;
    }

    div[style*="flex: 1 1 30%"],
    div[style*="flex: 1 1 calc(25% - 15px)"] {
        flex: 1 1 100% !important;
        min-width: unset !important;
    }

    .ds-stat-item {
        flex: 1 1 calc(50% - 12px);
        min-width: unset;
    }

    .management-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-section-inner {
        height: 400px !important;
    }

    .hero-title {
        font-size: 1.45rem !important;
    }

    .hero-subtitle {
        font-size: 0.85rem !important;
    }

    .metrics-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .news-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

}


@media (max-width: 1250px) {

    .inline-pill-bar {
        display: none;
    }

    .dashboard-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .dashboard-grid-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .reports-grid-5 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .hero-title {
        white-space: normal !important;
        font-size: 1.7rem !important;
        text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9) !important;
    }

    .hero-subtitle {
        white-space: normal !important;
        font-size: 0.95rem !important;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9) !important;
    }

    .hero-left {
        left: 20px !important;
        max-width: 50% !important;
    }

    .hero-right-col {
        right: 20px !important;
    }

    .inline-pill {
        min-width: 72px !important;
        padding: 4px 8px !important;
        font-size: 0.65rem !important;
        height: 64px !important;
    }

    .inline-pill i {
        font-size: 1rem !important;
    }

    .top-nav-container {
        padding: 0 24px !important;
    }

}

@media (max-width: 1280px) {
    .hero-split-left {
        gap: 0px;
    }

    .up-wrap,
    .mid-wrap,
    .ds-wrap {
        padding-top: 96px;
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Stat strip — 3 per row */
    .ds-stat-item {
        flex: 1 1 calc(33.33% - 12px);
        min-width: 120px;
    }

    .ds-stat-value {
        font-size: 1.35rem;
    }

    /* moph-grid 6-col → 4-col */
    .moph-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    /* flex chart rows — force wrap at smaller min-width */
    div[style*="flex: 1 1 35%"],
    div[style*="flex: 1 1 60%"] {
        flex: 1 1 100% !important;
        min-width: unset !important;
    }

    div[style*="flex: 1 1 30%"] {
        flex: 1 1 calc(50% - 10px) !important;
        min-width: 220px !important;
    }

    div[style*="flex: 1 1 calc(25% - 15px)"] {
        flex: 1 1 calc(50% - 10px) !important;
        min-width: 200px !important;
    }

    div[style*="flex: 1 1 calc(50% - 10px)"] {
        flex: 1 1 100% !important;
        min-width: unset !important;
    }

    /* Upstream crop product grid max-col = 4 */
    div[style*="grid-template-columns: repeat(5, minmax(140px, 220px))"] {
        grid-template-columns: repeat(4, minmax(120px, 1fr)) !important;
        justify-content: stretch !important;
    }

    /* Summary 4-col → 2-col */
    div[style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Map height reduce */
    div[style*="height: 440px"] {
        height: 340px !important;
    }

    div[style*="height: 420px"] {
        height: 320px !important;
    }

    /* Quick access panel — full width below map */
    div[style*="flex: 0 0 230px"] {
        flex: 1 1 100% !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }

    .hero-section-inner {
        height: 460px !important;
    }

    .hero-left {
        left: 24px !important;
        top: 24px !important;
    }

    .hero-title {
        font-size: 1.6rem !important;
        white-space: normal !important;
        max-width: 450px;
    }

    .hero-subtitle {
        font-size: 0.9rem !important;
        white-space: normal !important;
        max-width: 450px;
    }

    .hero-right-col {
        right: 24px !important;
        top: 24px !important;
        gap: 10px !important;
    }

    .hero-map-legend {
        max-width: 190px !important;
        padding: 10px !important;
    }

    .metrics-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        margin-top: -30px !important;
    }

    .metric-card {
        min-height: 130px !important;
        padding: 16px 16px !important;
    }

    .metric-number {
        font-size: 1.6rem !important;
    }

    .news-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

}

@media (max-width: 1366px) {
    .news-grid-flat {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1440px) {

    .up-wrap,
    .mid-wrap,
    .ds-wrap {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* moph-grid 6-col → 5-col on medium laptops */
    .moph-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

@media (max-width: 1550px) {
    .dashboard-gridauto {
        grid-template-columns: repeat(3, 1fr);
    }
}

.leaflet-pane {
    margin-top: -7px;
}

@media (max-width: 768px) {

    .hero-section-inner {
        height: 360px !important;
    }

}

@media (max-width: 768px) {
   .metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        margin-top: -30px !important;
    }
    .crop-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2px !important;
    }
    .metric-card {
        min-height: 130px !important;
        padding: 10px !important;
    }
    .hero-date-overlay {
        top: 0px;
        right: 0px;
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    #homeMap {
        height: 320px !important;
        border: 0px solid #e2e8f0 !important;
    }
    .hero-center-map {
        margin-top: 24px !important;
        height: 320px !important;
        width: 100% !important;
        padding: 14px 18px !important;
    }
    .dashboard-gridauto {
        display: block !important;
    }
    .site-footer-inner {
        display: block !important;
    }
    .news-tab-modern {
            font-size: 0.7rem !important;
            font-weight: 400 !important;
            padding: 5px !important;
            min-height: 24px !important;
    }
}
/* ═══════════════════════════════════════════════════════
   HOME: นโยบาย / โครงการ / งานวิจัย SECTION (hppr)
   ═══════════════════════════════════════════════════════ */



.hppr-section {
    margin-bottom: 52px;
}

.hppr-section:last-child {
    margin-bottom: 0;
}

.hppr-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e2e8f0;
}

.hppr-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hppr-title-icon {
    font-size: 1.1rem;
}

.hppr-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.18s ease;
}

.hppr-all-btn:hover {
    border-color: #15803d;
    color: #15803d;
    background: #f0fdf4;
}

.hppr-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.hppr-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.hppr-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
    transform: translateY(-3px);
}

.hppr-card-img {
    position: relative;
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.hppr-card-icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2.4rem;
    color: rgba(255, 255, 255, 0.4);
}

.hppr-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    color: #fff;
}

.hppr-badge-blue {
    background: rgba(37, 99, 235, 0.85);
}

.hppr-badge-purple {
    background: rgba(124, 58, 237, 0.85);
}

.hppr-badge-green {
    background: rgba(21, 128, 61, 0.85);
}

.hppr-badge-status {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    color: #fff;
}

.hppr-card-body {
    display: flex;
    flex-direction: column;
    padding: 14px 16px 12px;
    flex: 1;
    gap: 4px;
    min-height: 140px;
}

.hppr-card-org {
    font-size: 0.72rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.hppr-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hppr-card-desc {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hppr-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px solid #f1f5f9;
}

.hppr-card-type {
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hppr-read-more {
    font-size: 0.75rem;
    font-weight: 600;
    color: #15803d;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hppr-empty {
    grid-column: span 4;
    color: #94a3b8;
    font-size: 0.9rem;
    padding: 24px 0;
    text-align: center;
}

@media (max-width: 1024px) {
    .hppr-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .hppr-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hppr-title {
        font-size: 1.1rem;
    }

    .hppr-card {
        flex-direction: row !important;
        height: 110px !important;
        min-height: 110px !important;
    }

    .hppr-card-img {
        width: 100px !important;
        height: 110px !important;
        flex-shrink: 0 !important;
    }

    .hppr-card-body {
        padding: 8px 12px !important;
        min-height: auto !important;
        justify-content: space-between !important;
        gap: 2px !important;
    }

    .hppr-card-title {
        font-size: 0.82rem !important;
        line-height: 1.3 !important;
        -webkit-line-clamp: 2 !important;
    }

    .hppr-card-desc {
        display: none !important;
    }

    .hppr-card-org {
        font-size: 0.65rem !important;
    }

    .hppr-card-foot {
        padding-top: 4px !important;
        margin-top: 2px !important;
        border-top: none !important;
    }

    .hppr-read-more {
        font-size: 0.7rem !important;
    }
}

/* ─── Sticky Scrolled Capsule Navbar ─── */
@media (min-width: 993px) {
    /* Scrolled capsule container */
    .top-nav-container.scrolled {
        width: 98% !important;
        max-width: 1440px !important;
        margin: 15px auto !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: 999px !important; /* ย่อเป็นวงรีแคปซูล */
        height: 64px !important;
        padding: 0 28px !important;
        background: rgba(255, 255, 255, 0.82) !important;
        backdrop-filter: blur(20px) saturate(180%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
        border: 1px solid rgba(226, 232, 240, 0.8) !important;
        display: flex !important;
        grid-template-columns: none !important;
        grid-template-rows: none !important;
        gap: 0 !important;
    }

    /* Keep layout flat inside capsule, override 2-row laptop styling */
    .top-nav-container.scrolled .nav-brand {
        grid-column: auto !important;
        grid-row: auto !important;
        width: auto !important;
    }

    .top-nav-container.scrolled .inline-pill-bar {
        grid-column: auto !important;
        grid-row: auto !important;
        width: auto !important;
        border-top: none !important;
        padding-top: 0 !important;
        margin-left: auto !important;
        margin-right: 20px !important;
    }

    .top-nav-container.scrolled .nav-right-actions {
        grid-column: auto !important;
        grid-row: auto !important;
        margin-left: 0 !important;
    }

    /* Brand Logo / Copy shrinking */
    .top-nav-container.scrolled .logo-img {
        height: 34px !important;
    }

    .top-nav-container.scrolled .nav-brand-copy strong {
        font-size: 0.95rem !important;
        transition: font-size 0.3s ease;
    }

    .top-nav-container.scrolled .brand-divider,
    .top-nav-container.scrolled .nav-brand-copy small {
        display: none !important; /* ซ่อนรายละเอียดขีดคั่นเมื่อเลื่อนเพื่อความกะทัดรัด */
    }

    /* Shrink the pills to fit capsule */
    .top-nav-container.scrolled .inline-pill {
        height: 44px !important;
        min-width: 76px !important;
        font-size: 0.68rem !important;
        padding: 4px 10px !important;
        gap: 2px !important;
        border-radius: 999px !important; /* เมนูย่อเป็นวงรีมน */
    }

    .top-nav-container.scrolled .inline-pill i {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 992px) {
    /* Mobile/Tablet capsule shape on scroll */
    .top-nav-container.scrolled {
        width: 98% !important;
        margin: 10px auto !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: 999px !important;
        height: 58px !important;
        padding: 0 20px !important;
        background: rgba(255, 255, 255, 0.85) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08) !important;
        border: 1px solid rgba(226, 232, 240, 0.8) !important;
    }

    .top-nav-container.scrolled .logo-img {
        height: 30px !important;
    }

    .top-nav-container.scrolled .brand-divider,
    .top-nav-container.scrolled .nav-brand-copy small {
        display: none !important;
    }
}

/* Home Header Link */
.bo-header-home-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    color: #1e3a8a !important;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 800;
    transition: all 0.2s ease;
    width: 100%;
}

.bo-header-home-link:hover {
    color: #2563eb !important;
    text-decoration: none;
}

.bo-header-home-link i {
    color: #3b82f6;
    font-size: 1.4rem;
}

.swiper-pagination-bullet {
    width: 14px !important;
    height: 14px !important;
}
.swiper-pagination-bullet .swiper-pagination-bullet-active {
    margin: 6px !important;
}