﻿/* =====================================================
   Executive Approvals page stylesheet
   Rebuilt cleanly for executive-Approval.html + executive-Approval.js
   Uses role color tokens from css/base/role-colors.css
   ===================================================== */
  /* =========================================================
   EABaseHub — Executive Layout Shell
   Sidebar + Header + Breadcrumb + Footer
   เว้นพื้นที่กลางไว้ให้ page content ใช้งานเอง
   ========================================================= */

/* =========================================================
   ROOT
   ========================================================= */
:root{

  /* ===== Colors ===== */
  --executive: #7c3aed;
  --executive-hover: #6d28d9;

  --sidebar-bg-1: #8b5cf6;
  --sidebar-bg-2: #6d28d9;

  --page-bg: #f4f7fb;

  --surface: #ffffff;
  --surface-soft: #f8fafc;

  --text: #111827;
  --text-soft: #64748b;
  --text-light: #94a3b8;

  --border: #e5e7eb;

  --shadow-sm: 0 2px 8px rgba(15,23,42,.05);
  --shadow-md: 0 8px 24px rgba(15,23,42,.08);

  /* ===== Radius ===== */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-full: 999px;

  /* ===== Sidebar ===== */
  --sidebar-collapse: 64px;
  --sidebar-expand: 220px;

  /* ===== Header ===== */
  --header-height: 72px;

  /* ===== Motion ===== */
  --t: 180ms ease;

}


/* =========================================================
   RESET
   ========================================================= */
*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

html,
body{
  width:100%;
  min-height:100%;
}

body{
  font-family:"Kanit",sans-serif;
  background:var(--page-bg);
  color:var(--text);
  overflow-x:hidden;
}

a{
  text-decoration:none;
  color:inherit;
}

button{
  border:none;
  background:none;
  font:inherit;
}


/* =========================================================
   APP LAYOUT
   ========================================================= */
.app-layout{
  display:flex;
  min-height:100vh;
}




/* =========================================================
   SIDEBAR
   ========================================================= */


.app-sidebar.collapsed { width: 64px; }
.app-sidebar.expanded  { width: 220px; }


/* =========================================================
   SIDEBAR LOGO
   ========================================================= */
.sidebar-logo{
  height:82px;

  display:flex;
  align-items:center;

  gap:12px;

  padding:16px;

  
  flex-shrink:0;
}

.sidebar-logo-circle{
  width:38px;
  height:38px;

  border-radius:50%;
  background:#fff;

  display:flex;
  align-items:center;
  justify-content:center;

  overflow:hidden;

  flex-shrink:0;
}

.sidebar-logo-circle img{
  width:28px;
  height:28px;
  object-fit:contain;
}

.sidebar-brand-text{
  display:none;
  min-width:0;
}

.app-sidebar.expanded .sidebar-brand-text{
  display:block;
}

.sidebar-brand-title{
  font-size:15px;
  font-weight:700;
  color:#fff;
  line-height:1.2;
}

.sidebar-brand-sub{
  font-size:11px;
  color:rgba(255,255,255,.75);
  margin-top:2px;
}


/* =========================================================
   SIDEBAR NAV
   ========================================================= */
.sidebar-nav{
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 8px 0;
  position: relative;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
}


/* =========================================================
   SIDEBAR MENU
   ========================================================= */
.ea-mini-link,
.sidebar-nav-item,
.sidebar-logout{

  width:100%;
  height:48px;

  display:flex;
  align-items:center;
  justify-content:center;

  position:relative;

  overflow:hidden;

  color:rgba(255,255,255,.9);
}


/* collapsed */
.app-sidebar.collapsed .ea-mini-link,
.app-sidebar.collapsed .sidebar-logout{
  justify-content:center;
}


/* expanded */
.app-sidebar.expanded .ea-mini-link,
.app-sidebar.expanded .sidebar-logout{
  justify-content:flex-start;
  padding:0 14px;
  gap:12px;
}


/* hover */
.ea-mini-link:hover,
.sidebar-logout:hover{
  background:rgba(255,255,255,.12);
  color:#fff;
}


/* active */
/* .ea-mini-link.active{
  background:rgba(255,255,255,.16);
  color:#fff;
} */


/* icon */
.ea-mini-link .material-symbols-outlined,
.sidebar-logout .material-symbols-outlined{

  font-size:22px !important;

  flex-shrink:0;
}


/* text */
.ea-mini-text,
.nav-label{
  white-space:nowrap;
  font-size:14px;
  font-weight:500;
}


/* collapsed hide text */
.app-sidebar.collapsed .ea-mini-text,
.app-sidebar.collapsed .nav-label{
  display:none !important;
}


/* =========================================================
   SPACER
   ========================================================= */
.ea-mini-spacer{
  flex:1;
}


/* =========================================================
   DIVIDER
   ========================================================= */
.sidebar-divider{
  width:calc(100% - 16px);
  height:1px;

  margin:8px auto;

  background:
    rgba(255,255,255,.12);
}


/* =========================================================
   SIDEBAR TOGGLE BUTTON
   ========================================================= */

.sidebar-collapse-btn:hover{
  transform:scale(1.06);
}

.sidebar-collapse-btn .material-symbols-outlined{
  font-size:18px !important;
}


/* =========================================================
   HEADER
   ========================================================= */
.app-header{

  position:sticky;
  top:0;

  z-index:300;

  height:var(--header-height);

  background:rgba(255,255,255,.95);

  backdrop-filter:blur(10px);

  border-bottom:
    1px solid var(--border);

  display:flex;
  align-items:center;
  justify-content:space-between;

  gap:16px;

  padding:0 24px;

  box-shadow:var(--shadow-sm);
}


