/* ========================================
   THEME VARIABLES
======================================== */
:root {
  /* Brand */
  --primary-color: #02499a;
  --secondary-color: #afc3e8;
  --secondary-soft: rgba(47, 107, 210, 0.2);

  /* Accent */
  --accent-color: #f4b41a;
  --accent-soft: #ffd36a;

  /* State */
  --success-color: #22c55e;
  --danger-color: #ef4444;
  --warning-color: #f4b41a;
  --info-color: #2c7be5;

  /* Neutral */
  --light-color: #ffffff;
  --dark-color: #0a1220;
  --text-muted: #64748b;
  --border-color: #e5e7eb;
  --border-dark: #334155;

  /* Layout */
  --navbar-height: 65px;
  --footer-height: 55px;

  /* Shadow */
  --shadow-soft: 0 4px 10px rgba(0, 0, 0, 0.05),
    0 12px 30px rgba(10, 58, 107, 0.08);
  --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.06),
    0 18px 40px rgba(31, 107, 170, 0.12);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 18px;
}

/* Dark mode (bisa dikembangkan nanti) */
@media (prefers-color-scheme: dark) {
  :root {
    --danger-color: #f87171;
    --info-color: #60a5fa;
    --accent-soft: #ffe08a;
    /* sisanya masih sama untuk sekarang */
  }
}

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

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--light-color);
  color: var(--dark-color);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ========================================
   UPLOAD BOX
======================================== */
.upload-box {
  border: 2px dashed var(--secondary-soft);
  border-radius: 10px;
  padding: 15px 5px;
  text-align: center;
  background: #fbfdff;
  transition: 0.25s ease;
  cursor: pointer;
}

.upload-box:hover,
.upload-box.dragging {
  background: #eef5ff;
  border-color: var(--primary-color);
}

.upload-box input[type="file"] {
  display: none;
}

/* ========================================
   NAVBAR
======================================== */
.custom-navbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 999 !important;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--primary-color) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.custom-btn {
  color: var(--light-color) !important;
}

.app-title {
  color: var(--light-color);
  font-size: 1.1rem;
  font-weight: 600;
}

/* ========================================
   MAIN CONTENT
======================================== */
.main-content {
  padding: 20px;
  padding-top: calc(var(--navbar-height) + 20px);
  padding-bottom: calc(var(--footer-height) + 25px);
  transition: 0.25s ease;
  min-height: 100vh;
  position: relative;
}

/* ========================================
   SIDEBAR
======================================== */
.sidebar-offcanvas {
  width: 350px !important;
}

.offcanvas-header.sidebar-header {
  background: #feffff !important;
  padding: 14px 12px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.logo-container {
  width: 145px;
  height: 100px;
  background: center / contain no-repeat url("../img/logo_fli.png");
  margin: 0 auto 10px;
  flex-shrink: 0;
}

.sidebar-header h4 {
  font-size: 1.45rem;
  letter-spacing: 1px;
  color: var(--light-color);
  margin-bottom: 4px;
}

.sidebar-header small {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.sidebar-nav {
  padding: 8px;
}

/* Menu link */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 4px;
  color: var(--dark-color);
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  transition: 0.25s ease;
}

.sidebar-link i {
  font-size: 18px;
}

.sidebar-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  width: 4px;
  height: 0;
  border-radius: 8px;
  background: var(--primary-color);
  transition: 0.25s ease;
}

.sidebar-link:hover,
.router-link-active {
  background: rgba(47, 109, 178, 0.1);
  color: var(--primary-color) !important;
}

.sidebar-link:hover::before,
.router-link-active::before {
  height: 70%;
}

/* Submenu */
.submenu-wrapper {
  margin-left: 12px;
  border-left: 3px solid var(--secondary-soft);
  padding-left: 4px;
}

