/* ==========================================================================
   IJTRM Admin — Dashboard Design System
   Loaded on top of Bootstrap 5 (see backend/css.php). Do not duplicate
   Bootstrap utilities here — only the new visual identity + components.
   ========================================================================== */

:root {
  --ia-navy: #0a192f;
  --ia-navy-light: #14284a;
  --ia-accent: #2563eb;
  --ia-accent-dark: #1d4ed8;
  --ia-success: #16a34a;
  --ia-danger: #dc2626;
  --ia-warning: #d97706;
  --ia-info: #0ea5e9;
  --ia-purple: #7c3aed;

  --ia-bg: #f3f5f9;
  --ia-card: #ffffff;
  --ia-border: #e6e9f0;
  --ia-text: #1f2430;
  --ia-text-muted: #6b7280;
  --ia-radius: 14px;
  --ia-radius-sm: 8px;
  --ia-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --ia-sidebar-w: 264px;
}

* { box-sizing: border-box; }

body {
  background: var(--ia-bg);
  color: var(--ia-text);
  font-family: "Inter", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14.5px;
}

a { text-decoration: none; }

/* -------------------------------------------------- layout shell -- */
.ia-shell { display: flex; min-height: 100vh; }

.ia-sidebar {
  width: var(--ia-sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--ia-navy) 0%, var(--ia-navy-light) 100%);
  color: #cfd8e8;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 1030;
  transition: transform .25s ease;
}

.ia-sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.ia-sidebar-brand img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; background: #fff; padding: 3px; }
.ia-sidebar-brand .brand-name { font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.ia-sidebar-brand .brand-sub { font-size: 11px; color: #93a2bd; }

.ia-nav { padding: 14px 12px; list-style: none; margin: 0; }
.ia-nav li { margin-bottom: 3px; }
.ia-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--ia-radius-sm);
  color: #b9c4da; font-weight: 500; font-size: 13.6px;
  transition: background .15s ease, color .15s ease;
}
.ia-nav a i { width: 18px; text-align: center; font-size: 15px; opacity: .9; }
.ia-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.ia-nav a.active { background: var(--ia-accent); color: #fff; box-shadow: 0 4px 10px rgba(37,99,235,.35); }

.ia-nav-section-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px;
  color: #6b7d9c; padding: 16px 14px 6px;
}

/* -------------------------------------------------- main column -- */
.ia-main { margin-left: var(--ia-sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.ia-topbar {
  height: 66px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; background: var(--ia-card); border-bottom: 1px solid var(--ia-border);
  position: sticky; top: 0; z-index: 1020;
}
.ia-topbar h1 { font-size: 18px; font-weight: 700; margin: 0; color: var(--ia-text); }
.ia-topbar .ia-breadcrumb { font-size: 12.5px; color: var(--ia-text-muted); }
.ia-burger { display: none; border: none; background: none; font-size: 20px; color: var(--ia-text); margin-right: 12px; }

.ia-user { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.ia-user .avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--ia-accent);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}

.ia-content { padding: 26px; flex: 1; }

/* -------------------------------------------------------- cards -- */
.ia-card {
  background: var(--ia-card); border: 1px solid var(--ia-border); border-radius: var(--ia-radius);
  box-shadow: var(--ia-shadow);
}
.ia-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--ia-border);
}
.ia-card-header h2 { font-size: 15.5px; font-weight: 700; margin: 0; }
.ia-card-body { padding: 22px; }
.ia-card-body.p-0 { padding: 0; }

/* --------------------------------------------------- stat cards -- */
.ia-stat {
  background: var(--ia-card); border: 1px solid var(--ia-border); border-radius: var(--ia-radius);
  box-shadow: var(--ia-shadow); padding: 20px; display: flex; align-items: center; gap: 14px;
}
.ia-stat .icon {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff; flex-shrink: 0;
}
.ia-stat .num { font-size: 24px; font-weight: 800; line-height: 1.1; }
.ia-stat .label { font-size: 12.5px; color: var(--ia-text-muted); font-weight: 600; }

