:root {
  --primary-red: #e65c5c;
  --dark-bg: #333333;
  --sidebar-bg: #444444;
  --light-grey: #d9d9d9;
  --status-green: #2ecc71;
  --status-yellow: #f1c40f;
  --status-orange: #e67e22;
  --status-red: #e74c3c;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background-color: var(--light-grey);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: var(--dark-bg);
  color: white;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-area i {
  font-size: 2rem;
}

.logo-area h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.wrapper {
  display: flex;
  flex: 1;
}

/* Sidebar Styles */
nav {
  background-color: var(--sidebar-bg);
  width: 250px;
  color: white;
  padding-top: 20px;
}

.nav-item {
  padding: 15px 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  transition: 0.3s;
  text-decoration: none;
  color: white;
  border: none;
  background: transparent;
  width: 100%;
  font-size: 1rem;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
  background-color: var(--primary-red);
}

main {
  flex: 1;
  padding: 40px;
}

/* CSS UNTUK PINDAH HALAMAN */
#btn-config {
  display: none;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* DASHBOARD DESIGN (Tetap) */
.dashboard-header {
  margin-bottom: 30px;
}

.dashboard-header h2 {
  font-size: 2rem;
  font-weight: 700;
  display: inline-block;
  margin-right: 10px;
}

.dashboard-header span {
  color: #666;
  font-size: 1.2rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  border-bottom: 2px solid #eee;
  padding-bottom: 15px;
  margin-bottom: 25px;
}

.battery-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin-top: 20px;
}

.battery-shape {
  width: 120px;
  height: 200px;
  border: 8px solid var(--dark-bg);
  border-radius: 15px;
  position: relative;
  padding: 5px;
}

.battery-shape::before {
  content: "";
  width: 50px;
  height: 15px;
  background: var(--dark-bg);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 5px 5px 0 0;
}

.battery-level {
  width: 100%;
  height: 0%;
  background: var(--status-green);
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
  width: calc(100% - 10px);
  border-radius: 8px;
  transition: 1s ease-in-out;
}

.percentage-text {
  font-size: 5rem;
  font-weight: 800;
  color: var(--status-green);
}

.status-label {
  font-size: 1.5rem;
  color: #333;
}

.status-val {
  font-weight: 700;
  color: var(--status-green);
}

.parameter-list {
  text-align: left;
}

.param-item {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 1.1rem;
}

.param-item span:first-child {
  font-weight: 600;
}

#alert-bar {
  background-color: var(--primary-red);
  color: white;
  padding: 15px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-weight: 700;
  font-size: 1.2rem;
}

