/* ==========================================================================
   LOGSHEET NET REGULER RAPI - STYLESHEET
   Design Theme: Radio Shack Station Console (Dark Mode Default + Print Layout)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Color Palette - Dark Theme */
  --bg-main: #0b0f19;
  --bg-card: rgba(18, 26, 43, 0.85);
  --bg-card-solid: #121a2b;
  --bg-input: #1b263b;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: #3b82f6;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-bright: #ffffff;

  /* Accent Colors */
  --rapi-red: #dc2626;
  --rapi-gold: #f59e0b;
  --rapi-blue: #2563eb;
  --rapi-green: #10b981;
  --rapi-purple: #8b5cf6;

  /* Status Colors */
  --badge-normal: rgba(59, 130, 246, 0.2);
  --badge-normal-text: #60a5fa;
  --badge-important: rgba(245, 158, 11, 0.2);
  --badge-important-text: #fbbf24;
  --badge-emergency: rgba(220, 38, 38, 0.25);
  --badge-emergency-text: #f87171;
  --badge-vip: rgba(16, 185, 129, 0.2);
  --badge-vip-text: #34d399;

  /* Effects */
  --shadow-main: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-solid: #ffffff;
  --bg-input: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #2563eb;

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-bright: #0f172a;

  --badge-normal: #dbeafe;
  --badge-normal-text: #1e40af;
  --badge-important: #fef3c7;
  --badge-important-text: #92400e;
  --badge-emergency: #fee2e2;
  --badge-emergency-text: #991b1b;
  --badge-vip: #d1fae5;
  --badge-vip-text: #065f46;

  --shadow-main: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  --glass-border: 1px solid #e2e8f0;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
  flex: 1;
}

/* Header & Top Bar */
.app-header {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-bottom: var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-main);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px;
}

.brand-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-title h1 span.tag {
  background: var(--rapi-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brand-title p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Top Clock & Sync Banner */
.live-clock-badge {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--rapi-green);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sync-badge {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: var(--rapi-blue);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-theme="light"] .sync-badge {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--rapi-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--rapi-green);
  animation: pulse 1.5s infinite;
}

.sync-dot {
  width: 8px;
  height: 8px;
  background-color: var(--rapi-blue);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--rapi-blue);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--rapi-blue), #1d4ed8);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.btn-success {
  background: linear-gradient(135deg, var(--rapi-green), #059669);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-main);
  border: var(--glass-border);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-bright);
}

.btn-danger {
  background: rgba(220, 38, 38, 0.15);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.3);
}
.btn-danger:hover {
  background: var(--rapi-red);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-outline:hover {
  border-color: var(--border-focus);
  color: var(--border-focus);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.775rem;
}

/* Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

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

/* Cards & Sections */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title svg {
  color: var(--rapi-gold);
}

/* Form Styles */
.form-group {
  margin-bottom: 0.9rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

label .required {
  color: var(--rapi-red);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.input-callsign {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rapi-gold) !important;
}

/* Radio Status / Signal Select Pills */
.signal-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.3rem;
}

.btn-signal {
  padding: 0.4rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-signal:hover, .btn-signal.active {
  background: var(--rapi-blue);
  color: #fff;
  border-color: var(--rapi-blue);
}

/* Quick Status Badges Form Radio (Vertical Full Width for HP Portrait) */
.status-radios {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.status-radio-item {
  position: relative;
  width: 100%;
}

.status-radio-item input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.status-radio-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.8rem;
  font-size: 0.825rem;
  font-weight: 600;
  text-align: left;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-radio-label:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.status-radio-item input:checked + .status-radio-label {
  border-color: var(--rapi-gold);
  background: rgba(245, 158, 11, 0.15);
  color: var(--rapi-gold);
}

.status-radio-item input#catNormal:checked + .status-radio-label {
  border-color: var(--rapi-blue);
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
}

.status-radio-item input#catImportant:checked + .status-radio-label {
  border-color: var(--rapi-gold);
  background: rgba(245, 158, 11, 0.15);
  color: var(--rapi-gold);
}

.status-radio-item input#catVip:checked + .status-radio-label {
  border-color: var(--rapi-green);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.status-radio-item input#catEmergency:checked + .status-radio-label {
  border-color: var(--rapi-red);
  background: rgba(220, 38, 38, 0.2);
  color: #f87171;
}

/* Key Shortcut Hint */
.shortcut-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

kbd {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-bright);
}

/* Summary Counters Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--rapi-blue);
}

.stat-card.stat-gold::before { background: var(--rapi-gold); }
.stat-card.stat-green::before { background: var(--rapi-green); }
.stat-card.stat-red::before { background: var(--rapi-red); }

.stat-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-bright);
  font-family: var(--font-mono);
  margin-top: 0.2rem;
}

/* Search Bar & Table Controls */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-box input {
  padding-left: 2.3rem;
}