/* =========================================================
   HEADER LEFT
   ========================================================= */
.header-left{
  flex:1;
  min-width:0;
}

.header-system-name{
  display:flex;
  align-items:center;

  gap:10px;

  font-size:20px;
  font-weight:700;

  color:var(--text);
}

.header-icon{
  width:34px;
  height:34px;

  border-radius:10px;

  background:#f3e8ff;

  display:flex;
  align-items:center;
  justify-content:center;

  flex-shrink:0;
}

.header-icon .material-symbols-outlined{
  font-size:18px !important;
  color:var(--executive);
}

.header-subtitle{
  margin-top:2px;

  font-size:12px;
  color:var(--text-light);

  padding-left:44px;

  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}


/* =========================================================
   HEADER RIGHT
   ========================================================= */
.header-right{
  display:flex;
  align-items:center;
  gap:12px;
}


/* =========================================================
   BADGE / PILLS
   ========================================================= */
.page-header-badge  {

  height:40px;

  padding:0 14px;

  border-radius:var(--r-full);

  display:flex;
  align-items:center;
  gap:8px;

   background: linear-gradient(135deg, #fff7ed, #fffbeb);
  border: 1px solid #fbbf24;
  color: #92400e;
  
  font-size:13px;
  font-weight:600;

  white-space:nowrap;
}


.header-date-pill{

  height:40px;

  padding:0 14px;

  border-radius:var(--r-full);

  display:flex;
  align-items:center;
  gap:8px;

  background:#f5f3ff;

  border:
    1px solid #ddd6fe;

  color:#5b21b6;

  font-size:13px;
  font-weight:600;

  white-space:nowrap;
}

.page-header-badge .material-symbols-outlined,
.header-date-pill .material-symbols-outlined{
  font-size:18px !important;
}


/* =========================================================
   USER
   ========================================================= */
.header-user{
  display:flex;
  align-items:center;
  gap:10px;
}

.header-user-avatar{
  width:36px;
  height:36px;

  border-radius:50%;

  background:
    linear-gradient(
      135deg,
      var(--executive),
      var(--executive-hover)
    );

  display:flex;
  align-items:center;
  justify-content:center;

  color:#fff;
}

.header-user-name{
  font-size:14px;
  font-weight:500;
  color:var(--text);
}


/* =========================================================
   BREADCRUMB
   ========================================================= */
.app-breadcrumb{

  height:48px;

  background:#fff;

  border-bottom:
    1px solid var(--border);

  display:flex;
  align-items:center;

  gap:8px;

  padding:0 24px;

  font-size:14px;

  color:var(--text-soft);
}

.app-breadcrumb a{
  display:flex;
  align-items:center;
  gap:6px;
}

.app-breadcrumb a:hover{
  color:var(--executive);
}

.bc-sep{
  color:#cbd5e1;
}

.bc-current{
  display:flex;
  align-items:center;
  gap:6px;

  color:var(--executive);
  font-weight:600;
}

.app-breadcrumb .material-symbols-outlined{
  font-size:18px !important;
}


/* =========================================================
   CONTENT AREA
   เว้นไว้ให้ page ใช้งานเอง
   ========================================================= */
.container{
  flex:1;
  padding:24px;
}


/* =========================================================
   FOOTER
   ========================================================= */
.footer{

  margin-top:auto;

  height:58px;

  display:flex;
  align-items:center;
  justify-content:center;

  padding:0 24px;

  border-top:
    1px solid var(--border);

  background:#fff;

  color:var(--text-light);

  font-size:13px;
}


/* =========================================================
   TABLET
   ========================================================= */
@media (max-width:1024px){

  .header-user-name{
    display:none;
  }

  .header-subtitle{
    display:none;
  }

}


/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width:768px){

  .app-sidebar{
    width:64px !important;
  }

  .app-main{
    margin-left:64px !important;
  }

  .app-header{
    padding:0 16px;
  }

  .app-breadcrumb{
    padding:0 16px;
  }

  .container{
    padding:16px;
  }

  .header-date-pill{
  min-width: 120px;
  justify-content:center;
}

.header-date-pill span:last-child{
  display:inline !important;
}
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */
@media (max-width:520px){

  .header-system-name{
    font-size:17px;
  }

  .header-user{
    display:none;
  }

  .app-header{
    height:64px;
  }

  .app-breadcrumb{
    height:42px;
    font-size:12px;
  }

}


























:root {
  --bg-page: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-soft: #f8fafc;
  --bg-muted: #edf2f7;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-muted: #6b7280;
  --text-soft: #4b5563;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 22px;
  --transition: 180ms ease;

  --primary:      #f8fafc;
  --surface:      #ffffff;
  --surface2:     #f1f5f9;
  --surface3:     #e2e8f0;
  --accent:       #10b981;
  --accent-light: #d1fae5;
  --accent-dark:  #059669;
  --accent2:      #f59e0b;
  --accent2-light:#fef3c7;
  --accent3:      #ef4444;
  --blue:         #3b82f6;
  --blue-dark:    #0447b4;
  --blue-light:   #8dbffc;
  --blue-light1:  #aed7fd;
  --cyan-light:   #e7e7e7;
  --purple:       #8b5cf6;
  --text:         #111827;
  --text-muted:   #6b7280;
  --text-light:   #9ca3af;
  --text-med:     #5493ff;
  --border:       #e5e7eb;
  --border-accent: rgba(16,185,129,0.25);
  --shadow:       0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 24px rgba(0,0,0,0.1);
  --shadow-xl:    0 20px 60px rgba(0,0,0,0.18);
  --radius:       12px;
  --radius-sm:    8px;
  --transition:   0.15s ease;
  --unread-bg:    #f7f6b9;
  --unread-border: #f59e0b;
  --danger:       #ef4444;
  --info:         #0093ad;

  --line-radius:    #10c98b;


  
  /* Executive — ม่วง */
  --executive: #7c3aed;
  --executive-hover: #6d28d9;
  --executive-soft: #f3e8ff;
  --executive-border: #ddd6fe;
  --executive-text: #4c1d95;


   /* Alias for legacy references */
  --brand:          var(--manager);
  --brand-hover:    var(--manager-hover);
  --brand-soft:     var(--manager-soft);
  --brand-soft-2:   #dbeafe;
  --brand-light:    #93c5fd;
  --brand-strong:   var(--manager-text);

  /* ---- Sidebar gradient ---- */
  --ea-side-bg:     #0c87c9;
  --ea-side-bg-2:   #0ea5e9;
  --ea-side-hover:  rgba(255, 255, 255, 0.14);
  --ea-side-active: #0284c7;
  --ea-side-text:   #cffafe;

  /* ---- Surfaces ---- */
  --page-bg:        #f1f5f9;
  --surface:        #ffffff;
  --surface-soft:   #f8fafc;
  --surface-muted:  #f1f5f9;

  /* ---- Ink / text ---- */
  --ink:            #0f172a;
  --ink-1:          #1c1917;
  --ink-2:          #334155;
  --muted:          #64748b;
  --muted-strong:   #475569;
  --muted-soft:     #94a3b8;

  /* ---- Lines ---- */
  --line:           #e5e7eb;
  --line-soft:      #f1f5f9;
  --line-strong:    #cbd5e1;

  /* ---- Semantic ---- */
  --success:        #10b981;
  --success-text:   #047857;
  --info:           #3b82f6;
  --info-text:      #1e40af;
  --info-bg:        #dbeafe;
  --warning:        #f59e0b;
  --warning-text:   #78350f;
  --warning-bg:     #fef3c7;
  --danger:         #ef4444;
  --danger-text:    #b91c1c;
  --danger-bg:      #fee2e2;

  /* ---- Radii ---- */
  --r-sm:    8px;
  --r-md:    12px;
  --r-lg:    16px;
  --r-xl:    20px;
  --r-full:  999px;

  /* ---- Shadows ---- */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.06);

  /* ---- Motion ---- */
  --t-fast: 150ms;
  --t-base: 200ms;
  --ease:   cubic-bezier(0.16, 1, 0.3, 1);

}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Kanit", sans-serif;
  background: var(--bg-page);
  color: var(--text);
}

