/* Amoud University HRMS — modern sidebar theme */
:root {
  --g-900: #03251a;
  --g-800: #05361f;
  --g-700: #006633;
  --g-600: #0a8a46;
  --mint: #2be08b;
  --mint-soft: #e5f8ef;
  --red: #d63a2f;
  --ink: #0f1f17;
  --muted: #64746b;
  --bg: #eef3f0;
  --card: #ffffff;
  --line: #e1e9e4;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(10,40,25,.05), 0 8px 24px rgba(10,40,25,.06);
  --side-w: 262px;
  --bs-primary: #006633;
  --bs-primary-rgb: 0,102,51;
  --bs-link-color: #006633;
  --bs-link-hover-color: #004d26;
  --bs-body-font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body.app-body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  font-size: 14.5px;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(43,224,139,.14), transparent 60%),
    radial-gradient(700px 380px at 0% 100%, rgba(0,102,51,.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; margin-left: var(--side-w); display: flex; flex-direction: column; }
.hr-main { padding: 26px 32px 48px; width: 100%; max-width: 1480px; }

/* ---------- sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 1040;
  display: flex; flex-direction: column;
  background:
    radial-gradient(260px 260px at 0% 0%, rgba(43,224,139,.22), transparent 70%),
    linear-gradient(180deg, var(--g-800) 0%, var(--g-900) 100%);
  color: #cfe7da; padding: 18px 14px 14px;
  border-right: 1px solid rgba(255,255,255,.06);
}
.side-brand { text-decoration: none; display: block; padding: 4px 6px 18px; }
.logo-chip { display: block; background: #fff; border-radius: 12px; padding: 8px 10px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.logo-chip img { display: block; width: 100%; height: auto; }
.side-role { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mint); font-weight: 600; }
.side-role i { font-size: 9px; }
.side-nav { flex: 1; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.side-group { margin: 16px 10px 6px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(207,231,218,.45); font-weight: 600; }
.side-link {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: #cfe7da;
  padding: 10px 12px; margin: 2px 0; border-radius: 12px; font-weight: 500; position: relative;
  transition: background .18s, color .18s, transform .18s;
}
.side-link i { font-size: 17px; width: 20px; text-align: center; opacity: .85; }
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.side-link.active {
  background: linear-gradient(90deg, rgba(43,224,139,.22), rgba(43,224,139,.06));
  color: #fff; box-shadow: inset 0 0 0 1px rgba(43,224,139,.28);
}
.side-link.active i { color: var(--mint); opacity: 1; }
.side-link.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 10px 4px; margin-top: 8px; border-top: 1px solid rgba(255,255,255,.09); }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--g-900); background: linear-gradient(135deg, var(--mint), #8af0c0); }
.side-user-meta { flex: 1; min-width: 0; line-height: 1.2; }
.side-user-meta strong { display: block; color: #fff; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-meta small { color: rgba(207,231,218,.6); font-size: 11.5px; }
.side-logout { color: #ffb4ad; font-size: 20px; padding: 6px; border-radius: 10px; text-decoration: none; transition: background .15s; }
.side-logout:hover { background: rgba(214,58,47,.22); color: #fff; }
.side-backdrop { display: none; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1020; height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 32px;
  background: rgba(238,243,240,.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; border: 0; background: #fff; border-radius: 12px; width: 40px; height: 40px; font-size: 22px; color: var(--g-700); box-shadow: var(--shadow); }
.crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.crumb strong { color: var(--ink); font-weight: 600; }
.crumb i { font-size: 11px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; background: #fff; padding: 7px 14px; border-radius: 999px; box-shadow: var(--shadow); }

/* ---------- mobile ---------- */
@media (max-width: 991px) {
  .app-main { margin-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .app.menu-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.45); }
  .app.menu-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(3,20,12,.5); z-index: 1035; }
  .menu-btn { display: block; }
  .topbar, .hr-main { padding-left: 16px; padding-right: 16px; }
  .top-right { display: none; }
}

