/* ===== Custom Theme — Equipment Management ===== */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
  --sidebar-w: 260px;
  --sidebar-bg: #0d2461;
  --sidebar-hover: rgba(255,255,255,0.10);
  --sidebar-active: rgba(255,255,255,0.18);
  --accent: #1976d2;
  --accent-light: #42a5f5;
  --content-bg: #f0f4f8;
  --card-radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --status-normal: #2e7d32;
  --status-near: #e65100;
  --status-over: #c62828;
}

* { box-sizing: border-box; }

body {
  font-family: 'Prompt', sans-serif;
  background: var(--content-bg);
  margin: 0;
  font-size: 14px;
  color: #212529;
}

/* ===== SIDEBAR ===== */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, #0d2461 0%, #1a3a8c 60%, #1565c0 100%);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

#sidebar .sidebar-brand {
  padding: 24px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  text-decoration: none;
}
#sidebar .brand-icon {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  flex-shrink: 0;
}
#sidebar .brand-text { color: #fff; }
#sidebar .brand-text strong { display: block; font-size: 13px; font-weight: 600; }
#sidebar .brand-text small { font-size: 10px; opacity: .65; }

#sidebar .nav-section {
  padding: 12px 12px 0;
  font-size: 10px;
  color: rgba(255,255,255,.45);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 8px;
}

#sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,.80);
  text-decoration: none;
  border-radius: 8px;
  margin: 2px 8px;
  transition: background .2s, color .2s;
  font-size: 13.5px;
}
#sidebar .nav-link i { font-size: 18px; width: 22px; flex-shrink: 0; }
#sidebar .nav-link:hover { background: var(--sidebar-hover); color: #fff; }
#sidebar .nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
#sidebar .nav-link .badge-count {
  margin-left: auto;
  background: #f44336;
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}

#sidebar .sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  gap: 10px;
}
#sidebar .sidebar-footer .avatar {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
  flex-shrink: 0;
}
#sidebar .sidebar-footer .user-info { min-width: 0; }
#sidebar .sidebar-footer .user-name {
  color: #fff; font-size: 12.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#sidebar .sidebar-footer .user-role {
  color: rgba(255,255,255,.55); font-size: 10.5px; text-transform: capitalize;
}
#sidebar .sidebar-footer .logout-btn {
  margin-left: auto;
  color: rgba(255,255,255,.6);
  font-size: 18px;
  text-decoration: none;
  transition: color .2s;
}
#sidebar .sidebar-footer .logout-btn:hover { color: #fff; }

/* ===== MAIN LAYOUT ===== */
#main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .3s ease;
}

/* ===== TOPBAR ===== */
#topbar {
  background: #fff;
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  position: sticky; top: 0;
  z-index: 100;
}
#topbar .sidebar-toggle {
  background: none; border: none;
  font-size: 22px; color: #555;
  cursor: pointer; padding: 4px 8px;
  border-radius: 6px;
  display: none;
  transition: background .2s;
}
#topbar .sidebar-toggle:hover { background: #f0f4f8; }
#topbar .page-title { font-size: 16px; font-weight: 600; color: #1a237e; margin: 0; }
#topbar .topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.notif-btn {
  position: relative;
  background: none; border: none;
  font-size: 20px; color: #555;
  cursor: pointer; padding: 6px;
  border-radius: 8px;
  transition: background .2s;
}
.notif-btn:hover { background: #f0f4f8; color: #1976d2; }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: #f44336; color: #fff;
  font-size: 9px; font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #333;
}
.topbar-user .avatar-sm {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
}

/* ===== CONTENT ===== */
#content {
  padding: 24px;
  flex: 1;
}