button, input, select, textarea {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

a { color: inherit; text-decoration: none; }


/* =====================================================
   2. RESET & BASE
   ===================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Kanit", sans-serif;
  background: var(--primary);
  color: var(--text-muted);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
}


/* =====================================================
   4. APP LAYOUT
   ===================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-main{
  flex:1;
  display:flex;
  flex-direction:column;
  min-height:100vh;

  margin-left:64px;
  width:calc(100% - 64px);

  transition:
    margin-left 0.2s ease,
    width 0.2s ease;
}


/* =========================
   SIDEBAR EXPAND LAYOUT
   ========================= */

.app-sidebar.expanded ~ .app-main{
  margin-left:220px;
  width:calc(100% - 220px);
}

.app-sidebar.collapsed ~ .app-main{
  margin-left:64px;
  width:calc(100% - 64px);
}


/* =====================================================
   5. SIDEBAR
   ===================================================== */
.app-sidebar {
  width: 64px;
  min-height: 100vh;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 400;
  background: linear-gradient(180deg, var(--executive) 0%, var(--executive-hover) 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-shadow: 2px 0 14px rgba(7, 89, 133, 0.24);
  transition: width var(--t-base) var(--ease);
  overflow: visible;
}

.app-sidebar.collapsed { width: 64px; }
.app-sidebar.expanded  { width: 220px; }

/* ── SIDEBAR LOGO ── */
.sidebar-logo {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;              /* ✅ เพิ่ม */
  transition: padding var(--t-base) var(--ease),
              gap var(--t-base) var(--ease);
}

/* ✅ เพิ่มเส้นใต้ logo (เฉพาะตอน expanded) */
.app-sidebar.expanded .sidebar-logo::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);        /* เว้นซ้าย-ขวาด้านละ 16px */
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
}

.app-sidebar.collapsed .sidebar-logo {
  height: 80px;
  padding: 18px 0 0 0;
  gap: 0;
}

.app-sidebar.expanded .sidebar-logo {
  height: auto;
  padding: 20px 12px 16px;
  gap: 10px;
}

.sidebar-logo-circle {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-logo-circle img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.sidebar-logo-circle span {
  font-size: 20px;
  font-weight: 800;
  color: #f97316;
}

/* ── BRAND TEXT (2 บรรทัด) ── */
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.15;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.sidebar-brand-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
  line-height: 1.2;
  white-space: nowrap;
}

.sidebar-brand-sub {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.4px;
  margin-top: 2px;
  white-space: nowrap;
}

.app-sidebar.collapsed .sidebar-brand-text {
  display: none;
}

.app-sidebar.expanded .sidebar-brand-text {
  display: flex;
}

