/* ================================================
   HTYS – Global Styles
   ================================================ */
:root {
  --primary:   #2563eb;
  --primary-d: #1d4ed8;
  --success:   #16a34a;
  --danger:    #dc2626;
  --warning:   #d97706;
  --bg:        #f1f5f9;
  --sidebar:   #1e293b;
  --sidebar-hover: #334155;
  --text:      #1e293b;
  --text-light:#64748b;
  --border:    #e2e8f0;
  --white:     #ffffff;
  --radius:    8px;
  --shadow:    0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%); }
.login-card { background: var(--white); border-radius: 12px; padding: 40px; width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .subtitle { color: var(--text-light); font-size: 13px; margin-bottom: 28px; }
.login-card .logo { font-size: 32px; margin-bottom: 16px; }

/* ---- Layout ---- */
#app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 230px; background: var(--sidebar); color: #cbd5e1; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 20px 16px 16px; border-bottom: 1px solid #334155; }
.sidebar-header .brand { font-size: 16px; font-weight: 700; color: var(--white); }
.sidebar-header .brand span { color: #60a5fa; }
.sidebar-header .user-info { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.sidebar nav { flex: 1; padding: 8px 0; }
.nav-section { padding: 16px 16px 4px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #475569; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; cursor: pointer; transition: background .15s; color: #94a3b8; font-size: 13.5px; border-left: 3px solid transparent; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--white); }
.nav-item.active { background: var(--sidebar-hover); color: var(--white); border-left-color: #60a5fa; }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid #334155; }
.btn-logout { width: 100%; background: none; border: 1px solid #475569; color: #94a3b8; padding: 8px; border-radius: var(--radius); cursor: pointer; font-size: 13px; transition: all .15s; }
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* Main content */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { background: var(--white); border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow); }
.topbar h2 { font-size: 17px; font-weight: 600; }
.content { flex: 1; padding: 24px; overflow-y: auto; }

/* ---- Cards ---- */
.card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border-left: 4px solid var(--primary); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.danger  { border-left-color: var(--danger); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-label { font-size: 12px; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; }
/* ---- Dashboard tabs ---- */
.dash-tab { background: none; border: none; padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--text-light); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all .15s; }
.dash-tab:hover { color: var(--primary); }
.dash-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel.hidden { display: none; }

/* ---- Language checkbox dropdown ---- */
.lang-dropdown { position: relative; display: inline-block; }
.lang-dropdown-btn { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--white); border: 1.5px solid #CBD5E1; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; min-width: 160px; justify-content: space-between; transition: border-color .15s, box-shadow .15s; }
.lang-dropdown-btn:hover { border-color: var(--primary); }
.lang-dropdown-btn:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.lang-dropdown-panel { position: absolute; top: calc(100% + 6px); left: 0; background: var(--white); border: 1.5px solid #CBD5E1; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; min-width: 200px; z-index: 200; }
.lang-dropdown-panel.hidden { display: none; }
.lang-option { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); transition: background .1s; }
.lang-option:hover { background: #F1F5F9; }
.lang-option input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.stat-value { font-size: 32px; font-weight: 700; margin: 4px 0; }
.stat-sub   { font-size: 12px; color: var(--text-light); }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { background: var(--bg); padding: 10px 12px; text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-light); border-bottom: 1px solid var(--border); }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-green  { background: #dcfce7; color: #16a34a; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-blue   { background: #dbeafe; color: #2563eb; }
.badge-yellow { background: #fef3c7; color: #d97706; }
.badge-gray   { background: #f1f5f9; color: #64748b; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius); border: none; cursor: pointer; font-size: 13.5px; font-weight: 500; transition: all .15s; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-d); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger  { background: var(--danger); color: var(--white); }
.btn-danger:hover  { filter: brightness(1.1); }
.btn-outline { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; color: var(--text); }
input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13.5px; font-family: inherit;
  transition: border-color .15s; background: var(--white); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ---- Modal ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--white); border-radius: 10px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-lg { max-width: 820px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-light); line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---- Toolbar ---- */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.toolbar-left  { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar-right { display: flex; gap: 10px; }
.search-input { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; width: 220px; }

/* ---- Alert ---- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13.5px; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ---- Upload zone ---- */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; cursor: pointer; transition: all .2s; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--primary); background: #eff6ff; }
.upload-zone .icon { font-size: 40px; margin-bottom: 12px; }
.upload-zone p { color: var(--text-light); font-size: 13.5px; }
.upload-zone strong { color: var(--primary); }

/* ---- Reason code pills ---- */
.reason { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; background: #fee2e2; color: #991b1b; font-family: monospace; }

/* ---- Date picker row ---- */
.date-filter { display: flex; align-items: center; gap: 10px; }
.date-filter input[type=date] { width: auto; }

/* ---- Empty state ---- */
.empty { text-align: center; padding: 48px 16px; color: var(--text-light); }
.empty .icon { font-size: 40px; margin-bottom: 12px; }

/* ---- Skill dots ---- */
.skill-bar { display: flex; gap: 3px; }
.skill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.skill-dot.filled { background: var(--primary); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ---- Utility ---- */
.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; }
.bold { font-weight: 600; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-light); }
