/*
 * Sistem Inventaris Barang - UKK MAKN ENDE
 * Tema: Blue Sidebar (Dark Left + Light Content)
 * Dibuat untuk keperluan UKK
 */

/* ================================================
   CSS VARIABLES
================================================ */
:root {
  --blue-dark: #1e3a5f; /* sidebar utama */
  --blue-mid: #254b7a; /* hover sidebar */
  --blue-accent: #4a90d9; /* warna aksen / active */
  --blue-light: #e8f1fb; /* background highlight */
  --blue-soft: #5ba3e8; /* button dll */
  --blue-btn: #3d7fc1; /* tombol primary */
  --blue-btn-hv: #2f6aa8;

  --white: #ffffff;
  --bg-page: #f2f5f9; /* abu sangat tipis */
  --bg-card: #ffffff;

  --text-dark: #1e293b;
  --text-mid: #4a5568;
  --text-soft: #718096;
  --text-sidebar: #c8d8ed; /* text di sidebar gelap */
  --text-sidebar-active: #ffffff;

  --border: #dce6f0;
  --border-light: #edf2f7;

  --success: #27ac76;
  --danger: #e05252;
  --warning: #e09a2a;
  --info: #4a90d9;

  --sidebar-w: 240px;
  --topbar-h: 58px;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.08);
  --trans: all 0.18s ease;

  --font: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ================================================
   RESET & BASE
================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.6;
}

body.bg-body-custom {
  background: var(--bg-page);
  overflow: hidden;
  height: 100vh;
}

/* ================================================
   LAYOUT UTAMA
================================================ */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ================================================
   SIDEBAR (KIRI - BIRU GELAP)
================================================ */
.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--blue-dark);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Brand di sidebar */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-decoration: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--blue-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-icon svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.brand-text {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.2px;
}

.brand-text strong {
  font-weight: 700;
  color: #7ec8f5;
}

/* Navigasi di sidebar */
.sidebar-menu {
  padding: 16px 12px;
  flex: 1;
}

.menu-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(200, 216, 237, 0.45);
  padding: 0 8px;
  margin: 14px 0 6px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius);
  color: var(--text-sidebar);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  transition: var(--trans);
}

.menu-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.75;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.menu-item:hover svg {
  opacity: 1;
}

.menu-item.active {
  background: var(--blue-accent);
  color: #fff;
  font-weight: 500;
}

.menu-item.active svg {
  opacity: 1;
}

/* ================================================
   MAIN AREA (KANAN)
================================================ */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Topbar */
.app-topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.topbar-left h5 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-page);
}

.avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info-top {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-info-top span:first-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.user-info-top span:last-child {
  font-size: 11px;
  color: var(--text-soft);
}

.btn-logout-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
  background: transparent;
  text-decoration: none;
  transition: var(--trans);
  border: 1px solid var(--border);
}

.btn-logout-icon:hover {
  background: #fde8e8;
  color: var(--danger);
  border-color: #fca5a5;
}

/* Content Area */
.app-content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  padding-bottom: 48px;
  background: var(--bg-page);
}

/* ================================================
   PAGE HEADER
================================================ */
.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 3px;
}

.page-header p {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
}

/* ================================================
   CARDS
================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-light);
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dark);
}

.card-body {
  padding: 18px;
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: var(--trans);
}

.stat-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

.stat-card .stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.stat-card .stat-icon svg {
  width: 18px;
  height: 18px;
}

.stat-card .stat-icon.primary {
  background: var(--blue-light);
  color: var(--blue-accent);
}

.stat-card .stat-icon.success {
  background: #d4f4e6;
  color: var(--success);
}

.stat-card .stat-icon.warning {
  background: #fdf0d5;
  color: var(--warning);
}

.stat-card .stat-icon.danger {
  background: #fde8e8;
  color: var(--danger);
}

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 2px;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 4px;
}

/* ================================================
   TOMBOL / BUTTONS
================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--trans);
  text-decoration: none;
  line-height: 1.4;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--blue-btn);
  color: #fff;
  border-color: var(--blue-btn);
}

.btn-primary:hover {
  background: var(--blue-btn-hv);
  border-color: var(--blue-btn-hv);
  color: #fff;
}

.btn-outline-primary {
  border-color: var(--blue-btn);
  color: var(--blue-btn);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--blue-btn);
  color: #fff;
}

.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn-outline-success {
  border-color: var(--success);
  color: var(--success);
  background: transparent;
}

.btn-outline-success:hover {
  background: var(--success);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-outline-danger {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}

.btn-outline-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-warning {
  background: var(--warning);
  border-color: var(--warning);
  color: #fff;
}

.btn-outline-info {
  border-color: var(--info);
  color: var(--info);
  background: transparent;
}

.btn-outline-info:hover {
  background: var(--info);
  color: #fff;
}

.btn-secondary {
  background: #64748b;
  border-color: #64748b;
  color: #fff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-sm svg {
  width: 13px;
  height: 13px;
}

.btn-lg {
  padding: 10px 20px;
  font-size: 14px;
}

/* ================================================
   FORMS
================================================ */
.form-control,
.form-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text-dark);
  background: #fff;
  transition: var(--trans);
  outline: none;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--blue-accent);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.12);
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
  margin-bottom: 5px;
  display: block;
}