/* ── SIDEBAR NAV ── */
.sidebar-nav {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 8px 0;
  position: relative;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav-item {
  width: 100%;
  height: 48px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  position: relative;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  transition: color var(--t-fast), background var(--t-fast);
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: #ffffff;
  border-radius: 0 3px 3px 0;
}

.nav-icon-wrap {
  width: 64px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-nav-item .material-symbols-outlined {
  font-size: 22px !important;
  color: inherit !important;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.sidebar-nav-item.active .material-symbols-outlined {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.sidebar-nav-item .nav-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  transition: opacity var(--t-fast) var(--ease),
              max-width var(--t-base) var(--ease),
              padding var(--t-base) var(--ease);
}

.app-sidebar.collapsed .sidebar-nav-item .nav-label {
  opacity: 0;
  max-width: 0;
  padding: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-sidebar.expanded .sidebar-nav-item .nav-label {
  opacity: 1;
  max-width: 240px;
  padding-right: 12px;
  visibility: visible;
}

/* ── SIDEBAR DIVIDER ── */
.sidebar-divider {
  width: calc(100% - 18px);
  height: 1px;
  margin: 4px 9px;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

/* ── SIDEBAR LOGOUT ── */
.sidebar-logout {
  width: 100%;
  height: 48px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  margin-bottom: 8px;
  border: none;
  background: transparent;
  font-family: "Kanit", sans-serif;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  transition: color var(--t-fast), background var(--t-fast);
}

.sidebar-logout:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-logout .material-symbols-outlined {
  width: 64px;
  font-size: 20px !important;
  color: inherit !important;
  flex-shrink: 0;
}

.sidebar-logout .nav-label {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  transition: opacity var(--t-fast) var(--ease),
              max-width var(--t-base) var(--ease);
}

.app-sidebar.collapsed .sidebar-logout .nav-label {
  opacity: 0;
  max-width: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-sidebar.expanded .sidebar-logout .nav-label {
  opacity: 1;
  max-width: 160px;
  padding-right: 12px;
  visibility: visible;
}

/* ── COLLAPSE TOGGLE BUTTON ── */
.sidebar-collapse-btn {
  position: absolute;
  right: -16px;
  top: 76px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: linear-gradient(180deg, var(--executive) 0%, var(--executive-hover) 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  transition: transform var(--transition), background var(--transition);
  z-index: 550;


  /* position: absolute;
  top: 76px;
  right: -11px;
  width: 30px;
  height: 30px;
  background: linear-gradient(180deg, var(--executive) 0%, var(--executive-hover) 100%);
  border: 1.5px solid #ffffff;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  box-shadow: 0 4px 12px rgba(7, 89, 133, 0.25),
              0 2px 4px rgba(0, 0, 0, 0.08);
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  z-index: 500; */
}

.sidebar-collapse-btn:hover {
  transform: scale(1.08);
   background: linear-gradient(180deg, var(--executive) 0%, var(--executive-hover) 100%);
  box-shadow: 0 6px 16px rgba(7, 89, 133, 0.45);
}

.sidebar-collapse-btn:active {
  transform: scale(0.96);
}

.sidebar-collapse-btn .material-symbols-outlined {
  font-size: 18px !important;
  color: var(--info-bg) !important;
  font-variation-settings: "FILL" 0, "wght" 600, "GRAD" 0, "opsz" 24;
  transition: transform var(--t-base) var(--ease);
}

.app-sidebar.collapsed .sidebar-collapse-btn .material-symbols-outlined {
  transform: rotate(0deg);
}

.app-sidebar.expanded .sidebar-collapse-btn .material-symbols-outlined {
  transform: rotate(180deg);
}

/* ── TOOLTIP ตอน collapsed ── */
.app-sidebar.collapsed .sidebar-nav-item[title]:hover::after,
.app-sidebar.collapsed .sidebar-logout[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 600;
  font-family: "Kanit", sans-serif;
}

/* =====================================================
   6. TOP HEADER
   ===================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(10px);
}

.header-left {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.header-system-name {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.header-system-name .header-icon {
  width: 32px;
  height: 32px;
  background: var(--executive-soft);
  border: 1px solid var(--executive-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-system-name .header-icon .material-symbols-outlined {
  font-size: 20px !important;
  color: var(--executive) !important;
}

.header-subtitle {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
  padding-left: 40px;
  line-height: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--executive-soft);
  border: 1px solid var(--executive-border);
  color: var(--executive-text);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.header-date-pill .material-symbols-outlined {
  font-size: 16px !important;
  color: var(--executive) !important;
  
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--executive);
  color: white;
  border: none;
  padding: 9px 16px;
  border-radius: 10px;
  font-family: "Kanit", sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

.header-action-btn:hover {
  background: var(--executive-hover);
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.35);
  transform: translateY(-1px);
}

.header-action-btn .material-symbols-outlined {
  font-size: 16px !important;
  color: white !important;
}

.header-dev-badge {
  background: #f97316;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  
}

.header-user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--executive) 0%, var(--executive-hover) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.header-user-name {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

/* ── BREADCRUMB ── */
.app-breadcrumb {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #6b7280;
}

.app-breadcrumb a {
  color: #6b7280;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-breadcrumb a:hover {
  color: var(--executive);
}

.app-breadcrumb .bc-sep {
  color: #d1d5db;
  font-size: 16px;
}

.app-breadcrumb .bc-current {
  color: var(--executive);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-breadcrumb .material-symbols-outlined {
  font-size: 14px !important;
}

/* ── PAGE CONTENT WRAPPER ── */
.app-content {
  flex: 1;
  padding: 24px;
  background: var(--page-bg);
}

/* =====================================================
   7. PAGE HEADER
   ===================================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-header p {
  color: var(--text-muted);
  margin: 4px 0 0;
  font-size: 14px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
  .app-sidebar {
    width: 56px;
  }

  .app-main {
    margin-left: 56px;
  }

  .app-header {
    padding: 0 16px;
    height: 64px;
  }

  .header-subtitle {
    display: none;
  }

  .header-date-pill {
    display: none;
  }

  .header-system-name {
    font-size: 15px;
  }

  .app-content {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .header-user-name {
    display: none;
  }
}


/* =====================================================
   SUMMARY CARDS
   ===================================================== */
.qc-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.summary-card {
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 22px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.summary-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(var(--role-rgb), 0.12);
  color: var(--role-color);
  flex-shrink: 0;
}

.summary-icon .material-symbols-outlined {
  font-size: 24px;
}

.summary-info {
  min-width: 0;
}

.summary-head {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.summary-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.summary-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* =====================================================
   FILTER PANEL
   ===================================================== */
.filter-card {
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  overflow: hidden;
}

.qc-filter-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
}

.filter-search-box {
  flex: 1;
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--bg-soft);
  border: 1px solid rgba(229, 231, 235, 0.9);
}

.filter-search-box .material-symbols-outlined {
  font-size: 20px;
  color: var(--text-muted);
}

.filter-search-box input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.btn-advance-filter,
.btn-filter-reset,
.btn-export-excel {
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  font-size: 14px;
  font-weight: 600;
}

.btn-advance-filter {
  background: rgba(59, 130, 246, 0.12);
  color: var(--role-color);
}

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

.qc-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  padding: 18px 20px 22px;
  border-top: 1px solid rgba(229, 231, 235, 0.95);
  background: #ffffff;
}

.filter-group {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 18px;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1px solid rgba(229, 231, 235, 1);
  border-radius: 16px;
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: rgba(var(--role-rgb), 0.35);
  box-shadow: 0 0 0 4px rgba(var(--role-rgb), 0.1);
}

.btn-filter-reset {
  background: var(--bg-soft);
  color: var(--text);
}

.btn-export-excel {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
}

.btn-filter-reset:hover,
.btn-export-excel:hover {
  transform: translateY(-1px);
}

/* =====================================================
   TABLE + CARD LIST
   ===================================================== */
.qc-main {
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(229, 231, 235, 0.95);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.qc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.qc-table th,
.qc-table td {
  padding: 16px 18px;
  text-align: left;
  vertical-align: top;
}

.qc-table thead th {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(229, 231, 235, 1);
  white-space: nowrap;
}

.qc-table tbody tr {
  transition: background var(--transition);
}

.qc-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.06);
}

.qc-table tbody td {
  border-bottom: 1px solid rgba(229, 231, 235, 0.95);
  color: var(--text);
}

.qc-table tbody tr:last-child td {
  border-bottom: none;
}

.cell-date {
  font-weight: 700;
  color: var(--text);
}

.cell-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.cell-title,
.cell-product {
  min-width: 180px;
}

.cell-product .cell-strong {
  margin-bottom: 8px;
}

.scope-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.12);
  color: var(--role-color);
}

.scope-pill.type-price { background: rgba(249, 115, 22, 0.12); color: #c2410c; }
.scope-pill.type-claim { background: rgba(14, 165, 233, 0.12); color: #0369a1; }
.scope-pill.type-shop { background: rgba(16, 185, 129, 0.12); color: #047857; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-badge.waiting {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.status-badge.approved {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.status-badge.rejected {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.status-badge.in-progress {
  background: rgba(249, 115, 22, 0.12);
  color: #b45309;
}

.btn-view {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--role-color), rgba(var(--role-rgb), 0.92));
  color: #fff;
  box-shadow: 0 10px 24px rgba(var(--role-rgb), 0.18);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-view:hover {
  transform: translateY(-1px);
}

.table-loading {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
}

/* Mobile card list support */
#ceoCardList {
  display: none;
  gap: 18px;
}

.qc-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

@media (max-width: 980px) {
  .qc-card-list {
    grid-template-columns: 1fr;
  }
}

.qc-card-item {
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 12px;
}

.qc-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.qc-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.qc-card-detail {
  color: var(--text-muted);
  line-height: 1.7;
  max-height: 3.6em;
  overflow: hidden;
}

.qc-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  color: var(--text-soft);
  font-size: 13px;
}

.qc-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.qc-card-foot button {
  min-width: 140px;
}

/* =====================================================
   MODAL
   ===================================================== */
.qc-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.64);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}