.search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.table-filter-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: var(--glass-border);
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.log-table th {
  background-color: rgba(15, 23, 42, 0.7);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.log-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.log-table tbody tr {
  transition: background-color 0.15s;
}

.log-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.cell-num {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
  width: 50px;
}

.cell-time {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: nowrap;
}

.cell-callsign {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--rapi-gold);
  letter-spacing: 0.05em;
}

.cell-handle {
  font-weight: 600;
  color: var(--text-bright);
}

.cell-qth {
  color: var(--text-main);
}

.cell-signal {
  font-family: var(--font-mono);
  font-weight: 600;
  background: rgba(16, 185, 129, 0.1);
  color: var(--rapi-green);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

/* Category Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-normal { background: var(--badge-normal); color: var(--badge-normal-text); }
.badge-important { background: var(--badge-important); color: var(--badge-important-text); }
.badge-emergency { background: var(--badge-emergency); color: var(--badge-emergency-text); }
.badge-vip { background: var(--badge-vip); color: var(--badge-vip-text); }

/* Table Empty State */
.table-empty {
  text-align: center;
  padding: 3rem 1rem !important;
  color: var(--text-muted);
}

.table-empty svg {
  margin-bottom: 0.5rem;
  opacity: 0.4;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card-solid);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-backdrop.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Reference Lists inside Modals */
.code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.code-item {
  background: var(--bg-input);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-key {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--rapi-gold);
}

.code-desc {
  font-size: 0.82rem;
  color: var(--text-main);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--rapi-blue);
  color: var(--text-bright);
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Radio Control Switch */
.audio-toggle-btn {
  background: rgba(245, 158, 11, 0.1);
  color: var(--rapi-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.audio-toggle-btn.muted {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  border-color: var(--border-color);
}

/* Card Collapsible Header */
.card-header-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header-toggle .toggle-icon {
  transition: transform 0.25s ease;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.card-collapsible.collapsed .card-body-collapsible {
  display: none;
}

.card-collapsible.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

/* Mobile Bottom Quick Navigation Bar */
.mobile-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-card-solid);
  border-top: var(--glass-border);
  z-index: 900;
  padding: 0.4rem 0.75rem;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
  justify-content: space-around;
}

.mobile-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-nav-btn.active, .mobile-nav-btn:hover {
  color: var(--rapi-gold);
  background: rgba(245, 158, 11, 0.1);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE, TABLET, DESKTOP)
   ========================================================================== */

/* Large Desktop (> 1200px) */
@media (min-width: 1200px) {
  .container {
    padding: 1.5rem 2rem;
  }
}

/* Tablet & Mid Screens (768px - 1024px) */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }
  
  .header-actions {
    justify-content: flex-start;
  }
}

/* Mobile Screens (< 768px) */
@media (max-width: 768px) {
  .mobile-nav-bar {
    display: flex;
  }

  body {
    padding-bottom: 60px; /* Prevent footer overlap with mobile nav bar */
  }

  .container {
    padding: 0.75rem;
  }

  .header-inner {
    padding: 0.85rem 0.75rem;
  }

  .branding {
    gap: 0.75rem;
  }

  .logo-img {
    width: 42px;
    height: 42px;
  }

  .brand-title h1 {
    font-size: 1.1rem;
    flex-wrap: wrap;
  }

  .brand-title p {
    font-size: 0.75rem;
    line-height: 1.3;
  }

  .header-actions {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.45rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .header-actions .live-clock-badge {
    grid-column: span 2 !important;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0.45rem;
  }

  .header-actions .btn {
    width: 100% !important;
    padding: 0.45rem 0.5rem;
    font-size: 0.78rem;
    justify-content: center;
    white-space: nowrap;
  }

  /* Container & Aside full width for mobile */
  .container {
    padding: 0.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  aside.no-print {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Form & Cards Responsive */
  .card {
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Card Net Info Vertical Space Optimization */
  #cardNetInfo {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.6rem 0.75rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0.75rem !important;
  }

  #cardNetInfo .card-header {
    margin-bottom: 0.4rem !important;
    padding-bottom: 0.35rem !important;
  }

  #cardNetInfo .card-title {
    font-size: 0.9rem !important;
  }

  #netInfoForm {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
  }

  #netInfoForm .form-row,
  #netInfoForm .form-row-mobile-2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.4rem !important;
    width: 100% !important;
    margin-bottom: 0.35rem !important;
  }

  #netInfoForm .form-group {
    width: 100% !important;
    margin-bottom: 0.35rem !important;
  }

  #netInfoForm label {
    display: block !important;
    width: 100% !important;
    font-size: 0.7rem !important;
    margin-bottom: 0.15rem !important;
    line-height: 1.2 !important;
  }

  #netInfoForm input[type="text"],
  #netInfoForm input[type="date"],
  #netInfoForm input[type="time"],
  #netInfoForm select {
    display: block !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    font-size: 0.82rem !important;
    padding: 0.35rem 0.55rem !important;
    height: 36px !important;
    -webkit-appearance: none;
    appearance: none;
    border-radius: var(--radius-sm);
  }

  #netInfoForm button[type="submit"] {
    padding: 0.38rem 0.6rem !important;
    font-size: 0.78rem !important;
    margin-top: 0.2rem !important;
  }

  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .signal-buttons {
    grid-template-columns: repeat(3, 1fr);
  }

  .status-radios {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
  }

  /* Counter stats on mobile */
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .stat-card {
    padding: 0.6rem 0.75rem;
  }

  .stat-title {
    font-size: 0.65rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  /* Table Toolbar & Filters */
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .search-box {
    width: 100%;
  }

  .table-filter-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    width: 100%;
  }

  .table-filter-group .btn {
    font-size: 0.75rem;
    padding: 0.45rem 0.5rem;
  }

  .table-filter-group #clearLogsBtn {
    grid-column: span 2;
  }

  /* Table styling on mobile */
  .log-table th, .log-table td {
    padding: 0.55rem 0.65rem;
    font-size: 0.8rem;
  }

  .cell-callsign {
    font-size: 0.85rem;
  }

  .cell-handle {
    font-size: 0.8rem;
  }

  /* Modals on Mobile */
  .modal-card {
    width: 95%;
    max-height: 90vh;
  }

  .modal-header, .modal-footer {
    padding: 0.75rem 1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .code-grid {
    grid-template-columns: 1fr;
  }
}

