
:root {
    --primary-orange: #EE7838;
    --primary-orange-hover: #D9652B;
    --text-dark: #4B5563;
    --background: #FFFFFF;

    /* Global Font */
    --font-primary: 'Kanit', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-primary);
    background: var(--background);
    color: var(--text-dark);
}

/* ใช้ฟอนต์ Kanit กับทุกองค์ประกอบ */
button,
input,
select,
textarea {
    font-family: var(--font-primary);
}


/* ========================================
   PREMIUM UNIVERSITY HEADER
======================================== */

.site-header {
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid #F1E9E2;
    box-shadow: 0 4px 24px rgba(40, 45, 55, 0.045);

    position: sticky;
    top: 0;
    z-index: 1000;

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.header-inner {
    min-height: 100px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}

/* Logo & Brand */

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    width: fit-content;
    min-width: 0;
}

.site-logo img {
    height: 74px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

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

.brand-name {
    font-family: 'Kanit', sans-serif;
    font-size: 21px;
    font-weight: 600;
    color: #343B46;
    letter-spacing: 0.2px;
    line-height: 1.3;
}

.brand-subtitle {
    font-size: 12px;
    font-weight: 300;
    color: #89909B;
    white-space: nowrap;
}

/* Navigation */

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 38px;
}

.desktop-nav .nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;

    padding: 12px 0;
    color: #525B68;
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    white-space: nowrap;

    transition: color 0.25s ease;
}

.desktop-nav .nav-link::after {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-orange);
    border-radius: 10px;

    transform: translateX(-50%);
    transition: width 0.25s ease;
}

.desktop-nav .nav-link:hover,
.desktop-nav .nav-link.active {
    color: var(--primary-orange);
}

.desktop-nav .nav-link:hover::after,
.desktop-nav .nav-link.active::after {
    width: 100%;
}

/* Login Button */

.header-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    padding: 13px 23px;
    border-radius: 12px;

    background: var(--primary-orange);
    color: #FFFFFF;
    text-decoration: none;

    font-family: 'Kanit', sans-serif;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;

    box-shadow: 0 5px 15px rgba(238, 120, 56, 0.16);

    transition:
        background 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.btn-login:hover {
    background: var(--primary-orange-hover);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(238, 120, 56, 0.24);
}

/* Responsive */