.qc-modal.open {
  display: flex;
}

.qc-modal-box {
  width: min(980px, 100%);
  max-height: 92vh;
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.qc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(var(--role-rgb), 0.95), rgba(var(--role-rgb), 0.75));
  color: #fff;
}

.qc-modal-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
}

.modal-close-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.qc-modal-body {
  padding: 24px;
  overflow-y: auto;
  display: grid;
  gap: 24px;
}

.modal-section {
  display: grid;
  gap: 14px;
}

.modal-section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.modal-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.info-row {
  background: var(--bg-soft);
  border: 1px solid rgba(229, 231, 235, 1);
  border-radius: 16px;
  padding: 14px 16px;
}

.info-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.modal-detail-box,
.qc-result-box {
  background: var(--bg-soft);
  border: 1px solid rgba(229, 231, 235, 1);
  border-radius: 18px;
  padding: 18px;
}

.qc-result-box {
  display: grid;
  gap: 18px;
}

.decision-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.decision-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(229, 231, 235, 1);
  background: #fff;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.decision-pill:hover {
  border-color: rgba(var(--role-rgb), 0.35);
  transform: translateY(-1px);
}

.decision-pill.approve-pill:has(input:checked),
.decision-pill.reject-pill:has(input:checked) {
  border-color: rgba(var(--role-rgb), 0.45);
  background: rgba(var(--role-rgb), 0.12);
}

