/* ============================================================
   TosyoReka — Design System
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --primary:       #1a3a5c;
  --primary-light: #1e4d7b;
  --primary-dark:  #0f2540;
  --accent:        #e8630a;
  --success:       #16a34a;
  --warning:       #d97706;
  --danger:        #dc2626;
  --info:          #0284c7;
  --teal:          #0d9488;
  --purple:        #7c3aed;
  --bg-body:       #f0f4f8;
  --bg-card:       #ffffff;
  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --border:        #e2e8f0;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow-md:     0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:     0 10px 30px rgba(0,0,0,.15);
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --font-main:     'Plus Jakarta Sans', sans-serif;
  --font-body:     'DM Sans', sans-serif;
  --nav-height:    60px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-primary);
  margin: 0; padding: 0;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.tr-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--primary-dark);
  border-bottom: 1px solid rgba(255,255,255,.08);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 8px;
}

.tr-navbar .brand {
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  white-space: nowrap;
}

.tr-navbar .brand-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.tr-navbar .brand-icon svg { width: 18px; height: 18px; fill: white; }

.company-badge {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  padding: 4px 10px;
  color: rgba(255,255,255,.8);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  margin-right: 4px;
}

/* Nav Menu List */
.tr-nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0; padding: 0;
  gap: 2px;
  flex: 1;
}

/* Every nav-item is position:relative for dropdown */
.tr-nav-menu .nav-item {
  position: relative;
}

/* Nav button/link base style */
.tr-nav-menu .nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-main);
  text-decoration: none;
  border-radius: 6px;
  transition: background .15s, color .15s;
  cursor: pointer;
  border: none;
  background: transparent;
  white-space: nowrap;
  line-height: 1;
}

.tr-nav-menu .nav-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.tr-nav-menu .nav-btn.active { background: rgba(255,255,255,.15); color: #fff; }
.tr-nav-menu .nav-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.nav-btn .chevron {
  width: 12px; height: 12px;
  transition: transform .2s;
  opacity: .6;
}
.nav-item.open .chevron { transform: rotate(180deg); }

/* ============================================================
   DROPDOWN — JS click-controlled ONLY
   No hover, no CSS :hover trigger
   ============================================================ */
.nav-dropdown {
  display: none;               /* hidden by default */
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 210px;
  background: #192e45;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  z-index: 9999;
  animation: ddFadeIn .15s ease forwards;
}

/* Only JS adds .open — CSS never auto-shows dropdown */
.nav-item.open > .nav-dropdown {
  display: block;
}

@keyframes ddFadeIn {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}

.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  font-family: var(--font-main);
  text-decoration: none;
  border-radius: 6px;
  transition: background .12s, color .12s;
}
.nav-dropdown a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-dropdown a svg { width: 14px; height: 14px; flex-shrink: 0; }

.nav-dropdown hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,.08);
  margin: 4px 0;
}

/* ============================================================
   RIGHT SIDE — Notification & User
   ============================================================ */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-icon-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.75);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: background .15s;
}
.nav-icon-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.nav-icon-btn svg { width: 17px; height: 17px; }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--primary-dark);
}

/* User button */
.user-wrap { position: relative; }

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,.08);
  cursor: pointer;
  transition: background .15s;
}
.user-btn:hover,
.user-wrap.open .user-btn { background: rgba(255,255,255,.15); }

.user-avatar {
  width: 30px; height: 30px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}

.user-name { font-size: 12px; font-weight: 600; color: #fff; font-family: var(--font-main); line-height: 1.2; }
.user-role { font-size: 10px; color: rgba(255,255,255,.5); line-height: 1.2; }

/* User dropdown — different colors (white bg) */
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: ddFadeIn .15s ease forwards;
}

