/* ══════════════════════════════════════════════════════════════════
   KruPlus Master Unified App Shell — CSS (v2.0)
   Standardized to match /frontend/home.php Creative & Vibrant design
   ══════════════════════════════════════════════════════════════════ */

:root {
    --kp-primary: #1FA88A;
    --kp-primary-d: #178a71;
    --kp-primary-l: #e8f8f5;
    --kp-canvas: #f8fafc;
    --kp-card: #ffffff;
    --kp-line: rgba(226, 232, 240, 0.8);
    --kp-ink: #1e293b;
    --kp-ink-muted: #64748b;
    --kp-ink-light: #94a3b8;

    /* Backward compatibility tokens */
    --g-brand: #1FA88A;
    --g-brand-d: #178a71;
    --g-brand-ink: #0d5244;
    --g-canvas: #f8fafc;
    --g-card: #ffffff;
    --g-line: rgba(226, 232, 240, 0.8);
    --g-ink: #1e293b;
    --g-ink-s: #475569;
    --g-ink-m: #64748b;
}

/* Base Body Styling for KruPlus App Shell Pages */
body.kp-shell-page,
.gp-canvas-bg {
    font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif !important;
    background-color: #f8fafc !important;
    background-image: radial-gradient(#e2e8f0 1.2px, transparent 1.2px) !important;
    background-size: 24px 24px !important;
    color: #1e293b !important;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* ══════════════════════════════════════════════════════════════
   THAI TYPOGRAPHY & LETTER-SPACING STANDARDS FOR CURRENT & FUTURE PAGES
   มาตรฐานฟอนต์และระยะช่องไฟตัวหนา เพื่อให้อ่านง่าย สบายตา สระบน/ล่างและวรรณยุกต์ไม่ชนกัน
   ══════════════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6,
.bento-title,
.kp-action-tile span {
    font-family: 'Prompt', 'IBM Plex Sans Thai', sans-serif;
    letter-spacing: 0.015em;
}

/* ปรับระดับความหนาหัวข้อหลักให้โปร่ง สบายตา ไม่ทึบตัน */
h1, h2, h3 {
    font-weight: 700;
}

/* ผ่อนคลายคลาส tracking-tight ไม่ให้บีบตัวอักษรและสระภาษาไทย */
.tracking-tight {
    letter-spacing: 0.01em !important;
}
.tracking-tighter {
    letter-spacing: 0 !important;
}

/* ปรับความหนาให้โปร่งสวยงาม มีช่องไฟสบายตา */
.font-black {
    font-weight: 800;
    letter-spacing: 0.015em;
}
.font-extrabold {
    font-weight: 700;
    letter-spacing: 0.015em;
}
.font-bold {
    letter-spacing: 0.015em;
}

/* Smooth scroll & hidden scrollbars */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Modern Clean Tactile Card (Gold standard from home.php) */
.kp-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 20px;
    box-shadow: 0 2px 12px -2px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s, border-color 0.2s;
}

.kp-card:hover {
    box-shadow: 0 8px 24px -4px rgba(31, 168, 138, 0.12), 0 2px 6px rgba(0, 0, 0, 0.03);
    border-color: rgba(31, 168, 138, 0.25);
}

/* App Shell Layout */
.gp-page {
    display: flex;
    min-height: calc(100vh - 58px);
    width: 100%;
    position: relative;
}

.gp-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.gp-inner {
    padding: 24px 28px 48px;
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

/* Left Sidebar Sticky Styling for Desktop */
@media (min-width: 1024px) {
    #leftSidebar {
        position: sticky !important;
        top: 74px !important;
        bottom: auto !important;
        height: fit-content !important;
        max-height: none !important;
        overflow: visible !important;
        align-self: flex-start !important;
    }
}

/* Bento Navigation Items (Creative Modern Style) */
.bento-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 9px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    border: 1px solid transparent;
}

.bento-nav-item:hover {
    background-color: #f8fafc;
    transform: translateX(3px);
}