.sidebar-sublink {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.sidebar-sublink span {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.toggle-icon {
  font-size: 13px;
  transition: 0.25s ease;
}

/* Submenu animation */
.submenu-fade-enter-active,
.submenu-fade-leave-active {
  transition: 0.25s ease;
  overflow: hidden;
}

.submenu-fade-enter-from,
.submenu-fade-leave-to {
  opacity: 0;
  max-height: 0;
}

.submenu-fade-enter-to,
.submenu-fade-leave-from {
  opacity: 1;
  max-height: 200px;
}

/* BUTTON */

.button-modern {
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  color: var(--light-color);
  font-weight: 600;
  cursor: pointer;
  background: var(--primary-color);
  transition: 0.25s ease, box-shadow 0.25s ease;
}

.button-modern:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}

/* Icon button */
.btn-icon-hover {
  border: 1px solid #dee2e6;
  background-color: #f8f9fa;
  border-radius: 6px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.025rem;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.btn-icon-hover:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-icon-hover + .btn-icon-hover {
  margin-left: 6px;
}

.btn-icon-hover.icon-primary { color: var(--primary-color); }
.btn-icon-hover.icon-primary:hover:not(:disabled) {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.btn-icon-hover.icon-secondary { color: #6c757d; }
.btn-icon-hover.icon-secondary:hover:not(:disabled) {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

.btn-icon-hover.icon-warning { color: #ffc107; }
.btn-icon-hover.icon-warning:hover:not(:disabled) {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #fff;
}

.btn-icon-hover.icon-success { color: #198754; }
.btn-icon-hover.icon-success:hover:not(:disabled) {
  background-color: #198754;
  border-color: #198754;
  color: #fff;
}

.btn-icon-hover.icon-danger { color: #dc3545; }
.btn-icon-hover.icon-danger:hover:not(:disabled) {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

/* ========================================
   CARD
======================================== */
.card-modern {
  position: relative;
  background: var(--light-color);
  backdrop-filter: blur(15px);
  border-radius: var(--radius-xl);
  padding: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: 0.25s ease;
}

.card-modern::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: var(--primary-color);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card-modern:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card-title-modern {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--dark-color);
  margin-bottom: 10px;
}

.card-desc-modern {
  color: var(--secondary-color);
  font-size: 0.95rem;
}

.card-modern label,
.card-modern div,
.card-modern h3 {
  color: var(--dark-color);
}

.card-modern label {
  font-weight: 600;
}

.card-header-modern h5 {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary-color);
}

/* Detail row */
.detail-row {
  display: flex;
  flex-wrap: wrap;
}

.detail-item {
  flex: 1 1 0;
  min-width: 160px;
  padding: 0 24px;
  margin-bottom: 4px;
}

.detail-item + .detail-item {
  border-left: 1px solid var(--border-dark);
}

.detail-item:first-child {
  padding-left: 0;
}

.detail-item label {
  display: block;
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 500;
  margin-bottom: 6px;
}

.detail-value {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
}

.detail-value.text-primary {
  color: var(--primary-color) !important;
}

/* ========================================
   TABLE
======================================== */
.modern-table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: var(--radius-xl);
}

.table-modern {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--light-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.table-modern th,
.table-modern td {
  white-space: nowrap;
  padding: 14px 16px;
}

.table-modern thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #e6e4e4;
  color: #1f2937;
  font-weight: 600;
}

.table-modern tbody td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: #1f2937;
  font-weight: 500;
}

/* Sticky columns */
.sticky-col {
  position: sticky;
  background: var(--light-color);
  z-index: 10;
}

.table-modern thead .sticky-col {
  z-index: 30;
}

.col-1 { left: 0; min-width: 80px; }
.col-2 { left: 80px; min-width: 220px; }
.col-3 { left: 300px; min-width: 220px; }

/* FORM */
.form-control,
.form-select {
  width: 100%;
  min-height: 20px;
  border-radius: var(--radius-md);
  border: 1px solid #dfe3e8;
  padding: 8px 16px;
  font-size: 0.85rem;
  transition: 0.25s ease;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-soft);
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--primary-color);
}

/* Multiselect */
.multiselect {
  min-height: 45px;
  border-radius: var(--radius-md) !important;
  border: 1px solid #dfe3e8 !important;
  font-size: 14px;
}

.multiselect.is-active {
  border-color: #0d6efd !important;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.multiselect-placeholder {
  color: #6c757d !important;
}

.multiselect-single-label,
.multiselect-option,
.multiselect-input {
  color: #212529 !important;
}

.multiselect-option.is-selected {
  background: #0d6efd !important;
  color: var(--light-color) !important;
}

.multiselect-option.is-pointed {
  background: #f1f5ff !important;
  color: #212529 !important;
}

/* MODAL */
.modal {
  position: fixed !important;
  inset: 0;
  z-index: 1055;
}

body.modal-open {
  overflow: hidden;
}

.modal-content {
  border-radius: 22px;
  border: none;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
}

.modal-header {
  background: var(--primary-color);
  border-bottom: none;
}

.modal-title {
  font-weight: 600;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 16px 24px;
}

.modal-backdrop {
  position: fixed;
}

/* FOOTER*/
.modern-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--primary-color);
  color: var(--light-color);
  z-index: 999;
}

.footer-text {
  font-size: 0.9rem;
  font-weight: 500;
}

/* BADGE & STATUS */
.badge-modern {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.badge-success {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success-color);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger-color);
}