/* DESIGN RIWAYAT (Baru) */
.filter-card {
  background: white;
  padding: 25px;
  border-radius: 15px;
  margin-bottom: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.filter-group {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-top: 15px;
}

.filter-group div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.filter-group input {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
}

.btn-red {
  background: var(--primary-red);
  color: white;
  border: none;
  padding: 10px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.table-card {
  background: white;
  border-radius: 15px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table-header {
  padding: 20px 30px;
  border-bottom: 1px solid #eee;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: #f8f9fa;
  padding: 15px 30px;
  text-align: left;
  color: #333;
  font-weight: 700;
  border-bottom: 2px solid #eee;
}

td {
  padding: 15px 30px;
  border-bottom: 1px solid #eee;
  font-size: 1rem;
}

.status-badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #e8f5e9;
  color: #2e7d32;
}

.export-area {
  padding: 20px 30px;
  text-align: right;
}


/* --- TAMBAHAN STYLE UNTUK TABEL BARU --- */

/* Agar tabel bisa discroll horizontal pada layar HP */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

/* Warna Badge Khusus Pengisian (Hijau/Biru) */
.status-badge.badge-fill {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #bbdefb;
}

/* Warna Badge Khusus Pemakaian/Berkurang (Oranye) */
.status-badge.badge-drain {
  background: #fff3e0;
  color: #ef6c00;
  border: 1px solid #ffe0b2;
}

/* Style ikon di dalam badge agar rapi */
.status-badge i {
  margin-right: 5px;
  font-size: 0.8rem;
}

/* INPUT STYLE */
.input-full {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
  /* Fix padding issue */
}

/* DELETE BUTTON STYLE */
.btn-delete {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  margin-left: 10px;
  display: none;
  /* Hidden by default */
}

.btn-delete:hover {
  background: #c0392b;
}

/* Tampilkan tombol delete jika admin login */
body.is-admin .btn-delete {
  display: inline-block;
}

@media (max-width: 992px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {

  /* Prevent horizontal scroll on body */
  body {
    overflow-x: hidden;
    width: 100vw;
  }

  /* Fix Flexbox Overflow Issue */
  main {
    min-width: 0;
    width: 100%;
    padding: 20px 15px;
    overflow-x: hidden;
    /* Ensure no internal overflow spills */
  }

  .wrapper {
    width: 100%;
    overflow: hidden;
    /* Safety net */
  }

  header {
    padding: 15px 20px;
    position: sticky;
    top: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    width: 100%;
    /* Ensure header fits */
  }

  .logo-area {
    gap: 10px;
    flex: 1;
    /* Allow logo area to shrink/grow */
    min-width: 0;
    /* Enable truncation */
  }

  /* Tampilkan tombol hamburger */
  #btn-toggle-nav {
    display: block !important;
    font-size: 1.3rem;
    flex-shrink: 0;
    /* Jangan sampai icon mengecil */
  }

  .logo-area h1 {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Remove fixed max-width, rely on flex */
    width: 100%;
  }

  /* Sidebar menjadi drawer (slide-in) */
  nav {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    z-index: 1000;
    width: 280px;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 60px;
  }

  nav.active {
    left: 0;
  }

  #sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    display: none;
    backdrop-filter: blur(2px);
    transition: 0.3s;
  }

  #sidebar-overlay.active {
    display: block;
  }

  .nav-item {
    font-size: 1rem;
    padding: 20px 30px;
    border-left: 4px solid transparent;
  }

  .nav-item.active {
    border-left-color: var(--primary-red);
    background: rgba(255, 255, 255, 0.05);
  }

  .nav-item span {
    display: inline-block;
  }

  /* Typo Adjustments untuk Mobile */
  .dashboard-header h2 {
    font-size: 1.5rem;
  }

  .dashboard-header span {
    font-size: 0.9rem;
    display: block;
    margin-top: 5px;
  }

  .card {
    padding: 15px;
    /* Reduce padding slightly */
  }

  .cards-grid {
    gap: 15px;
    /* Reduce gap */
  }

  .card-title {
    font-size: 1rem;
    margin-bottom: 20px;
    white-space: normal;
    /* Ensure wrapping */
  }

  /* Battery Card Optimizations */
  .battery-container {
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
  }

  .battery-shape {
    width: 80px;
    height: 140px;
    border-width: 6px;
  }

  .battery-shape::before {
    width: 40px;
    height: 10px;
    top: -16px;
  }

  .battery-container>div:last-child {
    text-align: center !important;
    width: 100%;
  }

  .percentage-text {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 5px;
  }

  .status-label {
    font-size: 1rem;
  }

  .status-val {
    font-size: 1.1rem;
    display: block;
    margin-top: 5px;
  }

  /* Parameter List Optimizations */
  .param-item {
    padding: 12px 0;
    font-size: 0.9rem;
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .filter-group input,
  .btn-red {
    width: 100%;
  }

  .table-header {
    padding: 15px 20px;
  }

  h3 {
    font-size: 1rem !important;
  }

  .status-badge {
    white-space: nowrap;
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  /* Log Table Adjustments */
  .table-responsive {
    margin-bottom: 0;
    border: 1px solid #eee;
    /* Add border to show bounds */
    border-radius: 8px;
  }

  .export-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .export-area button {
    width: 100%;
    margin: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

/* --- TABLE SCROLL & STICKY HEADER --- */
/* Override default table-responsive behavior for fixed height */
.table-scrollable {
  max-height: 400px;
  /* Base height */
  overflow-y: auto;
  display: block;
}

/* Expanded state when filter is active */
.table-scrollable.expanded {
  max-height: none;
  overflow-y: visible;
}

/* Sticky Header */
.table-scrollable th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8f9fa;
  box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* Checkbox Column Style */
.check-col {
  width: 40px;
  text-align: center;
}

/* Bulk Delete Button Area */
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Hide checkboxes by default, show for admin */
.admin-only-col,
.admin-checkbox {
  display: none;
}

body.is-admin .admin-only-col {
  display: table-cell;
}

body.is-admin .admin-checkbox {
  display: inline-block;
}

.btn-bulk-delete {
  background: #c0392b;
  color: white;
  padding: 8px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: none;
  font-size: 0.9rem;
}

body.is-admin .btn-bulk-delete {
  display: inline-block;
}

/* --- TABLE SCROLL FIXES (6 Rows) --- */
/* Assuming ~50-55px per row + header, 6 rows would be around 350-380px */
.table-scrollable {
  max-height: 380px !important;
}

/* Ensure admin elements are hidden by default and only shown when connected */
.admin-only-col,
.admin-checkbox,
.btn-bulk-delete,
.btn-delete {
  display: none !important;
}

/* ONLY display when body has is-admin class */
body.is-admin .admin-only-col {
  display: table-cell !important;
}

body.is-admin .admin-checkbox {
  display: inline-block !important;
}

body.is-admin .btn-bulk-delete,
body.is-admin .btn-delete {
  display: inline-block !important;
}

/* --- Date Cell & Delete Button Alignment --- */
.date-cell {
  /* Use Flexbox to align text and button */
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  /* Push button to right if needed, or stick to left */
  gap: 10px;
  white-space: nowrap !important;
  /* Prevent text wrapping */
  min-width: 180px;
  /* Ensure enough space */
}

/* --- CONFIG PAGE & MODAL STYLES --- */

/* Badge Styles */
.badge-pending {
  background: #fff3e0;
  color: #e67e22;
  border: 1px solid #ffe0b2;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-active {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s;
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s;
}

.close-btn {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

.close-btn:hover,
.close-btn:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

/* Waiting Room Card Style */
/* Waiting Room Card Style - Enhanced */
/* Waiting Room Card Style - Enhanced */
/* Waiting Room Card Style - Enhanced */
.card-pending {
  background: #ffffff;
  border: 1px solid #f1c40f;
  /* Full Yellow Border */
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  /* Subtle shadow */
  padding: 20px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.card-pending:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.new-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f1c40f;
  /* Yellow Background */
  color: #fff;
  font-size: 0.75rem;
  padding: 4px 10px;
  font-weight: 700;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-pending h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.card-pending p {
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.card-pending .btn-red {
  width: 100%;
  justify-content: center;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  background-color: #e74c3c;
  /* Red Button */
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.card-pending .btn-red:hover {
  background-color: #c0392b;
}



/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Action Buttons in Table */
.btn-edit {
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  margin-right: 5px;
  transition: background 0.2s;
}

.btn-edit:hover {
  background: #2980b9;
}

.btn-delete-icon {
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-delete-icon:hover {
  background: #c0392b;
}

/* Adjust card button for flex layout */
.card-pending .btn-red {
  font-size: 0.9rem;
  /* Slightly smaller text to fit with trash icon */
}

/* Media Queries for Mobile Responsiveness */
@media (max-width: 768px) {
  .modal-content {
    margin: 20% auto;
    width: 95%;
    padding: 20px;
  }
}

/* --- CONFIGURATION MODAL STYLES (NEW) --- */
.modal-header__new {
  margin-bottom: 25px;
}

.modal-header__new h2 {
  color: #e74c3c;
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #2c3e50;
  font-size: 0.95rem;
}

/* 3-Column Grid for Dimensions (Length, Width, Height) */
.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

/* 2-Column Grid (e.g. WiFi, Telegram) */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-hint {
  display: block;
  margin-top: 5px;
  color: #7f8c8d;
  font-size: 0.85rem;
}

.form-divider {
  border: 0;
  border-top: 1px solid #eee;
  margin: 25px 0;
}

.section-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #2c3e50;
  margin-bottom: 12px;
  display: block;
}

.modal-footer {
  margin-top: 30px;
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  align-items: center;
}

.btn-cancel {
  cursor: pointer;
  color: #7f8c8d;
  font-weight: 500;
  font-size: 1rem;
  background: none;
  border: none;
  padding: 10px 15px;
  transition: color 0.2s;
}

.btn-cancel:hover {
  color: #34495e;
}

.btn-save {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 12px 25px;
  font-size: 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-save:hover {
  background: #c0392b;
}

/* Mobile specific for grids */
@media (max-width: 480px) {
  .form-grid-3 {
    grid-template-columns: 1fr;
    /* Stack on very small screens */
    gap: 10px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    /* Stack buttons, save on top */
    gap: 10px;
    width: 100%;
  }

  .btn-save,
  .btn-cancel {
    width: 100%;
    text-align: center;
  }
}

/* --- WAITING ROOM HORIZONTAL SCROLL (Mobile) --- */
@media (max-width: 768px) {
  #waiting-room-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 30px;
    /* Space for scrollbar/shadow */
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    /* Snap effect implies cards */
    scroll-snap-type: x mandatory;
  }

  #waiting-room-list .card-pending {
    min-width: 280px;
    /* Fixed width for cards in scroll */
    flex-shrink: 0;
    margin-bottom: 0;
    /* Override default grid margin */
    scroll-snap-align: start;
  }

  /* Hide scrollbar for cleaner look if desired, but good to have constraint */
  #waiting-room-list::-webkit-scrollbar {
    height: 6px;
  }

  #waiting-room-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
  }
}

/* Fix Delete Button in Config Table on Mobile */
@media (max-width: 768px) {
  .btn-delete-icon {
    padding: 8px 12px;
    /* Larger touch target */
    font-size: 1rem;
    margin-top: 5px;
    /* Spacing if wrapped */
  }

  /* Ensure action column doesn't squish buttons */
  td:last-child {
    white-space: nowrap;
    display: flex;
    gap: 5px;
  }
}

/* --- GLOBAL DASHBOARD STYLES --- */
#global-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Strict 3 columns */
  gap: 30px;
  padding: 20px 0;
}

/* Full Width Mode Styles */
/* Sidebar tersembunyi di kiri (di luar layar) saat full-width-mode */
body.full-width-mode nav#sidebar {
  position: fixed !important;
  top: 70px !important;
  /* tepat di bawah header */
  left: -270px !important;
  height: calc(100vh - 70px) !important;
  z-index: 1200 !important;
  width: 250px !important;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  padding-top: 10px !important;
  display: flex !important;
  flex-direction: column;
}

/* Saat popup terbuka */
body.full-width-mode nav#sidebar.popup-open {
  left: 0 !important;
}

body.full-width-mode #btn-toggle-nav {
  display: none !important;
}

body.full-width-mode main {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Overlay untuk sidebar popup di full-width-mode */
#sidebar-overlay.popup-mode {
  position: fixed;
  top: 70px;
  left: 0;
  width: 100%;
  height: calc(100vh - 70px);
  background: rgba(0, 0, 0, 0.45);
  z-index: 1199;
  display: block;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s;
}

.global-card {
  background: white;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  /* Add pointer */
}

.global-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.global-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #333;
  width: 100%;
  text-align: center;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}