.decision-pill input {
  accent-color: var(--role-color);
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(229, 231, 235, 1);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
}

.decision-pill input:checked {
  background: var(--role-color);
  border-color: var(--role-color);
}

.qc-comment-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

#execComment {
  width: 100%;
  min-height: 110px;
  border-radius: 18px;
  border: 1px solid rgba(229, 231, 235, 1);
  background: #fff;
  padding: 16px;
  resize: vertical;
  line-height: 1.6;
  color: var(--text);
}

#execComment:focus {
  outline: none;
  border-color: rgba(var(--role-rgb), 0.35);
  box-shadow: 0 0 0 4px rgba(var(--role-rgb), 0.1);
}

.signature-box {
  width: 100%;
  min-height: 160px;
  border: 2px dashed rgba(var(--role-rgb), 0.35);
  background: #fff;
  border-radius: 18px;
  position: relative;
}

.signature-box::before {
  content: "เซ็นชื่อที่นี่";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(107, 114, 128, 0.7);
  font-size: 15px;
  pointer-events: none;
}

#execSignaturePad {
  width: 100%;
  height: 100%;
  display: block;
}

.signature-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-clear-signature,
.btn-cancel,
.btn-save-draft,
#approvalDocumentPreviewBtn {
  border: none;
  border-radius: 16px;
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn-clear-signature,
.btn-cancel {
  background: #f8fafc;
  color: var(--text);
  border: 1px solid rgba(229, 231, 235, 1);
}

.btn-save-draft {
  background: linear-gradient(135deg, var(--role-color), rgba(var(--role-rgb), 0.92));
  color: #fff;
}

#approvalDocumentPreviewBtn {
  background: #fff;
  color: var(--role-color);
  border: 1px solid rgba(var(--role-rgb), 0.22);
}

.btn-save-draft:hover,
.btn-cancel:hover,
.btn-clear-signature:hover,
#approvalDocumentPreviewBtn:hover {
  transform: translateY(-1px);
}

.qc-action-btns {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 24px;
  background: #fff;
}

/* =====================================================
   LIGHTBOX
   ===================================================== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  align-items: center;
  justify-content: center;
  z-index: 10010;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 20px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* =====================================================
   DIALOG + TOAST
   ===================================================== */
.ea-dialog-overlay,
.ea-toast {
  font-family: inherit;
}

.ea-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 11000;
}

.ea-dialog-overlay.open {
  display: flex;
}

.ea-dialog-box {
  width: min(420px, 100%);
  background: #ffffff;
  border-radius: 24px;
  padding: 28px 24px 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  text-align: center;
}

.ea-dialog-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(var(--role-rgb), 0.12);
  color: var(--role-color);
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
}

.ea-dialog-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.ea-dialog-message {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.ea-dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.ea-dialog-btn {
  min-width: 130px;
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
}

.ea-dialog-cancel {
  background: #f8fafc;
  color: var(--text);
}

.ea-dialog-confirm {
  background: linear-gradient(135deg, var(--role-color), rgba(var(--role-rgb), 0.92));
  color: #fff;
}

.ea-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 11010;
  pointer-events: none;
}

.ea-toast {
  min-width: 320px;
  max-width: 380px;
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 1);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
  animation: toastIn 0.3s ease;
}

.ea-toast-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(var(--role-rgb), 0.12);
  color: var(--role-color);
}

.ea-toast-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.ea-toast-message {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.ea-toast-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1150px) {
  .qc-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .app-main {
    margin-left: 64px;
  }

  .app-sidebar.collapsed {
    width: 64px;
  }

  .app-sidebar.expanded {
    width: 220px;
  }

  .app-sidebar.collapsed .sidebar-brand-text,
  .app-sidebar.collapsed .ea-mini-text,
  .app-sidebar.collapsed .nav-label {
    display: none !important;
  }

  .app-sidebar.expanded .sidebar-brand-text {
    display: flex !important;
  }

  .qc-summary {
    grid-template-columns: 1fr;
  }

  .qc-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .qc-filter-bar {
    grid-template-columns: 1fr;
  }
  .qc-summary {
    gap: 14px;
  }
  .filter-search-box,
  .btn-advance-filter,
  .btn-filter-reset,
  .btn-export-excel {
    width: 100%;
  }
}

@media (max-width: 820px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 18px;
  }
  .header-right {
    justify-content: flex-start;
  }
  .app-breadcrumb,
  .container,
  .footer {
    padding-left: 18px;
    padding-right: 18px;
  }
  .qc-filter-compact {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-search-box,
  .btn-advance-filter { width: 100%; }
  .qc-filter-bar {
    gap: 12px;
  }
  #ceoCardList {
    display: grid;
  }
  .qc-table {
    display: none;
  }
}

