/* ============================================
   MYUTILITY 2.0 - Custom CSS
   Compact + Informative theme
   ============================================ */

:root {
  --primary: #1a3c6e;
  --primary-light: #2255a4;
  --primary-dark: #0f2444;
  --accent: #e8a020;
  --accent-light: #f0b84a;
  --sidebar-width: 240px;
  --sidebar-bg: #1a3c6e;
  --topbar-height: 56px;
  --topbar-bg: #ffffff;
  --body-bg: #eef1f7;
  --card-bg: #ffffff;
  --text-muted-custom: #6c757d;
  --border-color: #e2e6ed;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
}

/* ---- Base ---- */
body { background-color: var(--body-bg); font-family: 'Segoe UI', system-ui, sans-serif; font-size: 13px; }

/* ---- Topbar ---- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1030;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 5px rgba(0,0,0,.07);
  display: flex; align-items: center; padding: 0 16px 0 0;
}
#topbar .logo-box {
  width: var(--sidebar-width); min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  height: var(--topbar-height);
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  padding: 0 12px;
  overflow: hidden; transition: width .3s ease, min-width .3s ease;
}
#topbar .logo-box .logo-img {
  height: calc(var(--topbar-height) - 12px);
  width: auto; object-fit: contain; flex-shrink: 0;
}
#topbar .logo-box .logo-name-wrap { flex-shrink: 0; }
#topbar .logo-box .logo-text {
  color: #fff; font-weight: 800; font-size: 17px; letter-spacing: .3px;
  white-space: nowrap; line-height: 1;
}
#topbar .logo-box .logo-sub { display: none; }
#topbar .user-info.dropdown-toggle::after { display: none; }
#topbar .topbar-right { display: flex; align-items: center; gap: 2px; margin-left: auto; }
#topbar .topbar-btn {
  background: none; border: none; color: var(--text-muted-custom);
  width: 34px; height: 34px; border-radius: 50%; display:flex; align-items:center; justify-content:center;
  font-size: 15px; cursor: pointer; transition: all .2s;
}
#topbar .topbar-btn:hover { background: #f0f4ff; color: var(--primary); }
#topbar .user-info { display:flex; align-items:center; gap: 6px; cursor:pointer; padding: 3px 8px; border-radius: 6px; transition: background .2s; }
#topbar .user-info:hover { background: #f0f4ff; }
#topbar .user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display:flex; align-items:center; justify-content:center; font-weight: 700; font-size: 12px; }
#topbar .user-name { font-weight: 600; font-size: 13px; color: #333; }
#topbar .notif-badge { position: relative; }
#topbar .notif-badge .badge { position: absolute; top: 1px; right: 1px; font-size: 8px; padding: 1px 3px; }
#topbar .toggle-btn { color: #555; font-size: 17px; border: none; background: none; cursor: pointer; padding: 5px 8px; margin-left: 8px; }

/* ---- Sidebar ---- */
#sidebar {
  position: fixed; top: var(--topbar-height); left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  overflow-y: auto; overflow-x: hidden;
  z-index: 1020;
  transition: transform .3s ease, width .3s ease;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent;
}
#sidebar::-webkit-scrollbar { width: 3px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 3px; }

.sidebar-section-title {
  color: rgba(255,255,255,.4); font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; padding: 12px 16px 4px;
}
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  color: rgba(255,255,255,.75);
  text-decoration: none; font-size: 13px;
  transition: all .2s; position: relative;
}
.sidebar-nav li a:hover, .sidebar-nav li a.active { color: #fff; background: rgba(255,255,255,.1); }
.sidebar-nav li a.active { background: var(--primary-light); }
.sidebar-nav li a.active::before {
  content:''; position: absolute; left: 0; top:0; bottom:0; width:3px; background: var(--accent);
}
.sidebar-nav li a i { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; }
.sidebar-nav li a .menu-arrow { margin-left: auto; font-size: 10px; transition: transform .2s; }
.sidebar-nav li a[aria-expanded="true"] .menu-arrow { transform: rotate(90deg); }

.sidebar-submenu { list-style: none; padding: 0; margin: 0; background: rgba(0,0,0,.15); }
.sidebar-submenu li a { padding: 7px 16px 7px 44px; font-size: 12.5px; color: rgba(255,255,255,.6); }
.sidebar-submenu li a:hover, .sidebar-submenu li a.active { color: #fff; background: rgba(255,255,255,.08); }

/* ---- Main Content ---- */
#main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 12px 16px;
  min-height: calc(100vh - var(--topbar-height));
  transition: margin-left .3s ease;
}

/* ---- Page Header ---- */
.page-header { margin-bottom: 10px; }
.page-header h4 { font-size: 15px; font-weight: 700; color: #222; margin: 0; }
.breadcrumb { background: none; padding: 0; margin: 0; font-size: 11px; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-muted-custom); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted-custom); }

