
/* ===== FULL UI THEME PATCH =====
   Safe visual-only enhancement layer.
   Loaded after style.css and app.css via public/inc/head.php
*/

:root{
  --ui-bg:#f8f3ff;
  --ui-card:#ffffff;
  --ui-card-2:#fffafe;
  --ui-stroke:rgba(139,92,246,.16);
  --ui-stroke-strong:rgba(139,92,246,.28);
  --ui-title:#37205b;
  --ui-text:#54456e;
  --ui-shadow:0 16px 44px rgba(88,28,135,.10);
  --ui-shadow-soft:0 10px 26px rgba(88,28,135,.08);
  --ui-gradient:linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
  --ui-gradient-soft:linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,248,252,.96));
  --ui-success-bg:#edf8f0;
  --ui-warning-bg:#fff7eb;
  --ui-danger-bg:#fff1f2;
}

body{
  color:var(--ui-text);
  background:
    radial-gradient(1100px 560px at -10% -10%, rgba(139,92,246,.18), transparent 54%),
    radial-gradient(920px 520px at 110% 0%, rgba(236,72,153,.10), transparent 46%),
    linear-gradient(180deg, #fffafd 0%, #f9f4ff 60%, #ffffff 100%);
}

.site-content{
  padding-bottom:26px;
}

.container{
  width:min(1240px, calc(100% - 32px));
}

.topbar{
  padding:16px 0 12px;
  background:linear-gradient(180deg, rgba(255,250,253,.96), rgba(255,250,253,.78));
  border-bottom:1px solid rgba(139,92,246,.10);
  box-shadow:0 8px 28px rgba(88,28,135,.06);
}

.brand-mark{
  border-radius:22px;
  box-shadow:0 14px 36px rgba(139,92,246,.14);
}

.brand-title{
  letter-spacing:.01em;
  text-shadow:0 1px 0 rgba(255,255,255,.8);
}

.main-nav{
  gap:12px;
  padding-top:2px;
  padding-bottom:6px;
}

.nav-link{
  min-height:48px;
  padding:10px 18px;
  border-radius:18px;
  background:rgba(255,255,255,.76);
  border:1px solid rgba(139,92,246,.08);
  box-shadow:0 4px 14px rgba(139,92,246,.05);
}

.nav-link.active{
  background:var(--ui-gradient);
  box-shadow:0 16px 28px rgba(139,92,246,.22);
}

.card,
.page-hero,
.dashboard-hero,
.table-wrap,
.panel,
.summary-card,
.settings-card,
.admin-widget{
  background:var(--ui-gradient-soft);
  border:1px solid var(--ui-stroke);
  box-shadow:var(--ui-shadow);
  border-radius:28px;
}

.card{
  padding:26px;
}

.card::before{
  width:210px;
  height:210px;
  opacity:.9;
}

.page-title,
h2{
  color:var(--ui-title);
  letter-spacing:.01em;
}

h3{
  color:#4a2e77;
}

.page-subtitle,
.muted,
.small,
label,
p,
li{
  color:var(--ui-text);
}

form h3,
.section-head h3{
  border-bottom:1px solid rgba(139,92,246,.12);
}

input,
select,
textarea,
.form-control,
.form-select{
  min-height:52px;
  border-radius:18px !important;
  border:1px solid var(--ui-stroke) !important;
  background:#ffffff !important;
  color:#2d1f46 !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.85);
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

textarea{
  min-height:120px;
  padding-top:14px !important;
}

input::placeholder,
textarea::placeholder{
  color:#9387ab !important;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus{
  border-color:rgba(139,92,246,.46) !important;
  box-shadow:0 0 0 .22rem rgba(139,92,246,.12), 0 10px 24px rgba(139,92,246,.08) !important;
  transform:translateY(-1px);
}

.btn,
button,
a.btn{
  min-height:48px;
  border-radius:18px !important;
  padding:10px 18px;
  font-weight:700;
  letter-spacing:.01em;
  box-shadow:0 8px 18px rgba(139,92,246,.08);
  transition:transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.btn:hover,
button:hover,
a.btn:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 22px rgba(139,92,246,.14);
}

.btn.primary,
.btn-primary,
button.primary{
  background:var(--ui-gradient) !important;
  color:#fff !important;
  border:none !important;
}

.btn.outline,
.btn-outline-primary{
  background:#fff !important;
  color:#6d28d9 !important;
  border:1px solid rgba(139,92,246,.24) !important;
}

.btn-success-soft{
  background:var(--ui-success-bg) !important;
  color:#18794e !important;
  border:1px solid rgba(22,163,74,.16) !important;
}

.btn-warning-soft{
  background:var(--ui-warning-bg) !important;
  color:#b45309 !important;
  border:1px solid rgba(217,119,6,.18) !important;
}

.btn-danger,
.btn-danger-soft,
.danger-outline{
  background:var(--ui-danger-bg) !important;
  color:#d1435b !important;
  border:1px solid rgba(220,38,38,.18) !important;
}

.pill,
.topbar-badge,
.status-badge{
  border:1px solid rgba(139,92,246,.12);
  background:rgba(255,255,255,.92);
  box-shadow:0 6px 18px rgba(139,92,246,.06);
}

.table,
.table-modern,
#appTable,
#talentTable{
  --bs-table-bg: transparent;
  background:transparent;
  border-collapse:separate;
  border-spacing:0;
}

.table thead th,
.table-modern thead th,
#appTable thead th,
#talentTable thead th{
  position:sticky;
  top:0;
  z-index:1;
  padding:16px 14px;
  background:rgba(139,92,246,.05);
  color:#59378f;
  border-bottom:1px solid rgba(139,92,246,.12);
  font-weight:700;
  white-space:nowrap;
}