.bento-nav-item.active {
    background: linear-gradient(135deg, rgba(232, 248, 245, 0.95), rgba(240, 253, 250, 0.85));
    border-color: rgba(31, 168, 138, 0.45);
    box-shadow: 0 4px 14px -2px rgba(31, 168, 138, 0.12);
}

.bento-title {
    display: block;
    font-size: 12.5px;
    line-height: 1.2;
    color: #334155;
    font-weight: 700;
}

.bento-desc {
    display: block;
    font-size: 10px;
    line-height: 1.15;
    color: #94a3b8;
    margin-top: 1px;
}

.bento-nav-item.active .bento-title {
    color: #0d5244 !important;
    font-weight: 800;
}

.bento-nav-item.active .bento-desc {
    color: #178a71 !important;
    font-weight: 600;
}

.bento-icon-box {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-nav-item:hover .bento-icon-box {
    transform: scale(1.08);
}

/* ══════════════════════════════════════════════════════════════
   CREATIVE & VIBRANT HERO GREETING BANNER ("สดใส น่าทำงาน")
   ══════════════════════════════════════════════════════════════ */
.hero-banner-vibrant {
    position: relative;
    background: linear-gradient(135deg, #0f5446 0%, #178a71 26%, #1FA88A 55%, #2db495 78%, #0ea5e9 100%);
    border-radius: 26px;
    padding: 26px 28px;
    color: #ffffff;
    overflow: hidden;
    box-shadow: 0 16px 36px -12px rgba(31, 168, 138, 0.35), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-top: 1.5px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.hero-banner-vibrant::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.25) 1.2px, transparent 1.2px);
    background-size: 18px 18px;
    pointer-events: none;
    opacity: 0.55;
    mask-image: radial-gradient(circle at 40% 50%, black, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at 40% 50%, black, transparent 80%);
}

.hero-sun-aura {
    position: absolute;
    top: -60px;
    right: 80px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.28) 0%, rgba(245, 158, 11, 0.12) 45%, transparent 70%);
    border-radius: 50%;
    filter: blur(32px);
    pointer-events: none;
    animation: heroAuraPulse 7s ease-in-out infinite alternate;
}

.hero-cyan-glow {
    position: absolute;
    bottom: -50px;
    right: -30px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.28) 0%, rgba(14, 165, 233, 0.1) 50%, transparent 70%);
    border-radius: 50%;
    filter: blur(28px);
    pointer-events: none;
}

.hero-mint-flare {
    position: absolute;
    top: -30px;
    left: 20%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(110, 231, 183, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(24px);
    pointer-events: none;
}

@keyframes heroAuraPulse {
    0% { transform: scale(0.92) translate(0, 0); opacity: 0.7; }
    100% { transform: scale(1.15) translate(-10px, 10px); opacity: 1; }
}

.hero-glass-pill {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.hero-glass-pill:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.hero-dark-pill {
    background: rgba(4, 30, 20, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
}

.hero-dark-pill:hover {
    background: rgba(4, 30, 20, 0.45);
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}

/* Action tile styling */
.kp-action-tile {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* ══════════════════════════════════════════════════════════════════
   MASTER TOPBAR INTEGRATED BREADCRUMBS (Zero white gap)
   ══════════════════════════════════════════════════════════════════ */
#kpTopbarBreadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

#kpTopbarBreadcrumbs::-webkit-scrollbar {
    display: none;
}

#kpTopbarBreadcrumbs {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Ensure legacy / obsolete white breadcrumbs bar is permanently disabled and consumes 0px */
#kpBreadcrumbBar,
.kp-breadcrumbs-bar {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    .gp-inner { padding: 16px 14px 36px; }
}

@media (max-width: 640px) {
    .gp-inner { padding: 12px 10px 28px; }
}

@media print {
    #leftSidebar, #sidebarBackdrop, header.sticky, .no-print {
        display: none !important;
    }
    .gp-page { display: block !important; }
    .gp-inner { padding: 0 !important; max-width: 100% !important; }
    body { background: #fff !important; }
}