/* ---------- page furniture ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -.02em; color: var(--ink); }
.page-sub { margin: 4px 0 0; color: var(--muted); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.panel-title { font-weight: 700; font-size: 16px; margin-bottom: 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.panel-title span { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.import-form { display: grid; grid-template-columns: 1fr minmax(220px, 320px) auto; gap: 14px; align-items: center; }
@media (max-width: 767px) { .import-form { grid-template-columns: 1fr; } }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 16px; }
.kpi { display: flex; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; position: relative; overflow: hidden; }
.kpi:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(10,40,25,.11); }
.kpi-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; color: var(--g-700); background: var(--mint-soft); }
.kpi-icon.green { color: #0b8d3f; background: #dff6e8; }
.kpi-icon.amber { color: #b7791f; background: #fdf1d6; }
.kpi-icon.red { color: #c0392b; background: #fde7e4; }
.kpi-icon.blue { color: #2f6fdb; background: #e4eefc; }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.chart-wrap { height: 270px; }
.band-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.band-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.band-legend b { color: var(--ink); margin-left: 4px; }
.rating { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; padding-top: 6px; }
.rating-ring { --p: 0; --c: #00a651; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #e8efeb 0); position: relative; flex-shrink: 0; }
.rating-ring::before { content: ''; position: absolute; inset: 14px; background: #fff; border-radius: 50%; }
.rating-ring > div { position: relative; text-align: center; line-height: 1.1; }
.rating-ring b { display: block; font-size: 34px; letter-spacing: -.02em; }
.rating-ring small { color: var(--muted); font-size: 12px; }
.rating-status { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.perf-head { font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.perf-head.up { color: #0b8d3f; } .perf-head.down { color: #c0392b; }

/* ---------- Bootstrap restyle (wins over page-level CDN loads) ---------- */
body.app-body h1, body.app-body h2, body.app-body h3, body.app-body h4, body.app-body h5 { color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
body.app-body .container, body.app-body .container-fluid { max-width: 100%; padding-left: 0; padding-right: 0; }
body.app-body .btn { border-radius: 11px; font-weight: 600; padding: .5rem 1rem; transition: transform .15s, box-shadow .15s, background .15s; }
body.app-body .btn:hover { transform: translateY(-1px); }
body.app-body .btn-sm { padding: .3rem .65rem; border-radius: 9px; }
body.app-body .btn-primary { --bs-btn-bg: var(--g-700); --bs-btn-border-color: var(--g-700); --bs-btn-hover-bg: var(--g-600); --bs-btn-hover-border-color: var(--g-600); --bs-btn-active-bg: var(--g-800); --bs-btn-active-border-color: var(--g-800); --bs-btn-color: #fff; box-shadow: 0 6px 16px rgba(0,102,51,.28); }
body.app-body .btn-outline-primary { --bs-btn-color: var(--g-700); --bs-btn-border-color: var(--g-700); --bs-btn-hover-bg: var(--g-700); --bs-btn-hover-border-color: var(--g-700); }
body.app-body .btn-danger { --bs-btn-bg: var(--red); --bs-btn-border-color: var(--red); }
body.app-body .btn-warning { --bs-btn-bg: #f2a900; --bs-btn-border-color: #f2a900; --bs-btn-color: #2b1d00; }
body.app-body .btn-success { --bs-btn-bg: #0b8d3f; --bs-btn-border-color: #0b8d3f; }
body.app-body .btn-info { --bs-btn-bg: var(--mint-soft); --bs-btn-border-color: var(--mint-soft); --bs-btn-color: var(--g-700); --bs-btn-hover-bg: #cdf2e0; --bs-btn-hover-border-color: #cdf2e0; --bs-btn-hover-color: var(--g-800); }
body.app-body .btn-secondary { --bs-btn-bg: #e7eeea; --bs-btn-border-color: #e7eeea; --bs-btn-color: var(--ink); --bs-btn-hover-bg: #d9e3dd; --bs-btn-hover-border-color: #d9e3dd; --bs-btn-hover-color: var(--ink); }
body.app-body .btn-outline-secondary, body.app-body .btn-outline-danger { background: #fff; }
body.app-body .bg-primary { background-color: var(--g-700) !important; }
body.app-body .text-primary { color: var(--g-700) !important; }
body.app-body .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transform: none; margin-bottom: 20px; }
body.app-body .card:hover { transform: none; box-shadow: var(--shadow); }
body.app-body .card-header { background: transparent; color: var(--ink); font-weight: 700; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; padding: 16px 22px; }
body.app-body .card-body { padding: 20px 22px; }
body.app-body .form-control, body.app-body .form-select {
  border: 1px solid #d3ded8; border-radius: 11px; padding: .55rem .8rem; background-color: #fbfdfc; font-size: 14.5px;
}
body.app-body .form-control:focus, body.app-body .form-select:focus { border-color: var(--g-600); background: #fff; box-shadow: 0 0 0 4px rgba(10,138,70,.14); }
body.app-body .form-label, body.app-body label { font-weight: 600; font-size: 13px; color: #2d4338; }
body.app-body .table { --bs-table-bg: transparent; margin-bottom: 0; }
body.app-body .table thead th, body.app-body .table-dark, body.app-body thead.table-dark th, body.app-body .report-table th {
  background: #f1f6f3 !important; color: #3b5246 !important; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700;
  border-bottom: 1px solid var(--line) !important; border-top: 0; padding: 13px 14px; white-space: nowrap;
}
body.app-body .table td { padding: 12px 14px; border-color: #edf2ef; vertical-align: middle; }
body.app-body .table-hover > tbody > tr:hover > * { --bs-table-hover-bg: #f5faf7; }
body.app-body .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-striped-bg: #fafcfb; }
body.app-body table.modern { width: 100%; }
body.app-body .dataTables_wrapper { padding: 14px 16px; }
body.app-body .dataTables_filter input, body.app-body .dataTables_length select { border: 1px solid #d3ded8; border-radius: 10px; padding: 6px 10px; }
body.app-body .page-link { border: 0; border-radius: 9px !important; margin: 0 2px; color: var(--g-700); }
body.app-body .page-item.active .page-link { background: var(--g-700); color: #fff; }
body.app-body .badge { border-radius: 999px; font-weight: 600; padding: .4em .75em; }
body.app-body .alert { border: 0; border-radius: 12px; box-shadow: var(--shadow); }
body.app-body .alert-info { background: var(--mint-soft); color: var(--g-800); }
body.app-body .modal-content { border: 0; border-radius: 20px; box-shadow: 0 30px 80px rgba(3,37,26,.3); overflow: hidden; }
body.app-body .modal-header { background: linear-gradient(90deg, var(--g-800), var(--g-700)); color: #fff; border: 0; padding: 18px 24px; }
body.app-body .modal-header .modal-title { color: #fff; font-weight: 700; }
body.app-body .modal-header .btn-close { filter: invert(1); opacity: .8; }
body.app-body .modal-footer { border-top: 1px solid var(--line); }
body.app-body .select2-container--default .select2-selection--single { height: 40px; border: 1px solid #d3ded8; border-radius: 11px; background: #fbfdfc; }
body.app-body .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px; padding-left: 12px; }
body.app-body .select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; }
body.app-body .select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--g-700) !important; }
body.app-body .summary-table, body.app-body .permissions-table { background: #fff; border-radius: 12px; overflow: hidden; }
body.app-body .summary-table th, body.app-body .permissions-table th { background: #f1f6f3; color: #3b5246; font-size: 12.5px; }
body.app-body .badge-yes { background: #fdf1d6; color: #8a5a00; }
body.app-body hr { border-color: var(--line); opacity: 1; }
body.app-body .text-muted { color: var(--muted) !important; }
body.app-body a.btn, body.app-body .btn { text-decoration: none; }

/* ---------- print ---------- */
@media print {
  .sidebar, .topbar, .side-backdrop { display: none !important; }
  .app-main { margin-left: 0; }
  body.app-body { background: #fff; }
  .hr-main { padding: 0; max-width: none; }
}