/* Extra Small Mobile Devices (< 480px) */
@media (max-width: 480px) {
  .signal-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .status-radios {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
  }
}

/* ==========================================================================
   PRINT LAYOUT - STANDAR LAPORAN LOGSHEET A4 RAPI
   ========================================================================== */
.print-only {
  display: none;
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: 'Arial', sans-serif !important;
    font-size: 11pt !important;
  }

  .no-print,
  .app-header,
  .app-footer,
  .dashboard-grid > aside,
  .table-toolbar,
  .btn,
  .live-clock-badge,
  .toast-container {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .dashboard-grid {
    display: block !important;
  }

  .card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .print-only {
    display: block !important;
  }

  /* Official RAPI Letterhead Header */
  .print-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px double #000;
    padding-bottom: 12px;
    margin-bottom: 15px;
  }

  .print-header img {
    width: 70px;
    height: 70px;
  }

  .print-header-text {
    text-align: center;
    flex: 1;
  }

  .print-header-text h2 {
    font-size: 15pt;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 2px;
  }

  .print-header-text h3 {
    font-size: 13pt;
    font-weight: bold;
    color: #333;
    margin-bottom: 2px;
  }

  .print-header-text p {
    font-size: 9pt;
    color: #555;
  }

  /* Session Meta Table */
  .print-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 10pt;
    border: 1px solid #000;
    padding: 8px 12px;
  }

  .print-meta-item {
    display: flex;
    gap: 6px;
  }

  .print-meta-item strong {
    min-width: 130px;
  }

  /* Official Print Table */
  .log-table {
    border: 1px solid #000 !important;
    font-size: 10pt !important;
  }

  .log-table th {
    background-color: #f0f0f0 !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    padding: 6px 8px !important;
    text-align: center !important;
  }

  .log-table td {
    color: #000 !important;
    border: 1px solid #000 !important;
    padding: 5px 8px !important;
  }

  .cell-callsign {
    color: #000 !important;
  }

  .cell-signal {
    background: transparent !important;
    color: #000 !important;
    padding: 0 !important;
  }

  .badge {
    border: none !important;
    background: transparent !important;
    color: #000 !important;
    padding: 0 !important;
    font-weight: normal !important;
  }

  /* Print Rekapitulasi Summary Block */
  .print-rekap-box {
    margin-top: 10px;
    margin-bottom: 20px;
    padding: 8px 12px;
    border: 1px solid #000;
    background-color: #f9f9f9;
    font-size: 9.5pt;
  }

  .print-rekap-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
  }

  /* Signature Block */
  .print-signatures {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    page-break-inside: avoid;
  }

  .sig-box {
    text-align: center;
    width: 220px;
  }

  .sig-box p {
    font-size: 10pt;
    margin-bottom: 60px;
  }

  .sig-line {
    border-top: 1px solid #000;
    font-weight: bold;
    padding-top: 4px;
  }
}