.user-wrap.open .user-dropdown { display: block; }

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-main);
  text-decoration: none;
  border-radius: 6px;
  transition: background .12s;
}
.user-dropdown a:hover { background: var(--bg-body); color: var(--text-primary); }
.user-dropdown a svg { width: 14px; height: 14px; flex-shrink: 0; }
.user-dropdown a.danger { color: var(--danger); }
.user-dropdown a.danger:hover { background: #fef2f2; }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ============================================================
   HERO
   ============================================================ */
.tr-hero {
  margin-top: var(--nav-height);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, #1e4d7b 100%);
  padding: 14px 28px 12px;
  position: relative;
  overflow: hidden;
}
.tr-hero[style*="display:none"] { margin-top: 0; }

.tr-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 80% 50%, rgba(232,99,10,.12) 0%, transparent 55%),
    radial-gradient(ellipse at 15% 80%, rgba(14,165,233,.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.hero-title {
  font-family: var(--font-main);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 2px;
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-title svg { width: 18px; height: 18px; }

.hero-subtitle { color: rgba(255,255,255,.6); font-size: 12px; margin: 0 0 8px; }

.hero-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-main);
}
.hero-chip.date   { background: rgba(255,255,255,.12); color: rgba(255,255,255,.85); }
.hero-chip.live   { background: rgba(22,163,74,.2); color: #4ade80; }
.hero-chip.live::before {
  content: '';
  width: 6px; height: 6px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulseDot 1.5s infinite;
}
.hero-chip.module { background: rgba(255,255,255,.08); color: rgba(255,255,255,.7); }

@keyframes pulseDot {
  0%,100% { opacity:1; }
  50%      { opacity:.4; }
}

/* ============================================================
   CONTENT & LAYOUT
   ============================================================ */
.tr-content { padding: 24px 28px; min-height: calc(100vh - var(--nav-height) - 180px); }

.tr-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Rows & Cols */
.row { display: flex; flex-wrap: wrap; margin: 0 -10px; }
.col   { padding: 0 10px; flex: 1; min-width: 0; }
.col-3 { padding: 0 10px; width: 25%; }
.col-4 { padding: 0 10px; width: 33.333%; }
.col-5 { padding: 0 10px; width: 41.666%; }
.col-6 { padding: 0 10px; width: 50%; }
.col-7 { padding: 0 10px; width: 58.333%; }
.col-8 { padding: 0 10px; width: 66.666%; }
.col-12{ padding: 0 10px; width: 100%; }

/* Spacing */
.mb-0{margin-bottom:0!important} .mb-1{margin-bottom:6px!important} .mb-2{margin-bottom:12px!important}
.mb-3{margin-bottom:18px!important} .mb-4{margin-bottom:24px!important}
.mt-2{margin-top:12px!important} .mt-3{margin-top:18px!important} .mt-4{margin-top:24px!important}
.me-1{margin-right:4px!important} .me-2{margin-right:8px!important}

/* ============================================================
   CARDS
   ============================================================ */
.tr-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tr-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}

.tr-card-title {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tr-card-title svg { width: 15px; height: 15px; color: var(--primary); }
.tr-card-body { padding: 20px; }

/* KPI Cards */
.kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.kpi-card.blue::before   { background: var(--primary); }
.kpi-card.green::before  { background: var(--success); }
.kpi-card.orange::before { background: var(--accent); }
.kpi-card.red::before    { background: var(--danger); }

.kpi-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-muted);
  font-family: var(--font-main);
  margin-bottom: 10px;
}
.kpi-value {
  font-family: var(--font-main);
  font-size: 34px; font-weight: 800;
  letter-spacing: -1.5px; line-height: 1;
  margin-bottom: 8px;
}
.kpi-card.blue   .kpi-value { color: var(--primary); }
.kpi-card.green  .kpi-value { color: var(--success); }
.kpi-card.orange .kpi-value { color: var(--accent); }
.kpi-card.red    .kpi-value { color: var(--danger); }
.kpi-sub { font-size: 12px; color: var(--text-muted); }
.kpi-icon { position:absolute; right:16px; top:50%; transform:translateY(-50%); opacity:.06; }
.kpi-icon svg { width:64px; height:64px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.tr-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  font-family: var(--font-main);
  border: none; cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  line-height: 1;
}
.tr-btn svg { width: 15px; height: 15px; }
.tr-btn-primary { background: var(--primary); color: #fff; }
.tr-btn-primary:hover { background: var(--primary-light); color: #fff; }
.tr-btn-success { background: var(--success); color: #fff; }
.tr-btn-success:hover { background: #15803d; color: #fff; }
.tr-btn-danger  { background: var(--danger); color: #fff; }
.tr-btn-danger:hover { background: #b91c1c; color: #fff; }
.tr-btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.tr-btn-outline:hover { background: var(--bg-body); color: var(--text-primary); }
.tr-btn-sm { padding: 5px 10px; font-size: 12px; }
.tr-btn-sm svg { width: 13px; height: 13px; }

/* ============================================================
   TABLES
   ============================================================ */
.tr-table-wrap { overflow-x: auto; }
.tr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tr-table th {
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-main);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tr-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-secondary);
  vertical-align: middle;
}
.tr-table tbody tr:hover td { background: #f8fafc; }
.tr-table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   BADGES
   ============================================================ */
.tr-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  font-family: var(--font-main);
  white-space: nowrap;
}
.tr-badge.draft    { background:#f1f5f9; color:#64748b; }
.tr-badge.pending  { background:#fef9c3; color:#a16207; }
.tr-badge.approved { background:#dcfce7; color:#166534; }
.tr-badge.rejected { background:#fee2e2; color:#991b1b; }
.tr-badge.active   { background:#dbeafe; color:#1d4ed8; }
.tr-badge.done     { background:#ccfbf1; color:#0f766e; }
.tr-badge.gray     { background:#f1f5f9; color:#64748b; }

/* ============================================================
   FORMS
   ============================================================ */
.tr-form-group { margin-bottom: 16px; }
.tr-label {
  display: block;
  font-size: 12px; font-weight: 600;
  font-family: var(--font-main);
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.tr-label.required::after { content: ' *'; color: var(--danger); }
.tr-input, .tr-select, .tr-textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px; font-family: var(--font-body);
  color: var(--text-primary); background: #fff;
  outline: none; transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.tr-input:focus, .tr-select:focus, .tr-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,58,92,.1);
}
.tr-textarea { resize: vertical; min-height: 80px; }
.tr-input-group {
  display: flex; align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.tr-input-group:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,58,92,.1); }
.tr-input-icon {
  padding: 9px 12px; background: #f8fafc;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  display: flex; align-items: center;
}
.tr-input-icon svg { width: 16px; height: 16px; }
.tr-input-group .tr-input { border: none; box-shadow: none; border-radius: 0; }
.tr-input-group .tr-input:focus { box-shadow: none; }

/* ============================================================
   ALERTS
   ============================================================ */
.tr-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px; font-weight: 500;
}
.tr-alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.tr-alert.success { background:#f0fdf4; border:1px solid #bbf7d0; color:#166534; }
.tr-alert.error   { background:#fef2f2; border:1px solid #fecaca; color:#991b1b; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.tr-empty { text-align:center; padding:40px 20px; color:var(--text-muted); }
.tr-empty svg { width:44px; height:44px; opacity:.25; margin-bottom:10px; }
.tr-empty h4 { font-family:var(--font-main); font-size:15px; color:var(--text-secondary); margin:0 0 4px; }
.tr-empty p  { font-size:13px; margin:0; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #1e4d7b 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; overflow: hidden;
}
.login-page::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(232,99,10,.15) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(14,165,233,.10) 0%, transparent 50%);
}
.login-box {
  background: #fff; border-radius: 20px;
  padding: 40px; width: 100%; max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,.3);
  position: relative; z-index: 1;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand .logo {
  width: 52px; height: 52px; background: var(--primary);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.login-brand .logo svg { width: 28px; height: 28px; fill: white; }
.login-brand h1 {
  font-family: var(--font-main);
  font-size: 22px; font-weight: 800;
  color: var(--primary); margin: 0 0 4px; letter-spacing: -.3px;
}
.login-brand p { font-size: 13px; color: var(--text-muted); margin: 0; }
.login-title { font-family:var(--font-main); font-size:16px; font-weight:700; color:var(--text-primary); margin:0 0 4px; }
.login-sub   { font-size:13px; color:var(--text-muted); margin:0 0 24px; }
.btn-login {
  width: 100%; padding: 11px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 10px;
  font-size: 14px; font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer; transition: background .15s;
}
.btn-login:hover { background: var(--primary-light); }

/* ============================================================
   UTILITIES
   ============================================================ */
.d-flex { display:flex!important; }
.align-center { align-items:center!important; }
.justify-between { justify-content:space-between!important; }
.gap-1{gap:4px!important} .gap-2{gap:8px!important} .gap-3{gap:12px!important}
.text-muted { color:var(--text-muted)!important; }
.text-sm    { font-size:12px!important; }
.text-xs    { font-size:11px!important; }
.fw-bold    { font-weight:700!important; }
.fw-semibold{ font-weight:600!important; }
.text-center{ text-align:center!important; }
.text-right { text-align:right!important; }
.w-100      { width:100%!important; }

@media (max-width: 768px) {
  .tr-content { padding: 16px; }
  .tr-hero    { padding: 10px 14px; }
  .col-3,.col-4,.col-6 { width: 50%; }
}

/* ============================================================
   ADDITIONAL COMPONENTS
   ============================================================ */

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-header .page-title {
  font-family: var(--font-main);
  font-size: 20px; font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -.3px;
}
.page-header .page-sub {
  font-size: 13px; color: var(--text-muted); margin: 2px 0 0;
}
.page-actions { display: flex; align-items: center; gap: 8px; }

/* Breadcrumb */
.tr-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 16px;
}
.tr-breadcrumb a { color: var(--primary); text-decoration: none; }
.tr-breadcrumb a:hover { text-decoration: underline; }
.tr-breadcrumb span { color: var(--text-muted); }

/* Section title inside card */
.section-title {
  font-family: var(--font-main);
  font-size: 13px; font-weight: 700;
  color: var(--text-secondary);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}

/* Form row helper */
.form-row {
  display: flex; flex-wrap: wrap; gap: 16px;
}
.form-row .tr-form-group { flex: 1; min-width: 180px; }

/* Checkbox & Radio */
.tr-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; cursor: pointer;
}
.tr-check input[type="checkbox"],
.tr-check input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Select arrow */
.tr-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

/* Input with icon inside (password toggle etc) */
.input-with-action {
  display: flex; align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.input-with-action:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,58,92,.1);
}
.input-with-action .tr-input {
  border: none; box-shadow: none; border-radius: 0; flex: 1;
}
.input-with-action .tr-input:focus { box-shadow: none; }
.input-with-action .input-action {
  padding: 9px 12px; background: #f8fafc;
  border-left: 1px solid var(--border);
  cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center;
  border: none; outline: none;
}
.input-with-action .input-action:hover { background: #f1f5f9; }
.input-with-action .input-action svg { width: 15px; height: 15px; }

/* Divider */
.tr-divider {
  height: 1px; background: var(--border);
  margin: 16px 0;
}

/* Tag / chip */
.tr-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  font-family: var(--font-main);
  background: var(--bg-body);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Status dot */
.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 5px;
}
.status-dot.green  { background: var(--success); }
.status-dot.red    { background: var(--danger); }
.status-dot.yellow { background: var(--warning); }
.status-dot.gray   { background: var(--text-muted); }
.status-dot.blue   { background: var(--primary); }

/* Table action buttons */
.tbl-actions { display: flex; align-items: center; gap: 4px; }

/* Modal (basic) */
.tr-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 9990;
  align-items: center; justify-content: center;
}
.tr-modal-overlay.show { display: flex; }
.tr-modal {
  background: #fff; border-radius: var(--radius-lg);
  padding: 28px; width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.tr-modal-title {
  font-family: var(--font-main);
  font-size: 16px; font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px;
}
.tr-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Pagination */
.tr-pagination {
  display: flex; align-items: center; gap: 4px;
  margin-top: 16px;
}
.tr-pagination .page-btn {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff; color: var(--text-secondary);
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.tr-pagination .page-btn:hover { background: var(--bg-body); }
.tr-pagination .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Approval timeline */
.apv-timeline { list-style: none; padding: 0; margin: 0; }
.apv-timeline li {
  display: flex; gap: 12px;
  padding-bottom: 16px;
  position: relative;
}
.apv-timeline li:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px; top: 30px;
  width: 1px; height: calc(100% - 14px);
  background: var(--border);
}
.apv-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0; font-family: var(--font-main);
}
.apv-dot.approved { background: #dcfce7; color: var(--success); }
.apv-dot.rejected { background: #fee2e2; color: var(--danger); }
.apv-dot.pending  { background: #fef9c3; color: var(--warning); }
.apv-body { flex: 1; }
.apv-title { font-weight: 600; font-size: 13px; font-family: var(--font-main); }
.apv-meta  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.apv-note  { font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-style: italic; }

/* Skill level indicator */
.skill-dots { display: flex; gap: 4px; align-items: center; }
.skill-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border);
}
.skill-dot.filled.level-1 { background: var(--danger); }
.skill-dot.filled.level-2 { background: var(--warning); }
.skill-dot.filled.level-3 { background: var(--info); }
.skill-dot.filled.level-4 { background: var(--success); }

/* File input */
.tr-file-input {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s;
}
.tr-file-input:hover { border-color: var(--primary); }
.tr-file-input input { display: none; }

/* Info row in detail page */
.info-row {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.info-row:last-child { border-bottom: none; }
.info-label {
  width: 160px; flex-shrink: 0;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-main);
}
.info-value {
  flex: 1; font-size: 13px;
  color: var(--text-primary);
}

/* Candidate card */
.kandidat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  background: #fff;
}
.kandidat-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-main);
  font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}

/* ============================================================
   HSEO-STYLE COMPONENTS
   Dark table header, KPI cards with icon, inline filter
   ============================================================ */

/* KPI Card — HSEOne style (icon left, number right) */
.kpi-hse {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.kpi-hse:hover { box-shadow: var(--shadow-md); }

.kpi-hse-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-hse-icon svg { width: 26px; height: 26px; }
.kpi-hse-icon.green  { background: #dcfce7; color: var(--success); }
.kpi-hse-icon.yellow { background: #fef9c3; color: var(--warning); }
.kpi-hse-icon.red    { background: #fee2e2; color: var(--danger); }
.kpi-hse-icon.blue   { background: #dbeafe; color: var(--primary); }
.kpi-hse-icon.orange { background: #ffedd5; color: var(--accent); }
.kpi-hse-icon.purple { background: #ede9fe; color: var(--purple); }

.kpi-hse-body { flex: 1; }
.kpi-hse-value {
  font-family: var(--font-main);
  font-size: 32px; font-weight: 800;
  letter-spacing: -1px; line-height: 1;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.kpi-hse-label {
  font-size: 13px; color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================
   DARK TABLE HEADER — HSEOne style
   ============================================================ */
.tr-table-dark-header thead tr th {
  background: #1a2332 !important;
  color: rgba(255,255,255,.85) !important;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 11px 14px;
  border-bottom: none;
  white-space: nowrap;
}

/* ============================================================
   TABLE CARD HEADER — dark bar with buttons
   ============================================================ */
.tr-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: #1a2332;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  gap: 12px;
}
.tr-table-header .th-title {
  font-family: var(--font-main);
  font-size: 14px; font-weight: 700;
  color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.tr-table-header .th-title svg { width: 16px; height: 16px; opacity: .8; }
.tr-table-header .th-actions { display: flex; align-items: center; gap: 8px; }

.btn-excel { background: #16a34a; color: #fff; border: none; padding: 7px 14px; border-radius: 7px; font-size: 12px; font-weight: 600; font-family: var(--font-main); cursor: pointer; display: flex; align-items: center; gap: 6px; text-decoration: none; transition: background .15s; }
.btn-excel:hover { background: #15803d; color: #fff; }
.btn-pdf   { background: #dc2626; color: #fff; border: none; padding: 7px 14px; border-radius: 7px; font-size: 12px; font-weight: 600; font-family: var(--font-main); cursor: pointer; display: flex; align-items: center; gap: 6px; text-decoration: none; transition: background .15s; }
.btn-pdf:hover   { background: #b91c1c; color: #fff; }
.btn-tambah { background: #374151; color: #fff; border: none; padding: 7px 14px; border-radius: 7px; font-size: 12px; font-weight: 600; font-family: var(--font-main); cursor: pointer; display: flex; align-items: center; gap: 6px; text-decoration: none; transition: background .15s; }
.btn-tambah:hover { background: #4b5563; color: #fff; }
.btn-excel svg, .btn-pdf svg, .btn-tambah svg { width: 14px; height: 14px; }

/* ============================================================
   FILTER SECTION — inline style
   ============================================================ */
.tr-filter-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.tr-filter-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-muted);
  font-family: var(--font-main);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.tr-filter-label svg { width: 13px; height: 13px; }
.tr-filter-row {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: flex-end;
}
.tr-filter-item { flex: 1; min-width: 140px; max-width: 220px; }
.tr-filter-item label { display: block; font-size: 11px; font-weight: 600; color: var(--text-secondary); font-family: var(--font-main); margin-bottom: 5px; }
.tr-filter-item .tr-input,
.tr-filter-item .tr-select { font-size: 12px; padding: 7px 10px; }
.tr-filter-item .tr-select { padding-right: 28px; }
.tr-filter-actions { display: flex; gap: 6px; align-items: flex-end; }
.btn-cari { background: var(--primary); color: #fff; border: none; padding: 8px 16px; border-radius: 7px; font-size: 12px; font-weight: 600; font-family: var(--font-main); cursor: pointer; display: flex; align-items: center; gap: 6px; transition: background .15s; }
.btn-cari:hover { background: var(--primary-light); }
.btn-cari svg { width: 14px; height: 14px; }
.btn-reset { background: #f1f5f9; color: var(--text-secondary); border: 1px solid var(--border); padding: 7px 10px; border-radius: 7px; font-size: 12px; cursor: pointer; display: flex; align-items: center; transition: all .15s; }
.btn-reset:hover { background: var(--border); }
.btn-reset svg { width: 14px; height: 14px; }

/* ============================================================
   TABLE ACTION ICON BUTTONS — colored
   ============================================================ */
.act-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
  text-decoration: none;
}
.act-btn svg { width: 14px; height: 14px; }
.act-btn.view   { background: #dbeafe; color: #1d4ed8; }
.act-btn.view:hover { background: #bfdbfe; }
.act-btn.print  { background: #e0e7ff; color: #4f46e5; }
.act-btn.print:hover { background: #c7d2fe; }
.act-btn.edit   { background: #fef9c3; color: #a16207; }
.act-btn.edit:hover { background: #fef08a; }
.act-btn.delete { background: #fee2e2; color: #dc2626; }
.act-btn.delete:hover { background: #fecaca; }
.act-btn.approve { background: #dcfce7; color: #16a34a; }
.act-btn.approve:hover { background: #bbf7d0; }

/* ============================================================
   BREADCRUMB — HSEOne style (below navbar)
   ============================================================ */
.tr-breadcrumb-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  position: sticky;
  top: var(--nav-height);
  z-index: 100;
}
.tr-breadcrumb-bar a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  display: flex; align-items: center; gap: 4px;
}
.tr-breadcrumb-bar a svg { width: 14px; height: 14px; }
.tr-breadcrumb-bar a:hover { text-decoration: underline; }
.tr-breadcrumb-bar .sep { color: var(--text-muted); }
.tr-breadcrumb-bar .current { color: var(--text-secondary); }

/* ============================================================
   CARD — NO BORDER RADIUS TOP (when using tr-table-header)
   ============================================================ */
.tr-card.has-dark-header {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================================
   NO/INDEX column
   ============================================================ */
.tr-table .col-no {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  width: 40px;
  text-align: center;
}

/* ============================================================
   BADGE — Expired style
   ============================================================ */
.tr-badge.expired  { background: #fee2e2; color: #991b1b; }
.tr-badge.active-pill { background: #dcfce7; color: #166534; }
.tr-badge.warning-pill { background: #fef9c3; color: #a16207; }
.tr-badge.orange   { background: #ffedd5; color: #c2410c; }
.tr-badge.purple   { background: #ede9fe; color: #6d28d9; }
.tr-badge.blue     { background: #dbeafe; color: #1d4ed8; }
.tr-badge.teal     { background: #ccfbf1; color: #0f766e; }

/* Time remaining indicator */
.time-remain {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--danger);
  margin-top: 2px;
}

/* ============================================================
   PAGE WRAPPER adjustments for breadcrumb-bar
   ============================================================ */
.tr-content.with-breadcrumb { padding-top: 20px; }


/* ============================================================
   EXECUTIVE INSIGHT WIDGET
   ============================================================ */
.exec-insight {
  background: linear-gradient(135deg, #0f2540 0%, #1a3a5c 60%, #1e4d7b 100%);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(26,58,92,.25);
}

.exec-insight::before {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
  pointer-events: none;
}

.exec-insight::after {
  content: '';
  position: absolute;
  right: 60px; bottom: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(232,99,10,.06);
  pointer-events: none;
}

.exec-insight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.exec-insight-title {
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.5);
  display: flex;
  align-items: center;
  gap: 7px;
}

.exec-insight-title svg { width: 13px; height: 13px; }

.exec-insight-ts {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  font-family: var(--font-main);
}

.exec-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.exec-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
  transition: background .2s;
}

.exec-card:hover { background: rgba(255,255,255,.09); }

.exec-card-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.exec-card-icon svg { width: 14px; height: 14px; }
.exec-card-icon.up     { background: rgba(34,197,94,.2);  color: #4ade80; }
.exec-card-icon.down   { background: rgba(239,68,68,.2);  color: #f87171; }
.exec-card-icon.warn   { background: rgba(249,115,22,.2); color: #fb923c; }
.exec-card-icon.info   { background: rgba(59,130,246,.2); color: #60a5fa; }
.exec-card-icon.purple { background: rgba(139,92,246,.2); color: #a78bfa; }

.exec-card-value {
  font-family: var(--font-main);
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.exec-card-label {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.3;
}

.exec-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-main);
  padding: 2px 7px;
  border-radius: 20px;
}

.exec-card-trend.up     { background: rgba(34,197,94,.15);  color: #4ade80; }
.exec-card-trend.down   { background: rgba(239,68,68,.15);  color: #f87171; }
.exec-card-trend.warn   { background: rgba(249,115,22,.15); color: #fb923c; }
.exec-card-trend.info   { background: rgba(59,130,246,.15); color: #60a5fa; }
.exec-card-trend svg    { width: 10px; height: 10px; }

/* ============================================================
   CHART PREMIUM OVERRIDES
   ============================================================ */
.chart-wrap {
  position: relative;
}

.chart-wrap canvas {
  border-radius: 4px;
}