.table tbody td,
.table-modern tbody td,
#appTable tbody td,
#talentTable tbody td{
  padding:16px 14px;
  vertical-align:middle;
  border-bottom:1px solid rgba(139,92,246,.08);
  background:rgba(255,255,255,.52);
}

.table tbody tr:hover td,
.table-modern tbody tr:hover td,
#appTable tbody tr:hover td,
#talentTable tbody tr:hover td{
  background:rgba(245,237,255,.82);
}

.table-wrap,
.table-responsive{
  overflow:auto;
  border-radius:24px;
  border:1px solid rgba(139,92,246,.12);
  background:rgba(255,255,255,.72);
}

#appTable td:first-child,
#appTable th:first-child{
  width:46px;
  text-align:center;
}

#appTable td:first-child input[type="radio"],
#talentTable td:first-child input[type="radio"]{
  width:18px;
  height:18px;
  accent-color:#8B5CF6;
}

#appTable td:nth-child(2){
  font-weight:700;
  color:#25163b;
  font-size:1rem;
  letter-spacing:.02em;
}

.search-inline-form,
.dashboard-search-form{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.external-actions-grid,
.dashboard-search-doc-row,
.filter-chip-row,
.export-actions,
.auto-export-menu{
  gap:12px !important;
}

.admin-filter-btn.is-active,
.filter-chip-row .btn.is-active{
  background:rgba(139,92,246,.10) !important;
  border-color:rgba(139,92,246,.28) !important;
  box-shadow:0 0 0 4px rgba(139,92,246,.08) !important;
}

.stats-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(210px, 1fr));
  gap:16px;
}

.stat-card{
  border-radius:24px;
  background:#fff;
  border:1px solid rgba(139,92,246,.12);
  box-shadow:var(--ui-shadow-soft);
  padding:18px;
}

.stat-number{
  color:#6d28d9;
  font-size:30px;
  line-height:1.1;
}

.footer{
  margin-top:18px;
  padding:18px 0 26px;
}

.footer-inner{
  width:min(1240px, calc(100% - 32px));
  margin:0 auto;
  padding:18px 20px;
  border-radius:24px;
  background:rgba(255,255,255,.78);
  border:1px solid rgba(139,92,246,.10);
  box-shadow:0 10px 28px rgba(88,28,135,.06);
  text-align:center;
}

.footer-title{
  color:#55348a;
  font-weight:700;
  margin-bottom:6px;
}

.footer-note{
  color:#7c6e96;
  font-family:"Sarabun",sans-serif;
}

/* admin action layout */
.external-actions-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(190px, 1fr));
  align-items:stretch;
}

.external-actions-grid .btn,
.external-actions-grid button{
  width:100%;
}

