/* ── Inixindo Brand Colors ─────────────────────────────────────── */
:root {
  --inix-navy:    #1c3263;
  --inix-navy-dk: #152650;
  --inix-navy-lt: #2a4a8a;
  --inix-red:     #cc1f37;
  --inix-red-dk:  #a81830;
  --inix-blue:    #89b4d4;
  --inix-blue-lt: #d0e6f4;

  --sidebar-width:  240px;
  --topbar-height:  56px;
  --primary:        var(--inix-navy);
  --sidebar-bg:     var(--inix-navy);
  --body-bg:        #f0f4f8;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--body-bg);
  min-height: 100vh;
}

.wrapper { min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--inix-navy);
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  background: var(--inix-navy-dk);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-brand .brand-name {
  font-weight: 900;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 0.12em;
  line-height: 1.1;
}

.sidebar-brand .brand-sub {
  font-size: 0.63rem;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
  line-height: 1.2;
}

.sidebar .nav-section {
  padding: 10px 12px 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
}

.sidebar .nav-link {
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
}

.sidebar .nav-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar .nav-link.active {
  background: var(--inix-red);
  color: #fff !important;
}

.sidebar .nav-link i {
  width: 20px;
  text-align: center;
  opacity: 0.85;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 12px 12px;
  margin-top: auto;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
  flex-shrink: 0;
  background: var(--inix-red) !important;
}