@media (max-width: 1100px) {
    .header-inner {
        grid-template-columns: 1fr auto;
        padding: 12px 0;
    }

    .desktop-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        gap: 28px;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .header-inner {
        gap: 12px;
    }

    .site-logo img {
        height: 55px;
    }

    .brand-name {
        font-size: 16px;
    }

    .brand-subtitle {
        font-size: 10px;
        white-space: normal;
    }

    .btn-login {
        padding: 10px 12px;
        font-size: 11px;
        gap: 5px;
    }

    .desktop-nav {
        gap: 20px;
    }

    .desktop-nav .nav-link {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .desktop-nav .nav-link,
    .desktop-nav .nav-link::after,
    .btn-login {
        transition: none;
    }
}

.genially-preview {
    display: block;
    overflow: hidden;
    border-radius: 16px;
    max-width: 850px;
    margin: 0 auto;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.genially-preview img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.genially-preview:hover img {
    transform: scale(1.02);
}


/* Genially Interactive Dashboard */

.genially-section {
    width: 100%;
    padding: 30px 20px;
    background: #FFFFFF;
}

.genially-container {
    width: 100%;
    max-width: 900px; /* ปรับให้เล็กลง */
    aspect-ratio: 16 / 9;
    margin: 0 auto;

    overflow: hidden;
    border-radius: 16px;
    border: 1px solid #EAEAEA;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.genially-container iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

/* Mobile */
@media (max-width: 768px) {
    .genially-section {
        padding: 15px;
    }

    .genially-container {
        border-radius: 10px;
    }
}


/* Strategic Plans */

.strategic-plans {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.plan-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 9px 22px;
    border-radius: 50px;

    background: #FFF3E9;
    color: #D9652B;
    border: 1px solid #F8DCC7;

    font-family: 'Kanit', sans-serif;
    font-size: 14px;
    font-weight: 400;
}

/* Dashboard */

.dashboard-heading {
    text-align: center;
    margin-bottom: 35px;
}

.dashboard-heading h2 {
    font-size: 28px;
    font-weight: 600;
    color: #343B46;
}

.dashboard-heading p {
    color: #8A8F98;
    font-size: 14px;
}

.dashboard-chart-card {
    background: #FFFFFF;
    border: 1px solid #F0E5DC;
    border-radius: 18px;
    padding: 25px;
    height: 100%;

    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.035);
    transition: transform 0.25s ease;
}

.dashboard-chart-card:hover {
    transform: translateY(-4px);
}

.chart-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
}

.chart-number {
    color: #EE7838;
    font-size: 14px;
    font-weight: 600;
}

.chart-card-header h3 {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    color: #343B46;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    max-width: 280px;
    height: 250px;
    margin: 0 auto;
}


/* ===== Live public dashboard ===== */
.dashboard-filters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) auto; align-items:end; gap:14px; padding:20px; margin-bottom:20px; border:1px solid #f0e5dc; border-radius:18px; background:#fff; box-shadow:0 6px 25px rgba(0,0,0,.035); }
.dashboard-filters label { display:block; margin-bottom:7px; font-size:13px; font-weight:500; }
.dashboard-filters .form-select, .dashboard-chart-card .form-select { border-color:#eaded4; border-radius:10px; font-size:13px; }
.dashboard-filters .form-select:focus, .dashboard-chart-card .form-select:focus { border-color:#EE7838; box-shadow:0 0 0 .2rem rgba(238,120,56,.14); }
.dashboard-filter-reset .btn { width:100%; border-radius:10px; font-size:13px; white-space:nowrap; }
.dashboard-stat { display:flex; flex-direction:column; min-height:125px; padding:19px 22px; border:1px solid #f0e5dc; border-radius:16px; background:#fff; }
.dashboard-stat span { color:#7b8490; font-size:13px; }
.dashboard-stat strong { color:#EE7838; font-size:27px; font-weight:600; overflow-wrap:anywhere; }
.dashboard-stat small { color:#9299a2; font-size:12px; }
.dashboard-chart-card--large { min-height:440px; }
.dashboard-chart-title { display:flex; align-items:start; justify-content:space-between; gap:14px; margin-bottom:18px; }
.dashboard-chart-title h3 { color:#343B46; font-size:17px; font-weight:500; margin:0 0 5px; }
.dashboard-chart-title p { color:#8a8f98; font-size:12px; margin:0; }
.dashboard-chart-select { max-width:180px; flex-shrink:0; }
.dashboard-chart-area { position:relative; width:100%; }
.dashboard-chart-area--bar { height:310px; }
.dashboard-chart-area--pie { height:295px; }
.dashboard-chart-note { min-height:24px; margin:12px 0 0; font-size:12px; color:#79818c; }
.dashboard-message { display:none; padding:11px 15px; margin-bottom:15px; background:#fff6ed; border:1px solid #f5d5bb; border-radius:10px; font-size:13px; }
.dashboard-message:not(:empty) { display:block; }
@media(max-width:991px) { .dashboard-filters { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:575px) { .dashboard-filters { grid-template-columns:1fr; padding:15px; } .dashboard-chart-title { flex-direction:column; } .dashboard-chart-select { max-width:none; width:100%; } .dashboard-chart-card--large { padding:17px; } .dashboard-chart-area--bar { height:280px; } }


/* Dashboard monthly / quarterly project summary */
.dashboard-table-card{background:#fff;border:1px solid #F0E5DC;border-radius:18px;padding:24px;box-shadow:0 6px 25px rgba(0,0,0,.035)}
.dashboard-table-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;flex-wrap:wrap;margin-bottom:20px}
.dashboard-table-heading h3{font-size:19px;font-weight:600;color:#343B46;margin:0 0 7px}
.dashboard-table-heading p{font-size:13px;color:#8A8F98;margin:0}
.dashboard-table-controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.dashboard-tab-group{display:flex;gap:5px;background:#FFF3E9;padding:5px;border-radius:12px;flex-wrap:wrap}
.dashboard-tab{border:0;background:transparent;color:#9A5B3D;border-radius:9px;padding:9px 12px;font-size:13px;cursor:pointer}
.dashboard-tab.is-active{background:#EE7838;color:#fff;box-shadow:0 3px 9px rgba(238,120,56,.2)}
.dashboard-tab:focus-visible{outline:3px solid #8E4B24;outline-offset:2px}
.dashboard-table-controls .form-select{width:auto;min-width:130px;font-size:13px}
.dashboard-table-scroll{width:100%;overflow-x:auto;border:1px solid #F0E5DC;border-radius:12px}
.dashboard-period-table{width:100%;border-collapse:separate;border-spacing:0;min-width:760px;font-size:13px}
.dashboard-period-table th,.dashboard-period-table td{padding:12px 13px;border-bottom:1px solid #F2EAE4;text-align:center;white-space:nowrap;font-variant-numeric:tabular-nums}
.dashboard-period-table th:first-child{text-align:left;min-width:190px;white-space:normal}
.dashboard-period-table thead th{background:#FFF4EB;color:#7B4B33;font-weight:600}
.dashboard-period-table tbody tr:nth-child(even){background:#FFFCF9}
.dashboard-period-table tbody tr:hover{background:#FFF7F0}
.dashboard-period-table tfoot th,.dashboard-period-table tfoot td{background:#FFF0E3;color:#8B4423;font-weight:600;border-bottom:0}
.dashboard-table-empty{text-align:center!important;color:#89909B;padding:28px!important}
.dashboard-table-card .dashboard-chart-note{margin:14px 0 0}
@media(max-width:768px){.dashboard-table-card{padding:16px}.dashboard-table-heading h3{font-size:17px}.dashboard-table-controls{width:100%}.dashboard-table-controls .form-select{flex:1}}

/* Monthly/quarterly project budget summary */
.dashboard-budget-table td:not(:first-child),.dashboard-budget-table tfoot td{text-align:right}
.dashboard-budget-table thead th:not(:first-child){text-align:right}
.dashboard-budget-table td:last-child,.dashboard-budget-table th:last-child{background:#FFF9F4;font-weight:600}
.dashboard-budget-table tfoot td:last-child{background:#FFE6D3}


/* Dashboard entrance and scroll-reveal animations */
@media (prefers-reduced-motion: no-preference) {
  .dashboard-reveal-ready .dashboard-reveal:not(.is-visible) {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
  }
  .dashboard-reveal-ready .dashboard-reveal {
    transition: opacity 650ms ease, transform 650ms cubic-bezier(.22,1,.36,1);
    transition-delay: var(--reveal-delay, 0ms);
  }
  .dashboard-reveal-ready .dashboard-reveal.is-visible {
    opacity: 1;
    transform: translate3d(0,0,0);
  }
  .dashboard-stat { transition: box-shadow .25s ease, transform .25s ease; }
  .dashboard-stat:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(79, 52, 31, .08); }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .dashboard-stat { transition: none !important; }
}
html {
    scroll-behavior: smooth;
}

#dashboard {
    scroll-margin-top: 120px;
}

.desktop-nav .nav-link.active {
    color: #EE7838 !important;
}
/* Dynamic doughnut legend */
.dashboard-share-legend{display:grid;gap:8px;margin:12px 0 0}
.dashboard-share-legend-item{display:flex;align-items:center;gap:9px;padding:7px 9px;border-radius:9px;background:#FFFCF9;font-size:12px;color:#4B5563;min-width:0}
.dashboard-share-swatch{width:11px;height:11px;flex:0 0 11px;border-radius:3px}
.dashboard-share-label{flex:1;min-width:0;overflow-wrap:anywhere}
.dashboard-share-legend-item strong{font-weight:600;text-align:right;color:#343B46;font-variant-numeric:tabular-nums}
@media(max-width:575px){.dashboard-share-legend-item{flex-wrap:wrap}.dashboard-share-legend-item strong{margin-left:20px}}

/* Scalable dashboard charts: Top N, horizontal bars and compact legends */
.dashboard-chart-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 12px}
.dashboard-chart-tools>label:not(.dashboard-chart-search){font-size:12px;color:#7B8490;white-space:nowrap}
.dashboard-chart-tools .form-select{width:auto;max-width:200px;min-width:125px;font-size:12px}
.dashboard-chart-search{flex:1;min-width:135px;margin:0}
.dashboard-chart-search .form-control{border-color:#eaded4;border-radius:10px;font-size:12px}
.dashboard-chart-search .form-control:focus{border-color:#EE7838;box-shadow:0 0 0 .2rem rgba(238,120,56,.14)}
.dashboard-bar-scroll{max-height:520px;overflow-y:auto;overflow-x:hidden;scrollbar-color:#e4c6b5 transparent}
.dashboard-chart-area--bar{height:310px;min-height:260px}
.dashboard-chart-tools[hidden]{display:none!important}
.dashboard-share-legend{max-height:290px;overflow-y:auto;scrollbar-color:#e4c6b5 transparent}
@media(max-width:575px){.dashboard-chart-tools{align-items:stretch}.dashboard-chart-search{flex-basis:100%}.dashboard-bar-scroll{max-height:430px}.dashboard-share-legend{max-height:270px}}