.badge-warning {
  background: rgba(244, 180, 26, 0.15);
  color: #9a6b00;
}

.status-success { color: #16a34a; font-weight: 600; }
.status-danger  { color: #dc2626; font-weight: 600; }
.status-warning { color: #d97706; font-weight: 600; }
.status-secondary { color: #6b7280; font-weight: 600; }

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 6px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/*DASHBOARD */
.dashboard-container {
  padding: 5px 0;
}

.dashboard-header {
  margin-bottom: 20px;
}

.dashboard-title {
  color: var(--dark-color);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.dashboard-subtitle {
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Summary cards */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.summary-card {
  position: relative;
  background: var(--light-color);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  height: 85px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
  transition: 0.25s ease;
  overflow: hidden;
}

.summary-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 100%;
  background: var(--primary-color);
}

.summary-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.summary-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0;
}

.summary-card h3 {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
}

/* Status variants */
.summary-card.total::before   { background: #2f6bd2; }
.summary-card.active::before  { background: var(--success-color); }
.summary-card.expired::before { background: var(--danger-color); }
.summary-card.warning::before { background: var(--warning-color); }

.summary-card.total h3   { color: var(--primary-color); }
.summary-card.active h3  { color: var(--success-color); }
.summary-card.expired h3 { color: var(--danger-color); }
.summary-card.warning h3 { color: var(--warning-color); }

/* Alert */
.alert-box {
  background: #fff7d6;
  border-left: 5px solid var(--warning-color);
  padding: 14px 20px;
  border-radius: 14px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-box strong {
  font-size: 14px;
}

.btn-alert {
  background: var(--warning-color);
  color: var(--light-color);
  border: none;
  padding: 9px 20px;
  border-radius: 10px;
  font-weight: 600;
}

/* DOCUMENT DETAIL */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1e293b;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-dark);
}

.section-title i {
  font-size: 18px;
  margin: 0 !important;
}

.document-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-dark);
  border-radius: 14px;
  padding: 18px;
  background: var(--light-color);
  transition: 0.25s ease;
}

.document-card:hover {
  box-shadow: var(--shadow-soft);
}

.document-info {
  display: flex;
  align-items: center;
}

.document-icon {
  font-size: 42px;
  color: #dc3545;
}

.document-meta {
  margin-left: 15px;
}

.document-name {
  font-weight: 700;
}

.document-size {
  color: #6b7280;
  font-size: 13px;
}

.pdf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* NOTIFICATION DROPDOWN */
.notification-dropdown {
  width: 300px;
}

.notification-dropdown hr {
  margin: 3px 0;
}

.notification-dropdown .btn {
  border-radius: 10px;
}

/*PROFILE DROPDOWN (baru) */
.profile-dropdown {
  min-width: 240px;
  padding-top: 0;
  max-height: 70vh;
  overflow-y: auto;
}

.profile-dropdown .dropdown-header {
  font-weight: 600;
  font-size: 0.95rem;
}

.profile-dropdown .dropdown-item {
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
}

.profile-dropdown .dropdown-item:hover {
  background-color: #f1f3f5;
}

.profile-dropdown .text-danger:hover {
  background-color: #fff5f5;
  color: #dc3545 !important;
}

/* RESPONSIVE*/
@media (max-width: 768px) {
  .custom-navbar {
    left: 0;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .modern-footer {
    left: 0;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}