/* ---- Cards ---- */
.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,.07); border-radius: 6px; background: var(--card-bg); }
.card-header { background: #fff; border-bottom: 1px solid var(--border-color); border-radius: 6px 6px 0 0 !important; padding: 9px 14px; }
.card-header h5, .card-header h6 { margin: 0; font-weight: 600; color: #333; }
.card-body { padding: 14px; }

/* ---- Stat Cards ---- */
.stat-card { border-radius: 6px; padding: 22px 16px; color: #fff; position: relative; overflow: hidden; }
.stat-card .stat-icon { position: absolute; right: 12px; top: 14px; font-size: 36px; opacity: .2; }
.stat-card .stat-label { font-size: 12.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; opacity: .9; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 30px; font-weight: 800; }
.stat-card .stat-sub { font-size: 12.5px; opacity: .8; margin-top: 4px; }
.stat-card.blue-1 { background: linear-gradient(135deg, #14396b, #1f5591); }
.stat-card.blue-2 { background: linear-gradient(135deg, #14396b, #1f5591); }
.stat-card.blue-3 { background: linear-gradient(135deg, #14396b, #1f5591); }
.stat-card.blue-4 { background: linear-gradient(135deg, #14396b, #1f5591); }
.stat-card.blue   { background: linear-gradient(135deg, #14396b, #1f5591); }

/* ---- Buttons ---- */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-light); border-color: var(--accent-light); color: #fff; }
.btn-sm { padding: 3px 10px; font-size: 12px; }

/* ---- Forms ---- */
.form-label { font-weight: 600; font-size: 12px; color: #444; margin-bottom: 2px; }
.form-control, .form-select {
  border: 1px solid #d0d7e3; border-radius: 4px;
  font-size: 13px; padding: 4px 9px; height: auto;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary-light); box-shadow: 0 0 0 2px rgba(34,85,164,.10);
}
.form-control[readonly] { background: #f5f6fa; color: #666; }
.mandatory { color: var(--danger); font-weight: 700; }
.form-section-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
  color: var(--primary); border-bottom: 2px solid var(--primary); padding-bottom: 4px;
  margin-bottom: 10px; margin-top: 14px;
}

/* ---- Search Filter Card ---- */
.filter-card { background: #fff; border-radius: 6px; padding: 10px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.07); margin-bottom: 12px; }
.filter-card .filter-title { font-weight: 700; font-size: 11.5px; color: var(--primary); margin-bottom: 8px; display:flex; align-items:center; gap:6px; text-transform:uppercase; letter-spacing:.5px; }

/* ---- Tables ---- */
.table-card { background: #fff; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.07); overflow: hidden; min-width: 480px; }
.table-card .table-header { padding: 8px 12px; border-bottom: 1px solid var(--border-color); display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px; }
.table-card .table-header h6 { margin: 0; font-weight: 700; color: #333; font-size:13px; }
.table-responsive { overflow-x: hidden; }
.table { margin: 0; font-size: 13px; table-layout: auto; width: 100%; }
.table thead th { background: #e8edf5; font-weight: 700; font-size: 11px; letter-spacing: .3px; text-transform: uppercase; color: #3a4a5c; border-bottom: 2px solid #c8d3e0; border: 1px solid #a0aec0; padding: 5px 7px; white-space: normal; word-break: break-word; line-height: 1.3; min-width: 42px; text-align: center; }
.table tbody td { padding: 4px 7px; vertical-align: middle; border-bottom: 1px solid #edf0f5; color: #333; word-break: break-word; white-space: normal; font-size:13px; line-height: 1.4; }
.table tbody tr:nth-child(odd) td  { background: #ffffff !important; }
.table tbody tr:nth-child(even) td { background: #f0f3f8 !important; }
.table tbody tr:hover td { background: #edf2ff !important; }
.table tbody tr:last-child td { border-bottom: none; }
.btn-pilih { font-size: 11px; padding: 2px 7px; border-radius: 3px; white-space: nowrap; }

/* ---- Badges ---- */
.badge-status { font-size: 10.5px; padding: 2px 7px; border-radius: 3px; font-weight: 700; }
.badge-aktif  { background: #d4edda; color: #155724; }
.badge-keluar { background: #f8d7da; color: #721c24; }
.badge-tangguh{ background: #fff3cd; color: #856404; }

/* ---- Pagination ---- */
.pagination .page-link { border-color: var(--border-color); color: var(--primary); font-size: 12px; padding: 3px 8px; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- Announcement ---- */
.announcement-box { background: linear-gradient(135deg, #fff7e6, #fffbf0); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; padding: 10px 14px; }
.announcement-box .ann-title { color: var(--accent); font-weight: 800; font-size: 13px; margin-bottom: 4px; }
.announcement-box p { color: #555; font-size: 13px; margin: 0; }

/* ---- Footer ---- */
.footer { text-align: center; font-size: 11px; color: var(--text-muted-custom); padding: 8px 0; margin-top: 12px; border-top: 1px solid var(--border-color); }

/* ---- Collapsed sidebar ---- */
body.sidebar-collapsed #sidebar { transform: translateX(-100%); }
body.sidebar-collapsed #main-content { margin-left: 0; }
body.sidebar-collapsed #topbar .logo-box { width: 64px; min-width: 64px; padding: 0; justify-content: center; }
body.sidebar-collapsed #topbar .logo-box .logo-name-wrap { display: none; }
body.sidebar-collapsed #topbar .logo-box .logo-img { max-width: 56px; height: calc(var(--topbar-height) - 10px); }

/* ---- Quick Access items ---- */
.quick-access-item {
  text-align: center; padding: 10px 8px; border-radius: 5px; border: 1px solid var(--border-color);
  transition: all .2s; cursor: pointer; font-size: 12px; font-weight: 600; color: #333;
}
.quick-access-item:hover { background: #edf2ff; border-color: var(--primary-light); }

/* ---- Responsive ---- */
@media (max-width: 992px) {
  #sidebar { transform: translateX(-100%); }
  #main-content { margin-left: 0; }
  body.sidebar-open #sidebar { transform: translateX(0); }
  #topbar .logo-box { width: auto; }
}