.form-control-lg {
  padding: 10px 14px;
  font-size: 14px;
}

/* ================================================
   TABLE
================================================ */
.table {
  margin: 0;
  width: 100%;
  border-collapse: collapse;
}

.table th {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-soft);
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  white-space: nowrap;
}

.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text-dark);
}

.table-hover tbody tr:hover td {
  background: #f8fbff;
}

/* DataTables Controls */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  font-size: 12.5px;
  color: var(--text-soft);
  margin: 10px 0;
}

.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
}

.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-family: var(--font);
  font-size: 13px;
  outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--blue-accent);
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.1);
}

.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 28px 6px 10px;
  font-family: var(--font);
  font-size: 13px;
  appearance: none;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E")
    no-repeat right 8px center;
  cursor: pointer;
  outline: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  background: #fff !important;
  color: var(--text-mid) !important;
  margin: 0 2px;
  padding: 5px 10px !important;
  font-size: 12.5px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--blue-btn) !important;
  border-color: var(--blue-btn) !important;
  color: #fff !important;
}

.dataTables_wrapper
  .dataTables_paginate
  .paginate_button:hover:not(.current):not(.disabled) {
  background: var(--blue-light) !important;
  border-color: var(--blue-accent) !important;
  color: var(--blue-btn) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ================================================
   BADGES
================================================ */
.badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  font-family: var(--font);
}

.badge.bg-success {
  background: #d4f4e6 !important;
  color: #17805a !important;
}

.badge.bg-warning {
  background: #fdf0d5 !important;
  color: #a56e10 !important;
}

.badge.bg-danger {
  background: #fde8e8 !important;
  color: #c0392b !important;
}

.badge.bg-primary {
  background: var(--blue-light) !important;
  color: var(--blue-btn) !important;
}

/* ================================================
   ALERTS
================================================ */
.alert {
  border: none;
  border-left: 3px solid;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13.5px;
}

.alert-danger {
  background: #fde8e8;
  border-left-color: var(--danger);
  color: #b91c1c;
}

.alert-success {
  background: #d4f4e6;
  border-left-color: var(--success);
  color: #166534;
}

.alert-warning {
  background: #fdf0d5;
  border-left-color: var(--warning);
  color: #92400e;
}

.alert-info {
  background: var(--blue-light);
  border-left-color: var(--blue-accent);
  color: var(--blue-btn);
}

/* ================================================
   LIST GROUP
================================================ */
.list-group-item {
  border-color: var(--border-light);
  padding: 12px 16px;
  font-size: 13.5px;
}

/* ================================================
   HALAMAN LOGIN
================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--bg-page);
  overflow: hidden;
}

/* Panel kiri - biru solid */
.login-left-panel {
  width: 42%;
  background: var(--blue-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.login-left-panel::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 280px;
  height: 280px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

.login-left-panel::after {
  content: "";
  position: absolute;
  bottom: -100px;
  left: -60px;
  width: 320px;
  height: 320px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
}

.login-left-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
}

.login-left-inner .logo-box {
  width: 64px;
  height: 64px;
  background: var(--blue-accent);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.login-left-inner .logo-box svg {
  width: 32px;
  height: 32px;
  color: #fff;
}

.login-left-inner h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #fff;
}

.login-left-inner p {
  font-size: 13.5px;
  color: rgba(200, 220, 240, 0.8);
  line-height: 1.6;
}

/* Panel kanan - form login */
.login-right-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: #fff;
}

.login-form-box {
  width: 100%;
  max-width: 380px;
}

.login-form-box .login-heading {
  margin-bottom: 28px;
}

.login-form-box .login-heading h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 4px;
}

.login-form-box .login-heading p {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
}

.login-form-box .form-group {
  margin-bottom: 16px;
}

.login-form-box .btn-login {
  width: 100%;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  background: var(--blue-btn);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--trans);
  font-family: var(--font);
}

.login-form-box .btn-login:hover {
  background: var(--blue-btn-hv);
}

.login-demo-box {
  margin-top: 20px;
  background: var(--blue-light);
  border: 1px solid #c5daf5;
  border-radius: var(--radius);
  padding: 12px 16px;
}

.login-demo-box p {
  margin: 0;
  font-size: 12.5px;
  color: var(--blue-btn);
}

/* ================================================
   SCROLLBAR
================================================ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c5d5e8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0b9d5;
}

/* ================================================
   RESPONSIVE
================================================ */
@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    left: -240px;
    top: 0;
    height: 100vh;
    z-index: 999;
    transition: left 0.25s ease;
  }

  .app-sidebar.open {
    left: 0;
  }

  .app-content-area {
    padding: 16px;
  }

  .login-left-panel {
    display: none;
  }
}