@media (max-width: 720px) {
  .app-header,
  .app-breadcrumb {
    padding-left: 14px;
    padding-right: 14px;
  }
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }
  .qc-table {
    min-width: 720px;
  }
  .qc-table th,
  .qc-table td {
    padding: 12px 10px;
  }
  .filter-search-box,
  .btn-advance-filter,
  .btn-filter-reset,
  .btn-export-excel {
    width: 100%;
  }
  .qc-filter-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .app-sidebar,
  .app-sidebar.expanded {
    position: fixed;
    width: 100%;
    height: auto;
    bottom: auto;
    top: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    padding: 12px 14px 10px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .app-main {
    margin-left: 0;
    margin-top: 80px;
  }
  .app-header {
    padding: 14px 16px;
  }
  .qc-summary,
  .qc-filter-bar,
  .qc-card-item,
  .qc-action-btns {
    width: 100%;
  }
  .qc-modal-box {
    width: 100%;
    border-radius: 24px 24px 0 0;
    max-height: 92vh;
  }
  .qc-modal {
    align-items: flex-end;
    padding: 0;
  }
  .qc-filter-compact,
  .qc-filter-bar,
  .qc-modal-body,
  .qc-action-btns {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 520px) {
  .summary-card {
    padding: 16px;
  }
  .header-system-name {
    font-size: 16px;
  }
  .header-subtitle {
    font-size: 13px;
  }
  .page-header-badge,
  .header-date-pill,
  .header-user {
    padding: 10px 12px;
  }
  .qc-table {
    min-width: 620px;
  }
  .qc-table th,
  .qc-table td {
    padding: 10px 8px;
    font-size: 13px;
  }
  .qc-card-item {
    padding: 16px;
  }

  #ceoCardList {
    display: grid;
  }
  .qc-table {
    display: none;
  }
}



/* ================================
   FIX: Executive page tablet layout
   ================================ */

@media (min-width: 821px) and (max-width: 1280px) {
  .app-content,
  .container {
    padding: 20px;
  }

  .qc-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .summary-card {
    padding: 18px;
  }

  .qc-filter-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .qc-table {
    min-width: 100%;
    table-layout: fixed;
  }

  .qc-table th,
  .qc-table td {
    padding: 14px 12px;
    font-size: 13px;
  }

  .qc-table th:nth-child(1),
  .qc-table td:nth-child(1) {
    width: 95px;
  }

  .qc-table th:nth-child(2),
  .qc-table td:nth-child(2) {
    width: 105px;
  }

  .qc-table th:nth-child(3),
  .qc-table td:nth-child(3) {
    width: 210px;
  }

  .qc-table th:nth-child(4),
  .qc-table td:nth-child(4) {
    width: auto;
  }

  .qc-table th:nth-child(5),
  .qc-table td:nth-child(5) {
    width: 100px;
  }

  .qc-table th:nth-child(6),
  .qc-table td:nth-child(6) {
    width: 95px;
  }

  .qc-table th:nth-child(7),
  .qc-table td:nth-child(7) {
    width: 110px;
  }

  .cell-title,
  .cell-product {
    min-width: 0;
  }

  .btn-view {
    padding: 10px 12px;
    font-size: 13px;
    white-space: nowrap;
  }
}



.app-sidebar.collapsed .sidebar-nav-item .nav-label{
  display:none !important;
}

.app-sidebar.collapsed .sidebar-nav-item{
  justify-content:center;
}

.app-sidebar.collapsed .nav-icon-wrap{
  width:64px;
}



/* ================================
   FIX SIDEBAR FINAL
   ================================ */

/* สีไอคอนเมนู */
.sidebar-nav-item .material-symbols-outlined,
.sidebar-logout .material-symbols-outlined,
.ea-theme-toggle .material-symbols-outlined {
  color: #ffffff !important;
}