.dashboard-subtools{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.dashboard-search-doc-row{
  display:grid;
  grid-template-columns:minmax(260px, 1fr) minmax(280px, 420px);
  align-items:start;
}

.dashboard-doc-actions{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

.talent-action-group,
.talent-radio-group{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
}

/* cards and summary blocks */
.summary-box,
.metric-card,
.info-card{
  border-radius:24px;
  border:1px solid rgba(139,92,246,.12);
  background:#fff;
  box-shadow:var(--ui-shadow-soft);
  padding:18px;
}

/* mobile */
@media (max-width: 980px){
  .topbar-inner{
    align-items:flex-start;
    flex-direction:column;
  }
  .topbar-meta{
    justify-content:flex-start;
  }
  .dashboard-search-doc-row{
    grid-template-columns:1fr;
  }
}

@media (max-width: 768px){
  .container{
    width:min(100% - 20px, 1240px);
  }
  .card,
  .page-hero,
  .dashboard-hero{
    padding:18px;
    border-radius:22px;
  }
  .page-title,
  h2{
    font-size:clamp(22px, 6vw, 32px);
  }
  .nav-link{
    min-height:44px;
    padding:9px 14px;
    border-radius:14px;
  }
  .table thead th,
  .table tbody td,
  #appTable thead th,
  #appTable tbody td,
  #talentTable thead th,
  #talentTable tbody td{
    padding:13px 10px;
  }
  .search-inline-form,
  .dashboard-search-form{
    flex-direction:column;
    align-items:stretch;
  }
  .search-inline-form > *,
  .dashboard-search-form > *{
    width:100%;
  }
  .btn,
  button,
  a.btn{
    min-height:46px;
  }
}

@media (max-width: 520px){
  .brand{
    align-items:flex-start;
  }
  .brand-mark{
    width:52px;
    height:52px;
    flex-basis:52px;
    border-radius:16px;
  }
  .brand-title{
    font-size:22px;
  }
  .topbar-badge,
  .pill,
  .status-badge{
    min-height:34px;
    padding:6px 12px;
    font-size:12px;
  }
  #appTable td:nth-child(2){
    font-size:.95rem;
  }
}