/* ===== KPI CARDS ===== */
.kpi-card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 4px solid transparent;
  transition: transform .2s, box-shadow .2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.kpi-card.total  { border-color: #1976d2; }
.kpi-card.normal { border-color: var(--status-normal); }
.kpi-card.near   { border-color: #fb8c00; }
.kpi-card.over   { border-color: var(--status-over); }
.kpi-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.kpi-card.total  .kpi-icon { background: #e3f2fd; color: #1976d2; }
.kpi-card.normal .kpi-icon { background: #e8f5e9; color: var(--status-normal); }
.kpi-card.near   .kpi-icon { background: #fff3e0; color: #fb8c00; }
.kpi-card.over   .kpi-icon { background: #ffebee; color: var(--status-over); }
.kpi-info .kpi-value { font-size: 28px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.kpi-info .kpi-label { font-size: 12.5px; color: #666; }

/* ===== CARDS ===== */
.card-custom {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  border: none;
}
.card-custom .card-header-custom {
  padding: 16px 20px;
  border-bottom: 1px solid #e8edf2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-custom .card-header-custom h6 {
  margin: 0; font-size: 14px; font-weight: 600; color: #1a237e;
}
.card-body-custom { padding: 16px 20px; }

/* ===== STATUS BADGES ===== */
.badge-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-normal  { background: #e8f5e9; color: var(--status-normal); }
.badge-near    { background: #fff3e0; color: #e65100; }
.badge-overdue { background: #ffebee; color: var(--status-over); }
.badge-na      { background: #f5f5f5; color: #757575; }

/* Bootstrap badge overrides */
.badge.bg-warning { color: #333 !important; }

/* ===== TABLE ===== */
.table-custom { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-custom thead tr th {
  background: #1a3a8c;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 11px 14px;
  white-space: nowrap;
  letter-spacing: 0.3px;
  position: sticky; top: 0;
}
.table-custom thead tr th:first-child { border-radius: 8px 0 0 0; }
.table-custom thead tr th:last-child  { border-radius: 0 8px 0 0; }
.table-custom tbody tr {
  transition: background .15s;
}
.table-custom tbody tr:nth-child(even) { background: #f8fafc; }
.table-custom tbody tr:hover { background: #e8f0fe; }
.table-custom td {
  padding: 10px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #e8edf2;
  font-size: 13px;
}

/* Equipment image thumbnail */
.eq-thumb {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
}
.eq-thumb-placeholder {
  width: 44px; height: 44px;
  background: #e8edf2;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #aaa; font-size: 18px;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 14px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.filter-bar label { font-size: 12px; color: #555; margin-bottom: 3px; }
.filter-bar .form-control,
.filter-bar .form-select {
  font-size: 13px;
  border-color: #d0dce8;
  border-radius: 8px;
}
.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(25,118,210,.1);
}

/* ===== BUTTONS ===== */
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #1565c0; border-color: #1565c0; }
.btn-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  padding: 0;
  border: none;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-icon:hover { opacity: .75; }

/* ===== FORMS ===== */
.form-section {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
}
.form-section h6 {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e3f2fd;
}
.form-label { font-size: 12.5px; font-weight: 500; color: #444; }
.form-control, .form-select {
  border-color: #d0dce8;
  border-radius: 8px;
  font-size: 13.5px;
  padding: 8px 12px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(25,118,210,.10);
}

/* ===== IMAGE UPLOAD ===== */
.img-upload-area {
  border: 2px dashed #b0bec5;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.img-upload-area:hover { border-color: var(--accent); background: #f0f7ff; }
.img-upload-area.dragover { border-color: var(--accent); background: #e3f2fd; }
.img-preview {
  max-width: 180px;
  max-height: 140px;
  border-radius: 8px;
  margin-top: 10px;
  display: none;
}

/* ===== ALERTS ===== */
.alert-custom {
  border-radius: 10px;
  border: none;
  font-size: 13px;
}

/* ===== CALENDAR PAGE ===== */
#calendar-container { background: #fff; border-radius: var(--card-radius); box-shadow: var(--shadow); padding: 20px; }
.fc { font-family: 'Prompt', sans-serif; font-size: 13px; }
.fc-toolbar-title { font-size: 16px !important; font-weight: 600 !important; color: #1a237e; }
.fc-event { font-size: 11px; padding: 1px 4px; border-radius: 4px !important; cursor: pointer; }

/* ===== REPORTS ===== */
.chart-card {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.chart-card h6 { font-size: 14px; font-weight: 600; color: #1a237e; margin-bottom: 16px; }

/* ===== USER MANAGEMENT ===== */
.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
  flex-shrink: 0;
}
.role-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.role-badge.admin { background: #e3f2fd; color: #1565c0; }
.role-badge.user  { background: #f3e5f5; color: #7b1fa2; }

/* ===== LOGIN PAGE ===== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d2461 0%, #1565c0 50%, #42a5f5 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.login-logo {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff;
  margin: 0 auto 20px;
}

/* ===== NOTIFICATION PANEL ===== */
.notif-panel {
  position: fixed;
  top: 60px; right: 0;
  width: 340px;
  max-height: calc(100vh - 60px);
  background: #fff;
  box-shadow: -4px 0 20px rgba(0,0,0,0.12);
  z-index: 1050;
  transform: translateX(100%);
  transition: transform .3s ease;
  display: flex; flex-direction: column;
}
.notif-panel.open { transform: translateX(0); }
.notif-panel .panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e8edf2;
  display: flex; align-items: center; justify-content: space-between;
}
.notif-panel .panel-header h6 { margin: 0; font-weight: 600; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f4f8;
  transition: background .15s;
}
.notif-item:hover { background: #f8fafc; }
.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.notif-dot.near   { background: #fb8c00; }
.notif-dot.over   { background: #e53935; }
.notif-item-text { min-width: 0; }
.notif-item-name { font-size: 13px; font-weight: 500; }
.notif-item-sub  { font-size: 11px; color: #888; }

/* ===== RESPONSIVE ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
}

@media (max-width: 992px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.show {
    transform: translateX(0);
  }
  #main-wrapper {
    margin-left: 0;
  }
  #topbar .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .sidebar-overlay.show {
    display: block;
  }
}

@media (max-width: 576px) {
  #content { padding: 16px; }
  .kpi-card { padding: 14px 16px; }
  .kpi-icon { width: 42px; height: 42px; font-size: 20px; }
  .kpi-info .kpi-value { font-size: 22px; }
}
