/* ONDE New UI layer for the prototype screens of the offline POC package.
   Look follows proposal/theme-concept/new: green brand gradient, white cards, tinted status pills, one radius, 14px body.
   Loaded after the live admin css and proto.css, so the screens keep their markup and only change appearance. */
@font-face { font-family: 'K2D New'; font-weight: 400; src: url('../../lib/admin/fonts/K2D-Regular.woff') format('woff'), url('../../lib/admin/fonts/K2D-Regular.ttf') format('truetype'); }
@font-face { font-family: 'K2D New'; font-weight: 500 700; src: url('../../lib/admin/fonts/K2D-Bold.woff') format('woff'), url('../../lib/admin/fonts/K2D-Bold.ttf') format('truetype'); }

:root {
  --brand: #0a6b52; --brand-strong: #06493a; --brand-tint: #eaf5ee; --brand-line: #cfe6d8;
  --gray-900: #111827; --gray-500: #5b6472; --gray-200: #e5e7eb; --gray-50: #f7f8f9;
  --ok: #067647; --ok-bg: #dcfae6; --warn: #b54708; --warn-bg: #fef0c7; --bad: #b42318; --bad-bg: #fee4e2;
  --info: #175cd3; --info-bg: #e0eaff; --mute: #475467; --mute-bg: #f2f4f7;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px -6px rgba(6, 73, 58, .14);
  --focus: 0 0 0 3px rgba(10, 107, 82, .35);
  --grad: linear-gradient(120deg, #06493a 0%, #0a6b52 55%, #14946f 100%);
  --glow: radial-gradient(circle at 92% -20%, rgba(255, 255, 255, .22), transparent 42%);
  --font: 'IBM Plex Sans Thai', 'K2D New', 'K2D', Tahoma, sans-serif;
}

/* ---- type: one family everywhere except icons and code ---- */
html body, html body .content-wrapper, html body input, html body select, html body textarea, html body button,
html body .content-wrapper *:not(.fa):not(.mono):not(.code):not(.log):not(code):not(pre):not(kbd),
html body .main-header *:not(.fa):not(.sidebar-toggle), html body .main-sidebar *:not(.fa), html body .modal *:not(.fa),
html body .pt-chat *:not(.fa), html body .main-footer *:not(.fa) { font-family: var(--font) !important; }
html body { color: var(--gray-900); font-size: 14px; line-height: 1.5; }
html body .content-wrapper, html body .content { background: var(--gray-50); font-size: 14px; color: var(--gray-900); }
a { color: var(--brand); } a:hover, a:focus { color: var(--brand-strong); }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---- back office shell ---- */
html body.skin-smart .main-header { height: 56px; background: #fff !important; border-bottom: 1px solid var(--gray-200); box-shadow: 0 8px 24px -18px rgba(6, 73, 58, .5); position: fixed; top: 0; left: 0; right: 0; z-index: 1030; }
html body.skin-smart .main-header .logo { width: 230px; height: 56px; padding: 0; background: #fff url('../../lib/admin/img/logos/logo.png') no-repeat center / 170px auto !important; border-right: 1px solid var(--gray-200); }
html body.skin-smart .main-header .logo > span { display: none !important; }
html body.skin-smart .main-header .navbar { min-height: 56px; margin-left: 230px; background: #fff !important; border: 0; }
html body.skin-smart .main-header .navbar .sidebar-toggle:before { font-family: FontAwesome !important; }
html body.skin-smart .main-header .navbar .sidebar-toggle { height: 56px; padding: 0 16px; line-height: 56px; }
html body.skin-smart .main-header .navbar .nav > li > a,
html body.skin-smart .main-header .navbar .nav > li > a > span,
html body.skin-smart .main-header .navbar .nav > li > a > em,
html body.skin-smart .main-header .navbar .sidebar-toggle { color: var(--gray-900) !important; font-size: 14px; }
html body.skin-smart .main-header .navbar .sidebar-toggle:hover, html body.skin-smart .main-header .navbar .nav > li > a:hover { background: var(--brand-tint) !important; }
html body.skin-smart .main-header .navbar .nav > li { height: 56px; }
html body.skin-smart .main-header .navbar .nav > li > a { height: 56px; padding-top: 0; padding-bottom: 0; display: flex; align-items: center; gap: 8px; }
html body.skin-smart .main-header .navbar .pt-ai-top > a { margin: 10px 8px; height: 36px; border-radius: var(--radius); background: var(--brand-tint) !important; color: var(--brand-strong) !important; font-weight: 600; padding: 0 12px; }
html body.skin-smart .main-header .navbar .pt-ai-top > a > em { color: var(--brand) !important; }
html body.skin-smart .main-header .navbar .user-image { width: 32px; height: 32px; margin: 0; border-radius: 999px; }
html body.skin-smart .main-header .label-warning { background: var(--bad) !important; color: #fff; border-radius: 999px; font-size: 12px; font-weight: 600; padding: 2px 6px; }

html body.skin-smart .main-sidebar { width: 230px; padding-top: 56px; background: var(--glow), linear-gradient(180deg, #06493a 0%, #0a6b52 70%, #14946f 100%) !important; box-shadow: none; z-index: 1020; }
html body.skin-smart .main-sidebar .user-panel { display: none; }
html body.skin-smart .main-sidebar .sidebar { padding: 8px 0 24px; background: transparent !important; }
html body.skin-smart .sidebar-menu { background: transparent !important; }
html body.skin-smart .sidebar-menu > li { border: 0; }
html body.skin-smart .sidebar-menu > li > a { display: flex; align-items: center; gap: 12px; margin: 2px 8px; padding: 10px 12px; min-height: 44px; border: 0; border-radius: var(--radius); background: transparent; color: #fff !important; font-size: 14px; font-weight: 500; }
html body.skin-smart .sidebar-menu > li > a > .fa:not(.arrow) { width: 20px; height: auto; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: #fff !important; font-size: 16px; line-height: 1; text-align: center; }
html body.skin-smart .sidebar-menu > li > a > span:not(.arrow) { flex: 1; color: #fff !important; font-size: 14px; }
html body.skin-smart .sidebar-menu > li > a > .arrow { position: static; margin: 0; color: rgba(255, 255, 255, .7) !important; }
html body.skin-smart .sidebar-menu > li > a:hover, html body.skin-smart .sidebar-menu > li.menu-open > a { background: rgba(255, 255, 255, .14) !important; }
html body.skin-smart .sidebar-menu > li.active > a { background: rgba(255, 255, 255, .2) !important; box-shadow: inset 3px 0 0 #fff; }
html body.skin-smart .sidebar-menu > li > .treeview-menu { margin: 0 8px; padding: 4px 0 8px; background: transparent !important; }
html body.skin-smart .sidebar-menu .treeview-menu > li > a { display: block; margin: 0; padding: 8px 12px 8px 40px; min-height: 36px; border-radius: var(--radius); color: rgba(255, 255, 255, .88) !important; font-size: 14px; font-weight: 400; white-space: normal; background: transparent; }
html body.skin-smart .sidebar-menu .treeview-menu > li > a > .fa { width: auto; margin: 0 8px 0 -16px; padding: 0; border: 0; background: none; font-size: 6px; color: rgba(255, 255, 255, .6) !important; vertical-align: middle; }
html body.skin-smart .sidebar-menu .treeview-menu > li > a:hover { background: rgba(255, 255, 255, .14) !important; color: #fff !important; }
html body.skin-smart .sidebar-menu .treeview-menu > li.active > a { background: #fff !important; color: var(--brand-strong) !important; font-weight: 600; }
html body.skin-smart .sidebar-menu .treeview-menu > li.active > a > .fa { color: var(--brand) !important; }

html body.fixed .content-wrapper, html body .content-wrapper { margin-left: 230px; padding-top: 56px !important; min-height: calc(100vh - 56px); }
html body section.content p, html body section.content .form-control-static { padding-top: 0; font-size: 14px; line-height: 1.6; }
html body .content h3, html body .content .h3 { font-size: 18px; font-weight: 600; }
html body .content h4, html body .content .h4 { font-size: 16px; font-weight: 600; }
html body .content h5, html body .content .h5 { font-size: 14px; font-weight: 600; }
/* page title becomes the gradient hero */
html body .content-wrapper > .content-header { position: relative; overflow: hidden; margin: 24px 24px 0; padding: 24px; border-radius: var(--radius); background: var(--glow), var(--grad); color: #fff; box-shadow: 0 12px 32px -12px rgba(6, 73, 58, .55); }
html body .content-wrapper > .content-header::after { content: ''; position: absolute; right: -48px; bottom: -72px; width: 240px; height: 240px; border-radius: 999px; border: 32px solid rgba(255, 255, 255, .06); pointer-events: none; }
html body .content-header > .breadcrumb { position: relative; z-index: 1; float: none; top: auto; right: auto; display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; background: none; font-size: 12px; }
html body .content-header > .breadcrumb > li { order: 1; color: rgba(255, 255, 255, .8); font-size: 12px; }
html body .content-header > .breadcrumb > li a { color: rgba(255, 255, 255, .95) !important; }
html body .content-header > .breadcrumb > li, html body .content-header > .breadcrumb > li > span { color: rgba(255, 255, 255, .8) !important; }
html body .content-header > .breadcrumb > li.main { color: #fff !important; }
html body .content-header > .breadcrumb > li:not(.main), html body .content-header > .breadcrumb > li:not(.main) a { font-size: 12px !important; font-weight: 400 !important; line-height: 1.5 !important; }
html body .content-header > .breadcrumb > li + li::before { content: '/'; padding: 0 8px; color: rgba(255, 255, 255, .45); }
html body .content-header > .breadcrumb > li.first::before { display: none; }
html body .content-header > .breadcrumb > li.active { display: none; }
html body .content-header > .breadcrumb > li.main { order: 2; flex: 0 0 100%; margin-top: 4px; color: #fff; font-size: 24px; font-weight: 600; line-height: 1.3; }
html body .content-header > .breadcrumb > li.main::before { display: none; }
html body .content-header > .breadcrumb > li.main > span { display: none; }
html body .content-header > .breadcrumb > li.main > em { margin-right: 12px; color: rgba(255, 255, 255, .9); font-size: 20px; }
html body .content { padding: 16px 24px 24px; }

/* ---- cards ---- */
html body .content .box, html body .content .kpi, html body .content .pt-filter, html body .content .doc-page, html body .content .doc-thumb {
  border: 1px solid rgba(6, 73, 58, .08); border-top: 1px solid rgba(6, 73, 58, .08); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
html body .content .box.box-primary { border-top: 1px solid rgba(6, 73, 58, .08); }
html body .content .box-header { padding: 12px 16px; background: linear-gradient(90deg, #f3faf6, #fff); border-bottom: 1px solid rgba(6, 73, 58, .08); border-radius: var(--radius) var(--radius) 0 0; }
html body .content .box-title { font-size: 16px; font-weight: 600; color: var(--gray-900); }
html body .content .box-body { padding: 16px; }
html body .content .box-footer { padding: 8px 16px; background: #fbfdfc; border-top: 1px solid var(--gray-200); }
html body .content h3.pt-h, html body .content .pt-h { margin: 0 0 8px; color: var(--gray-900); font-size: 16px; font-weight: 600; line-height: 1.4; }
html body .content .pt-sub { margin: 0 0 16px; color: var(--gray-500); font-size: 14px; }
html body .content .pt-decide { margin: 16px -16px -16px; padding: 12px 16px; background: #fbfdfc; border-top: 1px solid var(--gray-200); border-radius: 0 0 var(--radius) var(--radius); }
html body .content .pt-decide .who { color: var(--gray-500); font-size: 14px; }
html body .content .ai-note { padding: 8px 16px; border: 1px solid var(--brand-line); border-radius: var(--radius); background: var(--brand-tint); color: var(--brand-strong); font-size: 14px; }
html body .content .ai-note em.fa { font-size: 18px; color: var(--brand); }
html body .content .ai-chip { padding: 2px 8px; border-radius: 6px; background: var(--info-bg); color: var(--info); font-size: 12px; font-weight: 600; }
html body .content .ai-conf { color: var(--gray-500); font-size: 12px; }
html body .content .src-ref { padding: 2px 8px; border-radius: var(--radius); background: var(--info-bg); color: var(--info); font-size: 12px; }

/* ---- tables ---- */
html body .content .table { margin-bottom: 0; }
html body .content .table > thead > tr > th { padding: 8px 12px; border-bottom: 1px solid var(--brand-line); background: linear-gradient(180deg, #f4faf7, #eaf5ee); color: #3b5b50; font-size: 12px; font-weight: 600; vertical-align: middle; }
html body .content .table > tbody > tr > td, html body .content .table > tfoot > tr > td { padding: 8px 12px; border-top: 1px solid var(--gray-200); font-size: 14px; vertical-align: middle; }
html body .content .table > tbody > tr:hover > td { background: #f6fbf8; }
html body .content .table-striped > tbody > tr:nth-of-type(odd) { background: var(--gray-50); }
html body .content .table-bordered { border: 1px solid var(--gray-200); }
html body .content .num, html body .content .table td.num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---- status pills: tinted, never solid ---- */
html body .content .st-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
html body .content .st-ok { background: var(--ok-bg); color: var(--ok); }
html body .content .st-wait { background: var(--warn-bg); color: var(--warn); }
html body .content .st-bad { background: var(--bad-bg); color: var(--bad); }
html body .content .st-gray { background: var(--mute-bg); color: var(--mute); }
html body .content .st-ai, html body .content .st-blue { background: var(--info-bg); color: var(--info); }
html body .content .label { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
html body .content .label-success { background: var(--ok-bg); color: var(--ok); }
html body .content .label-warning { background: var(--warn-bg); color: var(--warn); }
html body .content .label-danger { background: var(--bad-bg); color: var(--bad); }
html body .content .label-info, html body .content .label-primary { background: var(--info-bg); color: var(--info); }
html body .content .label-default { background: var(--mute-bg); color: var(--mute); }
html body .content .ck { font-size: 18px; }

/* ---- KPI, progress, findings ---- */
html body .content .kpi { padding: 16px; text-align: left; }
html body .content .kpi .kpi-l { color: var(--gray-500); font-size: 14px; }
html body .content .kpi .kpi-v { font-size: 32px; font-weight: 600; line-height: 1.2; }
html body .content .kpi .kpi-s { color: var(--gray-500); font-size: 12px; }
html body .content .pbar { height: 24px; border-radius: 999px; background: var(--mute-bg); overflow: hidden; }
html body .content .pbar > span { border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 24px; }
html body .content .finding { padding: 8px 0; border-bottom: 1px solid var(--gray-200); }
html body .content .finding .n { flex: 0 0 24px; width: 24px; height: 24px; background: var(--brand-tint) !important; color: var(--brand-strong); font-size: 12px; font-weight: 600; line-height: 24px; }
html body .content .row-eq > [class*=col-] { margin-bottom: 16px; }

/* ---- tabs, forms, buttons ---- */
html body .content .nav-tabs { border-bottom: 1px solid var(--gray-200); }
html body .content .nav-tabs > li > a { margin: 0; padding: 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--gray-500); font-size: 14px; font-weight: 500; }
html body .content .nav-tabs > li > a:hover { background: var(--brand-tint); color: var(--brand-strong); }
html body .content .nav-tabs > li.active > a, html body .content .nav-tabs > li.active > a:hover, html body .content .nav-tabs > li.active > a:focus { border: 0; border-bottom: 2px solid var(--brand); background: transparent; color: var(--brand-strong); font-weight: 600; }
html body .content .form-control, html body .modal .form-control { height: 40px; padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius); background: #fff; color: var(--gray-900); font-size: 14px; box-shadow: inset 0 1px 2px rgba(16, 24, 40, .05); }
html body .content textarea.form-control { height: auto; }
html body .content .form-control:focus, html body .modal .form-control:focus { border-color: var(--brand); box-shadow: var(--focus); }
html body .content .control-label, html body .content label { color: var(--gray-500); font-size: 14px; font-weight: 500; }
html body .btn { font-size: 14px !important; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--gray-200); border-radius: var(--radius); background: #fff; color: var(--gray-900); font-weight: 500; line-height: 1.2; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
html body .btn:hover, html body .btn:focus { border-color: var(--brand); background: #fff; color: var(--brand); }
html body .btn-sm, html body .table .btn { min-height: 32px; padding: 4px 12px; }
html body .btn-onde, html body .btn-success, html body .btn-primary { border-color: var(--brand); background: linear-gradient(135deg, #14946f, #0a6b52 60%, #06493a); color: #fff; box-shadow: 0 4px 12px -4px rgba(6, 73, 58, .55); }
html body .btn-onde:hover, html body .btn-onde:focus, html body .btn-success:hover, html body .btn-primary:hover { background: linear-gradient(135deg, #0a6b52, #06493a); color: #fff; }
html body .btn-purple, html body .btn-info { border-color: var(--brand-line); background: var(--brand-tint); color: var(--brand-strong); box-shadow: none; }
html body .btn-purple:hover, html body .btn-info:hover { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-strong); }
html body .btn-danger { border-color: #f4c7c3; background: #fff; color: var(--bad); box-shadow: none; }
html body .btn-danger:hover { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
html body .btn-warning { border-color: var(--gray-200); background: #fff; color: var(--gray-900); }
html body .pagination > li > a { border-radius: var(--radius); color: var(--gray-900); }
html body .pagination > .active > a { border-color: var(--brand); background: var(--brand); color: #fff; }
html body .modal-content { border: 0; border-radius: var(--radius); box-shadow: 0 24px 48px -12px rgba(16, 24, 40, .35); }
html body .modal-header { padding: 16px; border-bottom: 1px solid var(--gray-200); }
html body .modal-title { font-size: 16px; font-weight: 600; }

/* ---- floating AI chat ---- */
html body .pt-chat { border: 1px solid rgba(6, 73, 58, .12); border-radius: var(--radius); box-shadow: 0 24px 48px -12px rgba(16, 24, 40, .35); }
html body .pt-chat-h { padding: 12px 16px; border-radius: var(--radius) var(--radius) 0 0; background: var(--grad); color: #fff; font-size: 16px; font-weight: 600; }
html body .pt-chat-h small { color: rgba(255, 255, 255, .8); font-size: 12px; font-weight: 400; }

/* ---- phone ---- */
@media (max-width: 767px) {
  html body.skin-smart .main-header .logo { width: 100%; float: none; background-size: 140px auto !important; border-right: 0; border-bottom: 1px solid var(--gray-200); }
  html body.skin-smart .main-header { height: auto; }
  html body.skin-smart .main-header .navbar { margin-left: 0; }
  html body.skin-smart .main-sidebar { padding-top: 112px; }
  html body.fixed .content-wrapper, html body .content-wrapper { margin-left: 0; padding-top: 112px !important; }
  html body .content-wrapper > .content-header { margin: 16px 16px 0; padding: 16px; }
  html body .content-header > .breadcrumb > li.main { font-size: 18px; }
  html body .content { padding: 16px; }
  html body .content .btn { min-height: 44px; }
  html body .content .table-responsive, html body .content .box-body { overflow-x: auto; }
}

/* ---- public pages (no back office shell) on a phone ---- */
@media (max-width: 575px) {
  html body .row-eq > [class*="col-"] { min-width: 0; max-width: 100%; }
  html body[data-shell="none"] .wrap { flex-wrap: wrap; }
  html body[data-shell="none"] .ap-bar .in { flex-wrap: wrap; height: auto; padding-left: 8px; padding-right: 8px; }
  html body[data-shell="none"] .ap-bar a { min-height: 44px; padding: 0 12px; }
  html body[data-shell="none"] .nav-tabs { display: flex; flex-wrap: wrap; }
  html body[data-shell="none"] .nav-tabs > li { float: none; }
  html body[data-shell="none"] table.table { display: block; max-width: 100%; overflow-x: auto; }
  html body[data-shell="none"] .wrap > .card { width: 100%; max-width: 100%; }
  html body[data-shell="none"] .ap-top .in { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 8px; }
  html body[data-shell="none"] .ap-top .us { flex: 1 1 100%; margin-left: 0; white-space: normal; }
}