/* ------------------------------------------------------- tables -- */
.ia-table-wrap { overflow-x: auto; }
table.ia-table { width: 100%; border-collapse: collapse; font-size: 13.6px; }
table.ia-table th {
  text-align: left; padding: 12px 16px; background: #f8f9fc; color: #566080;
  font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px;
  border-bottom: 1px solid var(--ia-border); white-space: nowrap;
}
table.ia-table td { padding: 12px 16px; border-bottom: 1px solid var(--ia-border); vertical-align: middle; }
table.ia-table tbody tr:hover { background: #f8fafc; }
table.ia-table td.ia-title { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------------------------------------------- badges -- */
.ia-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.ia-badge-green { background: #e8f8ee; color: #0f7a3a; }
.ia-badge-red { background: #fdecec; color: #b91c1c; }
.ia-badge-yellow { background: #fef6e7; color: #92610a; }
.ia-badge-blue { background: #e9f1ff; color: #1d4ed8; }
.ia-badge-purple { background: #f2ebfd; color: #6d28d9; }
.ia-badge-gray { background: #eef0f4; color: #4b5563; }

/* -------------------------------------------------------- filters -- */
.ia-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ia-filters .form-control,
.ia-filters .form-select { font-size: 13px; }

/* ---------------------------------------------------- pagination -- */
.ia-pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; gap: 12px; flex-wrap: wrap; }
.ia-pagination .info { font-size: 12.5px; color: var(--ia-text-muted); }

/* --------------------------------------------------- action menu -- */
.ia-actions .btn { --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .6rem; font-size: 12.5px; }
.ia-dropdown-menu { font-size: 13px; min-width: 220px; }
.ia-dropdown-menu .dropdown-item { padding: 8px 16px; display: flex; align-items: center; gap: 10px; }
.ia-dropdown-menu .dropdown-item i { width: 16px; text-align: center; color: var(--ia-text-muted); }
.ia-dropdown-menu .dropdown-item.text-danger i { color: var(--ia-danger); }

/* -------------------------------------------------------- modals -- */
.modal-content { border-radius: var(--ia-radius); border: none; box-shadow: 0 20px 60px rgba(16,24,40,.25); }
.modal-header { border-bottom: 1px solid var(--ia-border); padding: 18px 22px; }
.modal-header .modal-title { font-weight: 700; font-size: 16px; }
.modal-footer { border-top: 1px solid var(--ia-border); padding: 16px 22px; }
.modal-body { padding: 22px; }
.modal .form-label { font-size: 12.6px; font-weight: 600; color: #384153; margin-bottom: 5px; }
.modal .section-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  color: var(--ia-accent); margin: 18px 0 12px; padding-top: 14px; border-top: 1px dashed var(--ia-border);
}
.modal .section-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* --------------------------------------------------------- empty -- */
.ia-empty { text-align: center; padding: 60px 20px; color: var(--ia-text-muted); }
.ia-empty i { font-size: 34px; margin-bottom: 12px; opacity: .35; display: block; }

/* --------------------------------------------------------- toast -- */
#iaToastHost { position: fixed; right: 20px; bottom: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.ia-toast {
  min-width: 260px; max-width: 360px; background: #1f2430; color: #fff; border-radius: 10px;
  padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; align-items: flex-start; gap: 10px;
  animation: ia-toast-in .18s ease-out;
}
.ia-toast.ok i { color: #4ade80; }
.ia-toast.err i { color: #f87171; }
.ia-toast .msg { font-size: 13px; line-height: 1.4; }
@keyframes ia-toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ------------------------------------------------------ loading -- */
.ia-loading-row td { text-align: center; padding: 40px !important; color: var(--ia-text-muted); }
.ia-spin { display: inline-block; animation: ia-spin 0.8s linear infinite; }
@keyframes ia-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------- login page -- */
.ia-login-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(1200px 600px at 20% 10%, #14284a 0%, var(--ia-navy) 55%, #060f1e 100%);
  position: relative; overflow: hidden;
}
.ia-login-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 36px 32px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35); position: relative; z-index: 2;
}
.ia-login-card .logo { width: 64px; margin: 0 auto 14px; display: block; }
.ia-login-card h1 { font-size: 19px; font-weight: 800; text-align: center; margin-bottom: 2px; }
.ia-login-card p.sub { text-align: center; color: var(--ia-text-muted); font-size: 12.8px; margin-bottom: 22px; }
.ia-login-decoration { position: absolute; color: rgba(255,255,255,.06); font-size: 120px; z-index: 1; }
.ia-login-decoration.d1 { top: -20px; left: -30px; }
.ia-login-decoration.d2 { bottom: -30px; right: -20px; }
.ia-login-wrap > .text-center { position: relative; z-index: 2; width: 100%; max-width: 400px; }
@media (max-width: 480px) {
  .ia-login-card { padding: 28px 20px; border-radius: 14px; }
  .ia-login-decoration { font-size: 80px; }
}

/* ------------------------------------------------------ overlay -- */
.ia-sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(10,25,47,.5); z-index: 1025;
}

/* ------------------------------------------------------- helpers -- */
.ia-muted { color: var(--ia-text-muted); }
.ia-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ia-text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ia-avatar-thumb { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; border: 1px solid var(--ia-border); }

/* ----------------------------------------------------- responsive -- */
@media (max-width: 991.98px) {
  .ia-sidebar { transform: translateX(-100%); }
  .ia-sidebar.show { transform: translateX(0); }
  .ia-main { margin-left: 0; }
  .ia-burger { display: inline-block; }
  .ia-sidebar-backdrop.show { display: block; }
}

@media (max-width: 575.98px) {
  .ia-content { padding: 16px; }
  .ia-topbar { padding: 0 14px; }
  .ia-card-body { padding: 16px; }
  .ia-pagination { flex-direction: column; align-items: stretch; }
}