/* แถวเมนู */
.sidebar-nav-item {
  width: 100%;
  height: 48px;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* กล่องไอคอน ต้องกว้าง 64px เสมอ */
.sidebar-nav-item .nav-icon-wrap,
.sidebar-logout .nav-icon-wrap {
  width: 64px !important;
  min-width: 64px !important;
  height: 48px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  flex: 0 0 64px !important;
}

/* ตัวหนังสือตอนขยาย */
.app-sidebar.expanded .sidebar-nav-item .nav-label,
.app-sidebar.expanded .sidebar-logout .nav-label,
.app-sidebar.expanded .ea-theme-toggle .nav-label {
  display: inline-flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  max-width: 140px !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* ตัวหนังสือตอนย่อ */
.app-sidebar.collapsed .sidebar-nav-item .nav-label,
.app-sidebar.collapsed .sidebar-logout .nav-label,
.app-sidebar.collapsed .ea-theme-toggle .nav-label {
  display: none !important;
}

/* ปุ่มโหมดมืด */
.ea-theme-toggle {
  width: 100% !important;
  height: 48px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 0 !important;
}

.app-sidebar.collapsed .ea-theme-toggle {
  justify-content: center !important;
}

/* ตอนขยาย sidebar */
.app-sidebar.expanded {
  width: 220px !important;
}

/* ตอนย่อ sidebar */
.app-sidebar.collapsed {
  width: 64px !important;
}




/* =====================================================
   EXECUTIVE TABLE FIX
   ===================================================== */

.approval-table{
  width:100%;
  overflow:hidden;
}

.approval-table table{
  width:100%;
  table-layout:fixed;
  border-collapse:collapse;
}

/* ---------- HEADER + CELL ---------- */

.approval-table th,
.approval-table td{
  padding:14px 12px;
  vertical-align:top;
  word-break:break-word;
}

/* ---------- COLUMN WIDTH ---------- */

/* วันที่ */
.approval-table th:nth-child(1),
.approval-table td:nth-child(1){
  width:110px;
}

/* ประเภท */
.approval-table th:nth-child(2),
.approval-table td:nth-child(2){
  width:110px;
}

/* หัวข้อ */
.approval-table th:nth-child(3),
.approval-table td:nth-child(3){
  width:180px;
}

/* รายละเอียด */
.approval-table th:nth-child(4),
.approval-table td:nth-child(4){
  width:auto;
}

/* ความสำคัญ */
.approval-table th:nth-child(5),
.approval-table td:nth-child(5){
  width:90px;
}

/* สถานะ */
.approval-table th:nth-child(6),
.approval-table td:nth-child(6){
  width:110px;
}

/* ปุ่ม */
.approval-table th:nth-child(7),
.approval-table td:nth-child(7){
  width:120px;
}

/* ---------- TEXT ---------- */

.cell-clamp-1,
.cell-clamp-2{
  overflow:hidden;
  text-overflow:ellipsis;
}

.cell-clamp-1{
  display:-webkit-box;
  -webkit-line-clamp:1;
  -webkit-box-orient:vertical;
}

.cell-clamp-2{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}

/* ---------- BUTTON ---------- */

.btn-view{
  width:100%;
  min-width:unset;
  padding:8px 10px;
  font-size:12px;
  justify-content:center;
}

/* =====================================================
   TABLET
   ===================================================== */

@media (max-width:1180px){

  .container{
    padding:16px;
  }

  .approval-table th,
  .approval-table td{
    padding:10px 8px;
    font-size:12px;
  }

  .approval-table th:nth-child(1),
  .approval-table td:nth-child(1){
    width:95px;
  }

  .approval-table th:nth-child(2),
  .approval-table td:nth-child(2){
    width:90px;
  }

  .approval-table th:nth-child(3),
  .approval-table td:nth-child(3){
    width:150px;
  }

  .approval-table th:nth-child(5),
  .approval-table td:nth-child(5){
    width:80px;
  }

  .approval-table th:nth-child(6),
  .approval-table td:nth-child(6){
    width:95px;
  }

  .approval-table th:nth-child(7),
  .approval-table td:nth-child(7){
    width:105px;
  }

  .btn-view{
    padding:7px 8px;
    font-size:11px;
  }
}


/* ซ่อน Advance Filter ก่อน */
.advance-filter-panel,
.qc-filter-bar{
  display: none;
}

/* กดปุ่มแล้วค่อยแสดง */
.advance-filter-panel.show,
.qc-filter-bar.show{
  display: grid;
}



/* =====================================================
   FIX: Executive table badge + column balance
   ===================================================== */

.qc-table{
  width:100%;
  min-width:0 !important;
  table-layout:fixed;
}

.qc-table th,
.qc-table td{
  padding:12px 10px;
  vertical-align:middle;
}

/* ปรับขนาดคอลัมน์ให้พอดี */
.qc-table th:nth-child(1),
.qc-table td:nth-child(1){ width:95px; }

.qc-table th:nth-child(2),
.qc-table td:nth-child(2){ width:100px; }

.qc-table th:nth-child(3),
.qc-table td:nth-child(3){ width:150px; }

.qc-table th:nth-child(4),
.qc-table td:nth-child(4){ width: 150px; }

.qc-table th:nth-child(5),
.qc-table td:nth-child(5){ width:88px; }

.qc-table th:nth-child(6),
.qc-table td:nth-child(6){ width: 100px; }

.qc-table th:nth-child(7),
.qc-table td:nth-child(7){ width:100px; }

/* Badge ประเภทงาน */
.scope-pill{
  width:100px;
  height:30px;
  padding:6px 8px !important;
  border-radius:18px;
  display:inline-flex;
  /* flex-direction:column; */
  justify-content:center;
  align-items:center;
  gap:2px;
  font-size:13px !important;
  line-height:1.2;
  text-align:center;
}

.scope-pill .material-symbols-outlined{
  font-size:15px !important;
}

/* Badge สถานะ */
.status-badge{
  width:100px;
  height:30px;
  padding:6px 8px !important;
  border-radius:999px;
  display:inline-flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:2px;
  font-size:13px !important;
  line-height:1.15;
  text-align:center;
  white-space:normal;
}

/* ปุ่มจัดการ */
.btn-view{
  width:82px;
  height:36px;
  padding:0 10px !important;
  border-radius:12px;
  font-size:11px !important;
  gap:4px;
  justify-content:center;
  white-space:nowrap;
}

/* ข้อความไม่ดันตาราง */
.cell-title,
.cell-product{
  min-width:0;
}

.cell-strong,
.cell-sub{
  overflow:hidden;
  text-overflow:ellipsis;
}

/* iPad / Tablet */
@media (max-width:1180px){
  .qc-table th,
  .qc-table td{
    padding:10px 8px;
    font-size:12px;
  }

  .qc-table th:nth-child(2),
  .qc-table td:nth-child(2){
    width: 110px;
  }

  .qc-table th:nth-child(6),
  .qc-table td:nth-child(6){
    width:110px;
  }

  .scope-pill{
    width:100px;
    height:30px;
    font-size:10.5px !important;
  }

  .status-badge{
    width:100px;
    height:30px;
    font-size:10.5px !important;
  }
}



/* =====================================================
   Pending Approval Alert
   ===================================================== */

@keyframes pendingBlink {
  0%, 100% {
    border-color: #e5e7eb;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    background: #ffffff;
  }

  50% {
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.18),
                0 10px 28px rgba(124, 58, 237, 0.22);
    background: #faf5ff;
  }
}

#cardPending.has-alert {
  animation: pendingBlink 1s infinite !important;
}

#cardPending.has-alert .summary-num {
  color: #7c3aed !important;
}

#cardPending.has-alert .summary-icon {
  background: #ede9fe !important;
  color: #7c3aed !important;
}