:root{
  --tig-red:#ed1c24;
  --tig-red-dark:#c9151c;
  --tig-red-soft:#fff1f2;
  --tig-blue:#2563eb;
  --tig-green:#0ca678;
  --tig-gold:#d99000;
  --tig-bg:#fafafa;
  --tig-surface:#ffffff;
  --tig-text:#15151a;
  --tig-muted:#6b7280;
  --tig-border:#eeeeee;
  --tig-shadow:0 8px 28px rgba(16,24,40,.06);
  --tig-shadow-strong:0 18px 50px rgba(16,24,40,.10);
  --tig-radius:14px;
}
*{box-sizing:border-box}
html,body{min-height:100%}
body{
  margin:0;
  font-family:Poppins,Inter,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--tig-bg);
  color:var(--tig-text);
  font-size:15px;
}
a{text-decoration:none}
.app-frame{min-height:100vh;background:linear-gradient(180deg,#fff 0%,#fafafa 220px,#fbfbfb 100%)}
.theme-header{
  position:sticky;
  top:0;
  z-index:1040;
  background:#fff;
  border-bottom:1px solid var(--tig-border);
  box-shadow:0 2px 16px rgba(16,24,40,.04);
}
.theme-header-top{
  height:74px;
  display:flex;
  align-items:center;
  gap:18px;
  padding:0 34px;
  border-bottom:1px solid #f0f0f0;
}
.brand-area{display:flex;align-items:center;gap:13px;color:var(--tig-text);min-width:280px}
.brand-logo{
  width:48px;height:48px;border-radius:50%;object-fit:contain;background:#fff;
  filter:drop-shadow(0 6px 14px rgba(237,28,36,.22));
}
.welcome-text{color:var(--tig-red);font-weight:700;font-size:20px;line-height:1.1;letter-spacing:.01em}
.brand-copy small{display:block;color:#333;font-size:13px;margin-top:4px;font-weight:500}
.header-actions{display:flex;align-items:center;gap:16px}
.session-select{
  width:150px;
  min-height:42px;
  border-radius:9px;
  border:1px solid #e7e7e7;
  color:#6b7280;
  font-weight:500;
  box-shadow:0 2px 8px rgba(16,24,40,.03);
}
.header-icon,
.mobile-nav-toggle{
  width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;
  border:0;background:#fff;color:var(--tig-red);font-size:20px;border-radius:11px;
  transition:.18s ease;
}
.header-icon:hover,.mobile-nav-toggle:hover{background:var(--tig-red-soft);transform:translateY(-1px)}
.mobile-nav-toggle{display:none;font-size:25px}
.avatar-circle{
  width:50px;height:50px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:#fa3b42;color:#fff;font-weight:700;font-size:20px;box-shadow:0 10px 22px rgba(237,28,36,.22)
}
.theme-nav{
  min-height:54px;
  display:flex;
  align-items:center;
  gap:4px;
  padding:0 28px;
  overflow:visible;
}
.theme-nav-item{
  height:54px;
  display:inline-flex;
  align-items:center;
  gap:9px;
  border:0;
  background:#fff;
  color:#101010;
  padding:0 14px;
  font-weight:600;
  font-size:15px;
  white-space:nowrap;
  position:relative;
  transition:.16s ease;
}
.theme-nav-item i{color:var(--tig-red);font-size:17px}
.theme-nav-item:hover,.theme-nav-item.active{color:#000;background:#fff}
.theme-nav-item:after{
  content:"";position:absolute;left:12px;right:12px;bottom:0;height:2px;background:transparent;border-radius:10px;transition:.16s ease;
}
.theme-nav-item:hover:after,.theme-nav-item.active:after{background:var(--tig-red)}
.theme-dropdown{position:relative;display:inline-flex;height:54px;align-items:center}
.theme-dropdown .dropdown-toggle::after{margin-left:2px;color:#999;border-top-color:#999}
.theme-dropdown-menu{
  border:1px solid #eeeeee;
  border-radius:0 0 8px 8px;
  box-shadow:0 16px 38px rgba(16,24,40,.10);
  padding:7px 0;
  min-width:275px;
  margin-top:0!important;
}
.theme-dropdown-menu .dropdown-item{
  display:flex;align-items:center;gap:10px;min-height:36px;
  font-weight:500;color:#202020;padding:8px 14px;border-left:3px solid transparent;
}
.theme-dropdown-menu .dropdown-item i{color:var(--tig-red);font-size:16px}
.theme-dropdown-menu .dropdown-item:hover,.theme-dropdown-menu .dropdown-item.active{
  background:var(--tig-red-soft);color:var(--tig-red);border-left-color:var(--tig-red);
}
.theme-main{padding:0;background:#fbfbfb;min-height:calc(100vh - 129px)}
.content{padding:38px 36px 42px;max-width:1920px;margin:0 auto;width:100%}
.alert{border-radius:10px;border:1px solid var(--tig-border);box-shadow:var(--tig-shadow)}

/* Header / hero blocks */
.page-hero{
  display:flex;align-items:center;justify-content:space-between;gap:22px;
  background:#fff;border:1px solid var(--tig-border);border-radius:12px;
  padding:22px 24px;box-shadow:var(--tig-shadow);margin-bottom:26px;
}
.page-hero h2{font-size:22px;font-weight:700;margin:8px 0 5px;color:#111;letter-spacing:-.01em}
.page-hero p{margin:0;color:#6b7280;font-size:14px;max-width:980px}
.eyebrow{
  display:inline-flex;align-items:center;gap:6px;color:var(--tig-red);background:#fff7f7;
  border:1px solid #ffe2e4;border-radius:6px;padding:6px 10px;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;
}
.hero-counter{
  min-width:126px;border-radius:12px;padding:14px 16px;text-align:center;background:#fff;border:1px solid #f1f1f1;
  box-shadow:0 4px 16px rgba(16,24,40,.05);
}
.hero-counter span{display:block;color:var(--tig-red);font-size:30px;font-weight:800;line-height:1}
.hero-counter small{display:block;margin-top:6px;color:#6b7280;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em}
.hero-counter.green span{color:var(--tig-green)}
.hero-counter.orange span{color:var(--tig-gold)}
.hero-counter.purple span{color:#7c3aed}

/* Cards and dashboard */
.card,.product-card{
  background:#fff;border:1px solid var(--tig-border);border-radius:12px;box-shadow:var(--tig-shadow);overflow:hidden;
}
.product-card .card-header,.card-header{
  background:#fff;border-bottom:1px solid #efefef;padding:17px 20px;font-size:18px;font-weight:700;color:#111;
}
.form-card{padding:22px}
.master-form{background:#fff}
.stat-card{
  background:#fff;border:1px solid var(--tig-border);border-radius:10px;box-shadow:var(--tig-shadow);padding:19px 20px;
  display:flex;align-items:center;gap:16px;min-height:108px;transition:.18s ease;
}
.stat-card:hover{transform:translateY(-2px);box-shadow:var(--tig-shadow-strong)}
.stat-icon{width:45px;height:45px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:#fff0f1;color:var(--tig-red);font-size:22px}
.stat-number{font-size:28px;font-weight:800;line-height:1;color:#2563eb}
.stat-label{font-size:14px;color:#686b72;font-weight:500;margin-bottom:4px}
.row .col-md-3:nth-child(2) .stat-number{color:#d99000}
.row .col-md-3:nth-child(3) .stat-number{color:#0ca678}
.row .col-md-3:nth-child(4) .stat-number{color:#e11d48}
.empty-state{text-align:center;padding:70px 20px;background:#fff;border:1px solid var(--tig-border);border-radius:12px;box-shadow:var(--tig-shadow)}
.empty-state i{font-size:56px;color:var(--tig-red)}
.chart-card{padding:20px;height:360px}
.report-header{background:#fff;border:1px solid var(--tig-border);border-radius:12px;box-shadow:var(--tig-shadow);padding:22px;margin-bottom:18px;display:flex;align-items:center;justify-content:space-between}
.candidate-strip{background:#fff;border:1px solid var(--tig-border);border-radius:12px;box-shadow:var(--tig-shadow);padding:18px 22px;display:flex;justify-content:space-between;gap:20px;margin-bottom:16px}
.candidate-strip div{display:flex;flex-direction:column}.candidate-strip span{color:var(--tig-muted);font-weight:600}

/* Forms */
.form-label{font-size:13px;font-weight:600;color:#111;margin-bottom:8px;text-transform:uppercase;letter-spacing:.01em}
.form-control,.form-select{
  min-height:43px;border-radius:6px;border:1px solid #e2e5e9;background:#fff;color:#1f2937;font-size:14px;font-weight:500;
  box-shadow:0 1px 2px rgba(16,24,40,.03);
}
.form-control::placeholder{color:#8b929e}
.form-control:focus,.form-select:focus{border-color:#ff6b70;box-shadow:0 0 0 .2rem rgba(237,28,36,.10)}
.input-group-text{border-color:#e2e5e9;background:#fff7f7;color:var(--tig-red);border-radius:6px;font-weight:600}
.form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}
.toolbar{display:flex;justify-content:flex-end;margin-bottom:15px}
.sticky-form{position:sticky;top:148px}
.section-title{display:flex;align-items:center;gap:12px;margin-bottom:18px;padding-bottom:16px;border-bottom:1px solid #eeeeee}
.section-title.compact{padding-bottom:12px;margin-bottom:16px}
.section-title h5{margin:0;font-weight:700;color:#111;font-size:17px}
.section-title small{display:block;color:#6b7280;font-weight:500;font-size:12px;margin-top:2px}
.section-icon{width:40px;height:40px;border-radius:9px;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:19px;box-shadow:0 9px 18px rgba(237,28,36,.16)}
.bg-blue,.bg-green,.bg-orange,.bg-purple{background:var(--tig-red)!important}

/* Buttons */
.btn{border-radius:7px;font-weight:600;min-height:38px;display:inline-flex;align-items:center;justify-content:center;gap:4px;transition:.16s ease}
.btn-primary{background:var(--tig-red);border-color:var(--tig-red);box-shadow:0 10px 18px rgba(237,28,36,.16)}
.btn-primary:hover,.btn-primary:active{background:var(--tig-red-dark)!important;border-color:var(--tig-red-dark)!important;transform:translateY(-1px)}
.btn-light{background:#f6f6f6;border:1px solid #eeeeee;color:#222}
.btn-light:hover{background:#eeeeee;border-color:#e5e5e5}
.btn-outline-primary{border-color:var(--tig-red);color:var(--tig-red)}
.btn-outline-primary:hover{background:var(--tig-red);border-color:var(--tig-red)}
.btn-soft-primary{background:#fff5f5;color:var(--tig-red);border:1px solid #ffd8dc}
.btn-soft-primary:hover{background:var(--tig-red);color:#fff;border-color:var(--tig-red)}
.btn-soft-danger{background:#fff;color:var(--tig-red);border:1px solid #ffd8dc}
.btn-soft-danger:hover{background:var(--tig-red);color:#fff;border-color:var(--tig-red)}
.action-col .btn{width:34px;height:34px;min-height:34px;padding:0;margin-left:4px}

/* Tables */
.table{--bs-table-bg:transparent;margin-bottom:0}
.table thead th{
  background:var(--tig-red)!important;color:#fff;font-size:13px;font-weight:700;letter-spacing:0;border-color:var(--tig-red-dark);padding:13px 14px;white-space:nowrap;text-transform:none;
}
.table thead th:first-child{border-top-left-radius:0}
.table thead th:last-child{border-top-right-radius:0}
.table tbody td{border-color:#f1f1f1;color:#111;padding:13px 14px;vertical-align:middle;font-size:14px}
.table-hover tbody tr:hover{background:#fff8f8}
.status-badge{border-radius:5px;padding:6px 11px;font-weight:700;font-size:12px;border:1px solid transparent}
.status-badge.active{background:#e9fff2;color:#0b9d45;border-color:#b9efcd}
.status-badge.inactive{background:#fff1f2;color:#ef4444;border-color:#ffc5ca}
.badge.text-bg-info{background:#e7f3ff!important;color:#2563eb!important;border:1px solid #cfe4ff}
.mini-badge{display:inline-flex;align-items:center;gap:4px;border-radius:6px;padding:6px 9px;font-size:12px;font-weight:700;border:1px solid transparent;white-space:nowrap}
.mini-badge.blue{background:#eef6ff;color:#2563eb;border-color:#d7e8ff}
.mini-badge.purple{background:#fff1f2;color:var(--tig-red);border-color:#ffd8dc}
.question-cell{min-width:260px;font-weight:600;color:#1f2937}

/* Permission and controls */
.switch{display:flex;align-items:center;gap:9px;font-weight:600;color:#111;font-size:13px;text-transform:uppercase}
.switch input{display:none}
.switch span{width:44px;height:24px;background:#d3d7de;border-radius:100px;position:relative;display:inline-block;transition:.2s}
.switch span:after{content:"";width:20px;height:20px;background:#fff;border-radius:50%;position:absolute;top:2px;left:2px;transition:.2s;box-shadow:0 2px 5px rgba(0,0,0,.22)}
.switch input:checked+span{background:var(--tig-red)}
.switch input:checked+span:after{left:22px}
.check-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px}
.check-grid label{background:#fff;border:1px solid #eeeeee;padding:10px;border-radius:8px;font-weight:600;color:#374151}
.permission-card .card-header{position:sticky;top:128px;z-index:2}
.permission-table .form-check-input{width:1.25rem;height:1.25rem;cursor:pointer}
.permission-parent-row td{background:#fff7f7!important;font-weight:700;color:#1f2937;border-top:1px solid #ffdfe2;border-bottom:1px solid #ffdfe2}
.permission-parent-row i{color:var(--tig-red)}
.product-tabs{background:#fff;border:1px solid var(--tig-border);border-radius:10px;padding:5px;box-shadow:var(--tig-shadow);display:inline-flex;gap:4px}
.product-tabs .nav-link{border-radius:7px;color:#333;font-weight:600;padding:9px 14px}
.product-tabs .nav-link.active{background:var(--tig-red);color:#fff;box-shadow:0 8px 16px rgba(237,28,36,.15)}
.star-box{display:flex;gap:5px;flex-wrap:wrap}.star-box input{display:none}.star-box span{width:30px;height:30px;border-radius:7px;border:1px solid #e2e5e9;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;font-weight:700;background:#fff;color:#64748b}.star-box input:checked+span,.star-box span:hover{background:var(--tig-red);color:#fff;border-color:var(--tig-red)}

/* Login */
.login-body{
  min-height:100vh;background:linear-gradient(135deg,#fff 0%,#fff7f7 52%,#fff 100%);display:flex;align-items:center;justify-content:center;padding:20px;position:relative;overflow:hidden;
}
.login-body:before{content:"";position:absolute;width:480px;height:480px;border-radius:50%;background:rgba(237,28,36,.08);left:-160px;top:-150px}
.login-body:after{content:"";position:absolute;width:380px;height:380px;border-radius:50%;background:rgba(237,28,36,.08);right:-120px;bottom:-120px}
.login-card{position:relative;z-index:1;width:min(500px,100%);background:#fff;border:1px solid #eeeeee;border-radius:16px;padding:34px;box-shadow:0 28px 90px rgba(16,24,40,.14)}
.login-brand{display:flex;align-items:center;gap:15px;margin-bottom:22px}.login-brand h3{font-weight:700;margin:0;color:#111;font-size:22px}.login-brand p{margin:4px 0 0;color:#6b7280;font-weight:500}.login-logo{width:58px;height:58px;border-radius:50%;object-fit:contain;filter:drop-shadow(0 8px 16px rgba(237,28,36,.20))}.demo-users{font-size:13px;color:#64748b;background:#fff8f8;border:1px solid #ffe1e4;border-radius:10px;padding:12px;margin-top:16px}
.brand-mark{width:48px;height:48px;border-radius:50%;background:var(--tig-red);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:22px;box-shadow:0 10px 22px rgba(237,28,36,.22)}

/* Mobile */
.mobile-nav{padding:10px 18px 18px;border-top:1px solid #f2f2f2;background:#fff}
.mobile-nav .theme-nav-item{width:100%;height:44px;justify-content:flex-start;border-radius:8px;margin-bottom:4px}
.mobile-nav .theme-nav-item:after{display:none}
.mobile-nav .theme-nav-item.active,.mobile-nav .theme-nav-item:hover{background:#fff7f7;color:var(--tig-red)}
.mobile-child{padding-left:30px!important}
.mobile-group-title{display:flex;align-items:center;gap:9px;margin:12px 0 6px;color:#6b7280;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.05em}.mobile-group-title i{color:var(--tig-red)}
body.theme-soft-dark{--tig-bg:#111827;--tig-surface:#1f2937;--tig-text:#f9fafb;--tig-border:#273244;background:#111827}.theme-soft-dark .theme-header,.theme-soft-dark .theme-header-top,.theme-soft-dark .theme-nav-item,.theme-soft-dark .card,.theme-soft-dark .product-card,.theme-soft-dark .page-hero,.theme-soft-dark .stat-card,.theme-soft-dark .form-control,.theme-soft-dark .form-select{background:#18202d;color:#f9fafb;border-color:#273244}.theme-soft-dark .theme-main{background:#111827}.theme-soft-dark .brand-copy small,.theme-soft-dark .page-hero p,.theme-soft-dark .section-title small{color:#cbd5e1}.theme-soft-dark .table tbody td{color:#f3f4f6;border-color:#273244}.theme-soft-dark .theme-dropdown-menu{background:#18202d;border-color:#273244}.theme-soft-dark .dropdown-item{color:#f9fafb}
@media(max-width:1180px){.theme-nav{overflow-x:auto;padding:0 18px}.theme-nav::-webkit-scrollbar{height:4px}.theme-nav::-webkit-scrollbar-thumb{background:#ffd0d4;border-radius:999px}.theme-nav-item{padding:0 11px;font-size:14px}.brand-area{min-width:240px}.content{padding:28px 24px}}
@media(max-width:992px){.theme-header-top{padding:0 18px}.theme-nav{display:none!important}.mobile-nav-toggle{display:inline-flex}.session-select,.header-icon{display:none}.brand-area{min-width:0}.welcome-text{font-size:17px}.brand-copy small{font-size:12px}.content{padding:22px 16px}.page-hero{flex-direction:column;align-items:flex-start}.hero-counter{align-self:stretch}.sticky-form{position:static}.candidate-strip{flex-direction:column}.permission-card .card-header{position:static}.question-cell{min-width:220px}}
@media(max-width:576px){.theme-header-top{height:66px}.brand-logo{width:42px;height:42px}.avatar-circle{width:40px;height:40px;font-size:16px}.content{padding:18px 12px}.page-hero{padding:18px}.page-hero h2{font-size:20px}.form-card{padding:18px}.product-card .card-header,.card-header{font-size:16px}.table tbody td,.table thead th{padding:11px 10px;font-size:13px}}
@media print{.theme-header,.btn,.form-actions,.product-tabs,.page-hero{display:none!important}.theme-main{padding:0;background:#fff}.content{padding:0;background:#fff}.product-card,.report-header,.stat-card{box-shadow:none;border:1px solid #ddd}}

/* PayrollDB integration screens */
.payroll-hero {
    background: linear-gradient(135deg, #fff 0%, #fff4f4 48%, #ffe8e8 100%);
    border: 1px solid rgba(229, 32, 38, .12);
}
.hero-counter.red {
    background: #fff;
    border: 1px solid rgba(229, 32, 38, .18);
    color: #e52026;
    box-shadow: 0 16px 40px rgba(229,32,38,.08);
}
.section-icon.bg-red { background: #e52026; color: #fff; }
.app-alert {
    border-radius: 16px;
    border: 1px solid rgba(13,110,253,.15);
    background: #f7fbff;
}
.readonly-grid label {
    background: #fff7f7;
    border-color: rgba(229,32,38,.12);
}