/* ===== Admin sidebar / report import preview patch ===== */
.admin-site-content{padding-top:18px}
.admin-shell{display:grid;grid-template-columns:300px minmax(0,1fr);gap:24px;align-items:start}
.admin-main{min-width:0}
.sidebar-toggle,.sidebar-close{display:none;border:1px solid rgba(139,92,246,.18);background:#fff;border-radius:16px;width:46px;height:46px;color:#6d28d9;box-shadow:0 8px 18px rgba(139,92,246,.12)}
.sidebar-toggle i,.sidebar-close i{font-size:1.35rem}
.admin-sidebar{position:sticky;top:18px;background:var(--ui-gradient-soft);border:1px solid var(--ui-stroke);box-shadow:var(--ui-shadow);border-radius:28px;padding:18px;z-index:25}
.admin-sidebar__head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px;padding-bottom:14px;border-bottom:1px solid rgba(139,92,246,.10)}
.admin-sidebar__eyebrow{font-size:.82rem;color:#8b5cf6;font-weight:700;margin-bottom:4px}
.admin-sidebar__title{font-size:1.2rem;color:var(--ui-title);font-weight:700}
.admin-side-nav{display:flex;flex-direction:column;gap:10px}
.admin-side-link{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:18px;border:1px solid rgba(139,92,246,.12);background:rgba(255,255,255,.72);text-decoration:none;color:var(--ui-title);font-weight:600;box-shadow:0 6px 16px rgba(139,92,246,.06);transition:.18s ease}
.admin-side-link i{color:#8b5cf6}
.admin-side-link:hover{transform:translateX(2px);background:#fff}
.admin-side-link.active{background:var(--ui-gradient);color:#fff;border-color:transparent;box-shadow:0 16px 28px rgba(139,92,246,.22)}
.admin-side-link.active i{color:#fff}
.admin-overlay{position:fixed;inset:0;background:rgba(27,17,43,.42);backdrop-filter:blur(2px);z-index:35}
.preview-summary-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:18px}
.summary-metric{background:rgba(255,255,255,.88);border:1px solid rgba(139,92,246,.12);border-radius:20px;padding:14px 16px;box-shadow:0 8px 18px rgba(139,92,246,.08)}
.summary-metric__label{font-size:.9rem;color:#7c6a98;margin-bottom:6px}
.summary-metric__value{font-size:1.45rem;color:var(--ui-title);font-weight:700}
.preview-table{font-size:.95rem}
.badge-soft{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-weight:700;font-size:.85rem}
.badge-soft.ready{background:#eef9f1;color:#1c7c4e}
.badge-soft.invalid{background:#fff0f1;color:#c23852}
.badge-soft.duplicate{background:#fff6e8;color:#b87400}
.note-list{margin:0;padding-left:18px}
.note-list li{margin-bottom:4px}
.import-toolbar{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;margin-bottom:18px}
.sticky-actions{position:sticky;bottom:12px;display:flex;gap:12px;flex-wrap:wrap;justify-content:flex-end;margin-top:16px;padding-top:12px}
@media (max-width: 1199.98px){.preview-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width: 991.98px){
  .container{width:min(100%, calc(100% - 20px))}
  .topbar .container{width:min(100%, calc(100% - 16px))}
  .main-nav{display:none}
  .sidebar-toggle,.sidebar-close{display:inline-flex;align-items:center;justify-content:center}
  .admin-shell{grid-template-columns:1fr}
  .admin-sidebar{position:fixed;top:0;left:0;bottom:0;width:min(86vw,320px);border-radius:0 28px 28px 0;transform:translateX(-105%);transition:transform .22s ease;overflow:auto;padding-top:22px;z-index:40}
  .admin-sidebar.is-open{transform:translateX(0)}
  body.sidebar-open{overflow:hidden}
}
@media (max-width: 767.98px){
  .topbar-inner{align-items:flex-start;gap:12px}
  .brand{align-items:flex-start;gap:10px}
  .brand-copy{min-width:0}
  .brand-title{font-size:1.7rem;line-height:1.08}
  .brand-sub{font-size:.92rem}
  .topbar-meta{width:100%;justify-content:flex-start;gap:10px;flex-wrap:wrap}
  .topbar-badge,.logout{font-size:.95rem}
  .card{padding:18px}
  .preview-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .table-responsive{border-radius:18px}
  .sticky-actions{position:static;justify-content:stretch}.sticky-actions .btn{width:100%}
}
@media (max-width: 575.98px){
  .preview-summary-grid{grid-template-columns:1fr}
  .summary-metric__value{font-size:1.3rem}
  .brand-mark{width:62px;height:62px}
  .brand-title{font-size:1.45rem}
}


/* ===== admin ui cleanup v2 ===== */
.admin-page-stack{display:flex;flex-direction:column;gap:24px}
.settings-clean-grid,.import-layout-grid{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:24px;align-items:start}
.settings-main-col,.import-main-col,.settings-side-col,.import-side-col{min-width:0}
.settings-form-stack{display:flex;flex-direction:column;gap:24px}
.settings-clean-hero .dashboard-hero__content{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;flex-wrap:wrap}
.section-title-row{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap;margin-bottom:18px}
.status-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.status-summary-card{padding:18px;border-radius:22px;background:rgba(255,255,255,.84);border:1px solid rgba(139,92,246,.12);box-shadow:0 8px 18px rgba(139,92,246,.08)}
.status-summary-card__label{font-size:.82rem;color:#8b5cf6;font-weight:700;margin-bottom:6px;text-transform:uppercase;letter-spacing:.08em}
.status-summary-card__value{font-size:1rem;line-height:1.55;color:var(--ui-title);font-weight:700}
.status-summary-card__meta{margin-top:8px;color:#7b6b98;font-size:.92rem}
.status-summary-card__value.is-ok{color:#177b51}
.status-summary-card__value.is-danger{color:#c23852}
.field-grid{display:grid;grid-template-columns:1fr;gap:18px}
.field-grid.two-col{grid-template-columns:repeat(2,minmax(0,1fr))}
.field-block{display:flex;flex-direction:column;gap:8px}
.field-block.full-span{grid-column:1/-1}
.settings-help-card h3{margin-bottom:10px}
.help-list{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:10px}
.help-list.compact{gap:8px}
.settings-actions-bar{background:rgba(255,255,255,.55);padding:14px 0 0}
code{padding:.15rem .45rem;border-radius:8px;background:#f4ecff;color:#6d28d9}
.report-table-mobile-cards td[data-label]::before{display:none}

@media (max-width: 1199.98px){
  .settings-clean-grid,.import-layout-grid{grid-template-columns:1fr}
}
@media (max-width: 991.98px){
  .admin-site-content{padding-top:14px}
  .admin-sidebar{width:min(88vw,320px)}
  .settings-clean-hero .dashboard-hero__content{align-items:stretch}
}
@media (max-width: 767.98px){
  .status-summary-grid,.field-grid.two-col{grid-template-columns:1fr}
  .section-title-row{align-items:stretch}
  .section-title-row > *{width:100%}
  .section-title-row .btn,.section-title-row .pill{width:100%;justify-content:center}
  .report-table-mobile-cards thead{display:none}
  .report-table-mobile-cards,.report-table-mobile-cards tbody,.report-table-mobile-cards tr,.report-table-mobile-cards td{display:block;width:100%}
  .report-table-mobile-cards tr{border-bottom:1px solid rgba(139,92,246,.10);padding:12px 0}
  .report-table-mobile-cards td{border:none !important;padding:8px 0 !important;background:transparent !important}
  .report-table-mobile-cards td[data-label]::before{content:attr(data-label);display:block;font-size:.8rem;color:#8b5cf6;font-weight:700;margin-bottom:2px}
}

.report-export-grid{grid-template-columns:repeat(auto-fit,minmax(220px,1fr));margin-top:12px}
.report-mini-stats,.report-stats-grid{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));margin-top:18px}
.report-stats-layout{display:grid;grid-template-columns:1.2fr .9fr;gap:20px}
@media (max-width: 991.98px){.report-stats-layout{grid-template-columns:1fr}}

/* ===== report confirm ui hotfix ===== */
.confirm-choice-box{
  border:1px solid rgba(139,92,246,.14);
  background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(250,245,255,.88));
  border-radius:22px;
  padding:20px;
  margin-top:8px;
}
.confirm-choice-title{
  font-size:1.25rem;
  font-weight:800;
  color:var(--ui-title);
  margin-bottom:4px;
}
.confirm-choice-help{
  color:#6f618b;
  font-weight:600;
  margin-bottom:14px;
}
.confirm-check-card{
  position:relative;
  display:flex;
  align-items:center;
  gap:12px;
  border:1.5px solid rgba(139,92,246,.16);
  border-radius:18px;
  padding:14px 16px;
  margin-bottom:12px;
  background:#fff;
  cursor:pointer;
  transition:.18s ease;
}
.confirm-check-card:hover{
  border-color:rgba(139,92,246,.32);
  box-shadow:0 10px 24px rgba(139,92,246,.08);
}
.confirm-check-card.is-active{
  border-color:#8b5cf6;
  background:rgba(244,236,255,.88);
  box-shadow:0 10px 24px rgba(139,92,246,.12);
}
.confirm-check-card--danger.is-active{
  border-color:#e25575;
  background:#fff3f6;
}
.confirm-check{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.confirm-check-icon{
  width:22px;
  height:22px;
  min-width:22px;
  border-radius:999px;
  border:2px solid #9b8bb7;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:transparent;
  background:#fff;
  transition:.18s ease;
}
.confirm-check-icon i{
  font-size:.72rem;
}
.confirm-check-card.is-active .confirm-check-icon{
  border-color:#8b5cf6;
  background:#8b5cf6;
  color:#fff;
}
.confirm-check-card--danger.is-active .confirm-check-icon{
  border-color:#e25575;
  background:#e25575;
}
.confirm-check-text{
  font-size:1rem;
  line-height:1.5;
  color:var(--ui-title);
  font-weight:700;
}
.report-modal{
  position:fixed;
  inset:0;
  z-index:1200;
  display:none;
}
.report-modal.is-open{
  display:block;
}
.report-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(29,15,50,.48);
  backdrop-filter:blur(2px);
}
.report-modal__dialog{
  position:relative;
  width:min(92vw,560px);
  margin:10vh auto 0;
  background:#fff;
  border-radius:26px;
  border:1px solid rgba(139,92,246,.14);
  box-shadow:0 24px 60px rgba(47,21,91,.22);
  padding:24px;
}
.report-modal__badge{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  background:#f1e8ff;
  color:#7c3aed;
  font-size:.82rem;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  margin-bottom:12px;
}
.report-modal__badge--danger{
  background:#ffe3ea;
  color:#c23852;
}
.btn-danger{
  background:linear-gradient(135deg,#e25575,#d53f8c) !important;
  color:#fff !important;
  border-color:transparent !important;
}
@media (max-width: 767.98px){
  .confirm-choice-box{padding:16px}
  .confirm-choice-title{font-size:1.1rem}
  .confirm-check-card{padding:12px 14px;align-items:flex-start}
  .confirm-check-text{font-size:.96rem}
  .report-modal__dialog{width:min(94vw,560px);padding:20px;margin-top:7vh}
}


.no-sidebar-shell{max-width:1180px;margin:0 auto;}
.admin-main--full{width:100%;max-width:100%;padding-left:0;}
.admin-main--full .page-hero,.admin-main--full .card{box-shadow:0 12px 36px rgba(107,70,193,.08);}
.history-actions{display:flex;gap:8px;justify-content:flex-end;align-items:center;flex-wrap:wrap;}
.btn.btn-danger-soft{background:linear-gradient(135deg,#ef4444,#f97316);color:#fff;border:none;box-shadow:0 10px 24px rgba(239,68,68,.18);}
.btn.btn-danger-soft:hover{filter:brightness(.98);color:#fff;}
.btn.btn-sm{padding:.5rem .9rem;border-radius:12px;font-size:.92rem;}


/* login/full-width shell hotfix */
.no-sidebar-shell{display:block !important;width:min(1180px, calc(100% - 32px));margin:0 auto;}
.admin-main--full{display:block;width:100%;max-width:100%;padding-left:0;}
.admin-main--full > .card,.admin-main--full > .page-hero{width:100%;}
@media (max-width: 991.98px){.no-sidebar-shell{width:min(100%, calc(100% - 20px));}}


/* ===== 2026-04 light rebrand patch: softer palette + mobile-safe ===== */
:root{
  --ui-bg:#fcfaff;
  --ui-card:#ffffff;
  --ui-card-2:#fffdfd;
  --ui-stroke:rgba(167,139,250,.14);
  --ui-stroke-strong:rgba(167,139,250,.24);
  --ui-title:#4b3a67;
  --ui-text:#6f6386;
  --ui-shadow:0 14px 34px rgba(148,163,184,.10);
  --ui-shadow-soft:0 8px 22px rgba(148,163,184,.08);
  --ui-gradient:linear-gradient(135deg,#9f7aea 0%,#f9a8d4 100%);
  --ui-gradient-soft:linear-gradient(180deg,rgba(255,255,255,.98),rgba(255,251,255,.94));
}
body{
  background:
    radial-gradient(980px 520px at 0% 0%, rgba(221,214,254,.62), transparent 58%),
    radial-gradient(880px 480px at 100% 4%, rgba(251,207,232,.38), transparent 46%),
    linear-gradient(180deg,#fffdfd 0%,#fbf8ff 56%,#ffffff 100%);
}
.topbar,
.admin-topbar{
  background:linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,251,255,.84));
  border-bottom:1px solid rgba(167,139,250,.12);
  box-shadow:0 8px 24px rgba(148,163,184,.08);
}
.brand-title,.page-title,h2,h3,.admin-sidebar__title,.footer-title{color:#564571;}
.brand-sub,.page-subtitle,.muted,p,li,label,.small,.footer-note{color:#7a6f90;}
.card,
.page-hero,
.dashboard-hero,
.table-wrap,
.panel,
.summary-card,
.settings-card,
.admin-widget,
.admin-sidebar,
.footer-inner,
.summary-metric,
.stat-card,
.report-modal__dialog{
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,252,255,.94));
  border-color:rgba(167,139,250,.14);
  box-shadow:0 14px 34px rgba(148,163,184,.10);
}
.nav-link,
.admin-side-link,
.pill,
.topbar-badge,
.status-badge{
  background:rgba(255,255,255,.92);
  border-color:rgba(167,139,250,.12);
  box-shadow:0 6px 16px rgba(148,163,184,.08);
  color:#6b5a86;
}
.nav-link.active,
.admin-side-link.active{
  background:linear-gradient(135deg,#f3ebff 0%,#fdeff7 100%);
  color:#6c4db6 !important;
  border-color:rgba(167,139,250,.22);
  box-shadow:0 10px 22px rgba(167,139,250,.14);
}
.nav-link.active i,
.admin-side-link.active i{color:#8b5cf6 !important;}
.btn.primary,
.btn-primary,
button.primary{
  background:linear-gradient(135deg,#a78bfa 0%,#f9a8d4 100%) !important;
  color:#ffffff !important;
  border:none !important;
  box-shadow:0 10px 22px rgba(167,139,250,.18);
}
.btn.outline,
.btn-outline-primary{
  background:#fff !important;
  color:#7c63bf !important;
  border-color:rgba(167,139,250,.24) !important;
}
.btn-danger,
.btn-danger-soft,
.danger-outline,
.btn.btn-danger-soft{
  background:linear-gradient(135deg,#fda4af,#fb7185) !important;
  color:#fff !important;
  border:none !important;
  box-shadow:0 10px 22px rgba(251,113,133,.16);
}
input,
select,
textarea,
.form-control,
.form-select{
  border-color:rgba(196,181,253,.62) !important;
  box-shadow:0 1px 0 rgba(255,255,255,.8), inset 0 1px 0 rgba(255,255,255,.9);
}
input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus{
  border-color:rgba(167,139,250,.48) !important;
  box-shadow:0 0 0 .18rem rgba(196,181,253,.18), 0 8px 20px rgba(196,181,253,.14) !important;
}
.table thead th,
.table-modern thead th,
#appTable thead th,
#talentTable thead th{
  background:linear-gradient(180deg, rgba(245,241,255,.94), rgba(251,247,255,.98));
  color:#6c5a88;
}
.table tbody td,
.table-modern tbody td,
#appTable tbody td,
#talentTable tbody td{background:rgba(255,255,255,.7);}
.table tbody tr:hover td,
.table-modern tbody tr:hover td,
#appTable tbody tr:hover td,
#talentTable tbody tr:hover td{background:rgba(248,243,255,.95);}
.summary-metric__label,.topbar-badge,.pill,.status-badge,.admin-sidebar__eyebrow{color:#8a7aa7;}
.summary-metric__value,.stat-number{color:#7c63bf;}
.msg.ok{background:#f3fbf5;border-color:#bbf7d0;color:#237a4d;}
.msg.error{background:#fff5f6;border-color:#fecdd3;color:#c2415c;}
.confirm-check-card.is-active{background:#f8f4ff;}
.confirm-check-card--danger.is-active{background:#fff5f7;}
.report-menu-grid .card,
.report-menu-card{min-height:100%;}
@media (max-width: 991.98px){
  .admin-shell{grid-template-columns:1fr;gap:18px;}
  .admin-sidebar{position:relative;top:0;}
}
@media (max-width: 768px){
  body{background:#fbf8ff;}
  .topbar,.admin-topbar{position:relative;backdrop-filter:none;}
  .topbar-inner{gap:14px;}
  .brand-title{font-size:clamp(20px,6vw,28px);}
  .brand-sub{font-size:13px;line-height:1.45;}
  .topbar-meta{width:100%;gap:8px;}
  .topbar-badge{min-height:34px;padding:6px 10px;}
  .main-nav{padding-bottom:2px;gap:8px;}
  .nav-link{min-height:42px;padding:8px 12px;font-size:.95rem;}
  .card,.page-hero,.dashboard-hero,.admin-sidebar,.footer-inner{padding:16px;border-radius:20px;}
  .page-title,h2{font-size:clamp(22px,7vw,30px);}
  h3{font-size:18px;}
  .table-wrap,.table-responsive{border-radius:18px;}
  .table thead th,.table tbody td,#appTable thead th,#appTable tbody td,#talentTable thead th,#talentTable tbody td{padding:12px 10px;}
  .preview-summary-grid,.stats-grid{grid-template-columns:1fr 1fr;gap:12px;}
  .search-inline-form,.dashboard-search-form,.history-actions{flex-direction:column;align-items:stretch;}
  .search-inline-form > *, .dashboard-search-form > *, .history-actions > *{width:100%;}
  .btn,button,a.btn{min-height:44px;border-radius:16px !important;}
}
@media (max-width: 520px){
  .container,.no-sidebar-shell{width:calc(100% - 16px) !important;}
  .preview-summary-grid,.stats-grid{grid-template-columns:1fr;}
  .brand{gap:10px;}
  .brand-mark{width:48px;height:48px;flex-basis:48px;border-radius:14px;}
  .brand-title{font-size:20px;}
  .brand-sub{font-size:12px;}
  .topbar-badge,.pill,.status-badge{font-size:11.5px;padding:6px 10px;}
  .card,.page-hero,.dashboard-hero,.admin-sidebar,.footer-inner{padding:14px;border-radius:18px;}
  .page-title,h2{font-size:clamp(20px,8vw,26px);}
}


/* ===== 2026-04 master vivid override ===== */
:root{
  --ui-bg:#f7f1ff;
  --ui-card:#ffffff;
  --ui-card-2:#fff8fc;
  --ui-stroke:rgba(124,58,237,.14);
  --ui-stroke-strong:rgba(124,58,237,.22);
  --ui-title:#31165a;
  --ui-text:#6d5b8c;
  --ui-shadow:0 20px 46px rgba(91,33,182,.14);
  --ui-shadow-soft:0 12px 28px rgba(124,58,237,.10);
  --ui-gradient:linear-gradient(135deg,#7c3aed 0%,#a855f7 46%,#ec4899 100%);
  --ui-gradient-soft:linear-gradient(180deg,rgba(255,255,255,.98),rgba(255,246,252,.94));
}
body{background:radial-gradient(1100px 560px at -10% -10%, rgba(124,58,237,.22), transparent 54%),radial-gradient(920px 520px at 110% 0%, rgba(236,72,153,.14), transparent 46%),linear-gradient(180deg, #fffafd 0%, #f8f1ff 60%, #ffffff 100%);}
.topbar{box-shadow:0 12px 32px rgba(91,33,182,.08);}
.brand-title,.page-title,h2,h3{color:var(--ui-title);}
.page-subtitle,.muted,.small,label,p,li{color:var(--ui-text);}
.nav-link.active,.admin-side-link.active,.admin-mini-link.active{background:var(--ui-gradient);color:#fff !important;box-shadow:0 18px 34px rgba(124,58,237,.22);}
.btn.primary,.btn-primary,button.primary,.btn{background:var(--ui-gradient) !important;color:#fff !important;border:none !important;}
.btn.outline,.btn-outline-primary{background:#fff !important;color:#6d28d9 !important;border:1px solid rgba(124,58,237,.18) !important;}
.btn-danger,.btn-danger-soft,.danger-outline{background:linear-gradient(135deg,#fb7185,#f43f5e) !important;color:#fff !important;border:none !important;}
input,select,textarea,.form-control,.form-select{border-color:rgba(124,58,237,.16) !important;}
input:focus,select:focus,textarea:focus,.form-control:focus,.form-select:focus{border-color:rgba(124,58,237,.44) !important;box-shadow:0 0 0 .22rem rgba(124,58,237,.12), 0 14px 28px rgba(124,58,237,.08) !important;}
.page-admin-login .admin-login-grid{grid-template-columns:1fr;}
@media (max-width:768px){.nav-link.active,.admin-side-link.active,.admin-mini-link.active{box-shadow:0 12px 24px rgba(124,58,237,.18);}}

/* ===== 2026-04 mobile form rescue hotfix ===== */
@media (max-width: 900px){
  .report-form-card{max-width:100% !important; margin:0 auto !important;}
  .report-confirm-grid{
    grid-template-columns:1fr !important;
    gap:14px !important;
  }
  .report-confirm-grid > div,
  .report-confirm-grid > .actions,
  .report-confirm-grid > [style*="grid-column"]{
    grid-column:1 / -1 !important;
    min-width:0 !important;
    width:100% !important;
  }
  .report-confirm-grid .actions{
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:10px !important;
  }
  .report-confirm-grid .actions > *{
    width:100% !important;
  }
  .confirm-choice-box{
    padding:16px !important;
  }
  .confirm-choice-title{
    font-size:1.05rem !important;
    line-height:1.35 !important;
  }
  .confirm-choice-help{
    font-size:.98rem !important;
    line-height:1.55 !important;
  }
  .confirm-check-card{
    align-items:flex-start !important;
    padding:14px !important;
    border-radius:18px !important;
    min-height:auto !important;
  }
  .confirm-check-text{
    font-size:1rem !important;
    line-height:1.55 !important;
    white-space:normal !important;
    word-break:break-word !important;
  }
  .report-locked-plan-box{
    padding:16px !important;
  }
  .report-locked-plan-box__title,
  .report-locked-plan-box__desc{
    white-space:normal !important;
    word-break:break-word !important;
  }
}

@media (max-width: 520px){
  .report-form-card{
    padding:14px !important;
    border-radius:18px !important;
  }
  .report-intro-box,
  .confirm-choice-box,
  .report-locked-plan-box{
    border-radius:18px !important;
  }
  .report-confirm-grid label{
    font-size:.96rem !important;
    line-height:1.45 !important;
  }
  .report-confirm-grid input,
  .report-confirm-grid textarea,
  .report-confirm-grid select,
  .report-confirm-grid .readonly-input{
    width:100% !important;
    max-width:100% !important;
    min-height:48px !important;
    font-size:16px !important;
  }
  .report-confirm-grid textarea{
    min-height:120px !important;
  }
  .confirm-check-card{
    gap:10px !important;
  }
  .confirm-check-icon{
    margin-top:2px !important;
  }
  .confirm-check-text{
    font-size:.98rem !important;
  }
}