/* ── Main content ────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  box-shadow: 0 1px 0 #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 12px;
}

main { flex: 1; padding-top: 1.5rem; }

/* ── Notification Bell ───────────────────────────────────────── */
.notif-btn {
  position: relative;
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.notif-btn:hover { background: #f1f5f9; color: var(--inix-navy); }

.notif-badge {
  position: absolute;
  top: 3px; right: 3px;
  background: var(--inix-red);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
  line-height: 1;
}
.notif-badge.d-none { display: none !important; }

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  border: 1px solid #e2e8f0;
  z-index: 200;
  display: none;
  max-height: 480px;
  overflow: hidden;
  flex-direction: column;
}
.notif-dropdown.show { display: flex; }

.notif-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-list {
  overflow-y: auto;
  flex: 1;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f8fafc;
  cursor: pointer;
  transition: background 0.12s;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
}
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #f0f6ff; }
.notif-item.unread:hover { background: #e8f0fd; }

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--inix-red);
  flex-shrink: 0;
  margin-top: 6px;
}

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 0.83rem; font-weight: 600; color: #1e293b; margin-bottom: 2px; }
.notif-body { font-size: 0.78rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 0.72rem; color: #94a3b8; margin-top: 3px; }

.notif-empty { padding: 32px 16px; text-align: center; color: #94a3b8; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  border: 1px solid #e8edf5;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-header {
  background: #f8fafc;
  border-bottom: 1px solid #e8edf5;
  border-radius: 12px 12px 0 0 !important;
  padding: 12px 16px;
  font-size: 0.85rem;
}

/* ── Form Card (digunakan di detail cuti/reimburse) ─────────── */
.form-card {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  overflow: hidden;
}

.section-header {
  background: #f8fafc;
  border-bottom: 1px solid #e8edf5;
  padding: 12px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
}

.section-body {
  padding: 18px;
}

/* ── Info labels (dalam detail card) ────────────────────────── */
.info-label {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-value {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.95rem;
  line-height: 1.3;
}

.info-sub {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 1px;
}

/* ── Stat Card ───────────────────────────────────────────────── */
.stat-card {
  border: 1px solid #e8edf5;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 0.15s, box-shadow 0.15s;
  background: #fff;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(28,50,99,0.1);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* ── Tables ──────────────────────────────────────────────────── */
.table-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid #e8edf5;
  overflow: hidden;
}

.table thead th {
  background: #f8fafc;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 1rem;
}

.table tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  font-size: 0.875rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }

/* ── Status badges ───────────────────────────────────────────── */
.badge-status {
  padding: 0.3em 0.7em;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-cancelled { background: #f1f5f9; color: #64748b; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  background-color: var(--inix-navy);
  border-color: var(--inix-navy);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--inix-navy-lt);
  border-color: var(--inix-navy-lt);
  color: #fff;
}

.btn-danger {
  background-color: var(--inix-red);
  border-color: var(--inix-red);
}
.btn-danger:hover {
  background-color: var(--inix-red-dk);
  border-color: var(--inix-red-dk);
}

.btn-outline-primary {
  color: var(--inix-navy);
  border-color: var(--inix-navy);
}
.btn-outline-primary:hover {
  background-color: var(--inix-navy);
  border-color: var(--inix-navy);
  color: #fff;
}

.btn-outline-success {
  color: #16a34a;
  border-color: #16a34a;
}
.btn-outline-success:hover {
  background-color: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

/* ── Form elements ───────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
  border-color: var(--inix-navy);
  box-shadow: 0 0 0 0.2rem rgba(28,50,99,0.15);
}

.form-label { font-weight: 600; font-size: 0.875rem; color: #374151; }

/* ── Page header ─────────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.page-title { font-size: 1.35rem; font-weight: 700; color: var(--inix-navy); margin: 0; }
.page-subtitle { font-size: 0.875rem; color: #64748b; margin: 0; }

/* ── Timeline ────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem; top: 0; bottom: 0;
  width: 2px;
  background: #e2e8f0;
}
.timeline-item { position: relative; padding-bottom: 1.25rem; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -1.1rem; top: 0.3rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--inix-navy);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--inix-navy);
}

/* ── Login page ─────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--inix-navy-dk) 0%, var(--inix-navy) 50%, var(--inix-navy-lt) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.login-logo {
  width: 52px;
  height: 52px;
  background: var(--inix-red);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.6rem;
  margin: 0 auto 1rem;
}

/* ── Progress bar ────────────────────────────────────────────── */
.progress-bar { background-color: var(--inix-navy); }
.progress-bar.bg-info { background-color: var(--inix-blue) !important; }

/* ── Reimburse items table ───────────────────────────────────── */
.items-table td, .items-table th { padding: 8px !important; vertical-align: middle; }
.items-table .btn-remove {
  background: none;
  border: 1px solid #fee2e2;
  color: var(--inix-red);
  border-radius: 6px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s;
}
.items-table .btn-remove:hover { background: #fee2e2; }

.total-row { background: #f8fafc; font-weight: 700; }
.total-row td { border-top: 2px solid #e2e8f0 !important; }

/* ── Attachment preview ──────────────────────────────────────── */
.attachment-preview {
  margin-top: 8px;
  padding: 8px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e8edf5;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* ── Utility ─────────────────────────────────────────────────── */
.fw-mono { font-family: 'Courier New', monospace; }
.text-inix-navy { color: var(--inix-navy) !important; }
.text-inix-red  { color: var(--inix-red) !important; }
.bg-inix-navy   { background-color: var(--inix-navy) !important; }
.bg-inix-red    { background-color: var(--inix-red) !important; }

/* ════════════════════════════════════════════════════════════════
   PRINT STYLES — tampil rapi saat dicetak
   ════════════════════════════════════════════════════════════════ */
.print-only { display: none; }

@media print {
  /* Sembunyikan elemen yang tidak perlu saat cetak */
  .sidebar,
  .topbar,
  .no-print,
  .notif-btn,
  .notif-dropdown,
  .breadcrumb,
  .btn-outline-secondary,
  .btn-outline-danger,
  .btn-outline-primary,
  .btn-primary,
  .btn-success,
  .btn-danger,
  .alert {
    display: none !important;
  }

  /* Tampilkan elemen khusus cetak */
  .print-only { display: block !important; }

  /* Reset layout untuk print */
  body {
    background: #fff !important;
    font-family: Arial, sans-serif;
    font-size: 11pt;
  }

  .wrapper { display: block; }
  .main-content {
    margin-left: 0 !important;
    padding: 0;
  }

  main {
    padding: 0 !important;
  }

  /* Header cetak */
  .print-header {
    text-align: center;
    border-bottom: 2px solid #1c3263;
    padding-bottom: 12px;
    margin-bottom: 20px;
  }

  .print-header strong {
    color: #1c3263;
    font-size: 16pt;
    display: block;
    letter-spacing: 0.1em;
  }

  /* Cards */
  .form-card, .card, .table-container {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 16px;
  }

  .section-header {
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Badges */
  .badge-approved { background: #d1fae5 !important; color: #065f46 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge-rejected { background: #fee2e2 !important; color: #991b1b !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge-pending  { background: #fef3c7 !important; color: #92400e !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* Tabel */
  .table { border-collapse: collapse !important; }
  .table thead th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table tbody td, .table thead th { border: 1px solid #ddd !important; padding: 6px 8px !important; }

  /* Attachment images tampil saat cetak */
  .attachment-preview img { max-height: 200px !important; }

  /* Row 2 kolom */
  .row { display: flex; flex-wrap: wrap; }
  .col-lg-8 { width: 65%; padding-right: 16px; }
  .col-lg-4 { width: 35%; }
  .col-lg-7 { width: 60%; padding-right: 16px; }
  .col-lg-5 { width: 40%; }
  .col-md-6 { width: 50%; }
  .col-md-4 { width: 33.33%; }

  /* Sticky tidak berlaku saat print */
  .sticky-top { position: static !important; }

  @page {
    margin: 1.5cm;
    size: A4;
  }
}