.global-card-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  width: 100%;
}

.global-battery-shape {
  width: 80px;
  height: 140px;
  border: 6px solid var(--dark-bg);
  border-radius: 12px;
  position: relative;
  padding: 4px;
}

.global-battery-shape::before {
  content: "";
  width: 40px;
  height: 10px;
  background: var(--dark-bg);
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 4px 4px 0 0;
}

.global-battery-level {
  width: 100%;
  height: 0%;
  /* Dynamic */
  background: var(--status-green);
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  width: calc(100% - 8px);
  border-radius: 6px;
  transition: height 1s ease-in-out, background-color 0.3s;
}

.global-info {
  text-align: left;
}

.global-percentage {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--status-green);
  line-height: 1;
  margin-bottom: 5px;
}

.global-status-label {
  font-size: 1rem;
  color: #666;
}

.global-status-val {
  font-weight: 700;
  color: var(--status-green);
  font-size: 1.1rem;
}

@media (max-width: 992px) {
  #global-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns on tablet */
  }
}

@media (max-width: 768px) {
  #global-cards-grid {
    grid-template-columns: 1fr;
    /* Single column on mobile */
  }

  .global-card-body {
    flex-direction: row;
    /* Keep row even on mobile for this design */
    gap: 20px;
  }

  .global-percentage {
    font-size: 2.5rem;
  }
}

/* --- ACTION BUTTONS (NEW STYLE) --- */
.action-cell {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.btn-edit,
.btn-delete-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  color: white !important;
  transition: opacity 0.2s;
}

.btn-edit {
  background-color: #3498db;
}

.btn-edit i {
  font-size: 1rem;
}

.btn-delete-icon {
  background-color: #e74c3c;
}

.btn-delete-icon i {
  font-size: 1rem;
}

.btn-edit:hover,
.btn-delete-icon:hover {
  opacity: 0.9;
}

/* Animasi logo saat diklik */
#logo-btn {
  transition: transform 0.2s, opacity 0.2s;
}

#logo-btn:hover {
  opacity: 0.85;
  transform: scale(1.05);
}