/* 
  =========================================
  Nascimento Perícia Judicial - Dashboard
  CSS Stylesheet (Vanilla CSS)
  =========================================
*/

/* Reset & Variables */
:root {
  --bg-app: #0b0f19;
  --bg-sidebar: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(31, 41, 55, 0.8);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-focus: #6366f1;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-inverse: #111827;
  
  /* Color Palette */
  --primary: #4f46e5;
  --primary-glow: rgba(79, 70, 229, 0.35);
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --secondary: #06b6d4;
  --secondary-gradient: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.2);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --info: #3b82f6;
  
  --sidebar-width: 280px;
  --header-height: 80px;
  --drawer-width: 650px;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --glass-effect: backdrop-filter: blur(16px) saturate(180%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: auto;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow-x: hidden;
  height: 100vh;
  display: flex;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

/* App Container Layout */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR STYLING */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

.brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: var(--primary-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-info h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.brand-info span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
}

.nav-menu {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: var(--transition-fast);
}

.nav-item:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  color: #fff;
  background: var(--primary-gradient);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.comarcas-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  overflow: hidden;
}

.comarcas-section .section-title {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.comarcas-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 16px;
}

.comarca-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.comarca-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.comarca-item.active {
  background-color: rgba(99, 102, 241, 0.1);
  color: #818cf8;
  font-weight: 600;
}

.comarca-count {
  font-size: 10px;
  background-color: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 10px;
  color: var(--text-muted);
}

.comarca-item.active .comarca-count {
  background-color: #818cf8;
  color: #fff;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.success { background-color: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.warning { background-color: var(--warning); box-shadow: 0 0 8px var(--warning); }
.status-dot.danger { background-color: var(--danger); box-shadow: 0 0 8px var(--danger); }

/* MAIN CONTENT AREA */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

/* TOPBAR */
.topbar {
  height: var(--header-height);
  padding: 0 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(11, 15, 25, 0.4);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.title-area h2 {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.title-area p {
  font-size: 13px;
  color: var(--text-muted);
}

.search-and-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  position: relative;
  width: 320px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition-fast);
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* CONTENT BODY */
.content-body {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  background-color: var(--bg-card-hover);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-icon.primary { background-color: rgba(79, 70, 229, 0.1); color: #818cf8; }
.stat-icon.warning { background-color: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.stat-icon.success { background-color: rgba(16, 185, 129, 0.1); color: #34d399; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* TABLES & CARDS */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-premium);
  overflow: hidden;
}

.table-container {
  position: relative;
  min-height: 200px;
}

.process-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.process-table th {
  padding: 16px 24px;
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.process-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.process-table tbody tr {
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

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

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge.status-aguardando-aceite, .badge.status-pendente, .badge.status-aguardando {
  background-color: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge.status-marcada, .badge.status-em-andamento, .badge.status-aceita {
  background-color: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge.status-realizada, .badge.status-finalizada, .badge.status-concluida, .badge.status-entregue {
  background-color: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge.status-cancelada, .badge.status-atrasado, .badge.status-não-iniciado {
  background-color: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge.status-default {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background-color: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

/* LOADING & NO DATA */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--border-focus);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-small {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.no-data-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  color: var(--text-muted);
  gap: 12px;
}

.no-data-msg i {
  font-size: 48px;
  opacity: 0.3;
}

.no-data-msg p {
  font-size: 14px;
}

.hidden {
  display: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* DRAWER (SLIDE-OUT PANEL) */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--drawer-width);
  height: 100vh;
  background-color: #0d1220;
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
}

.drawer.active {
  transform: translateX(0);
}

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

.drawer-title-group h3 {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.drawer-title-group span {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}

.btn-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-close:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* TABS */
.tab-header {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.15);
  padding: 0 32px;
}

.tab-btn {
  padding: 16px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: #818cf8;
  border-bottom-color: var(--border-focus);
}

.tab-content {
  display: none;
  padding: 32px;
  flex-direction: column;
  gap: 28px;
}

.tab-content.active {
  display: flex;
}

/* DETAILS CONTENT */
.details-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.details-section h4 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #818cf8;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-color);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item.full-width {
  grid-column: span 2;
}

.detail-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-value {
  font-size: 14px;
  color: var(--text-main);
}

.detail-value.text-block {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 6px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.pje-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
}

.pje-link:hover {
  text-decoration: underline;
}

/* EDIT FORMS */
.edit-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.form-group-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group-section h5 {
  font-size: 13px;
  font-weight: 600;
  color: #818cf8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-color);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
  padding: 10px 12px;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition-fast);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background-color: rgba(0, 0, 0, 0.3);
}

.form-group select option {
  background-color: #0f172a;
  color: var(--text-main);
}

.help-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* SETTINGS MODAL STYLING */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

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

.modal {
  width: 90%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 i {
  color: #818cf8;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-intro {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-body form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

/* =========================================
   RESPONSIVE DESIGN - MOBILE & TABLET
   ========================================= */

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  margin-right: 12px;
}

/* Tablet (768px and below) */
@media (max-width: 768px) {
  body {
    height: auto !important;
    overflow-y: auto !important;
  }

  .app-container {
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
  }

  .main-content {
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
  }

  .content-body {
    height: auto !important;
    overflow: visible !important;
  }

  /* Sidebar becomes overlay */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    z-index: 1000;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: inline-flex;
  }

  /* Topbar adjustments */
  .topbar {
    padding: 0 16px;
    height: 64px;
  }

  .title-area {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .title-area h2 {
    font-size: 16px;
  }

  .title-area p {
    display: none;
  }

  .search-and-actions {
    gap: 8px;
  }

  .search-box {
    width: 200px;
  }

  .search-box input {
    padding: 8px 12px 8px 36px;
    font-size: 13px;
  }

  .btn span {
    display: none;
  }

  .btn {
    padding: 8px 12px;
  }

  /* Content body */
  .content-body {
    padding: 16px;
  }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-card {
    padding: 8px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .stat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .stat-value {
    font-size: 16px;
    line-height: 1.2;
  }

  .stat-label {
    font-size: 10px;
    text-align: center;
    white-space: normal;
    line-height: 1.1;
  }

  /* Table responsive */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .process-table {
    min-width: 600px;
  }

  .process-table th,
  .process-table td {
    padding: 12px 16px;
    font-size: 13px;
  }

  /* Hide less important columns on mobile */
  .process-table th:nth-child(3),
  .process-table th:nth-child(4),
  .process-table td:nth-child(3),
  .process-table td:nth-child(4) {
    display: none;
  }

  /* Drawer full width on mobile */
  .drawer {
    width: 100%;
    max-width: 100%;
  }

  .drawer-header {
    padding: 16px 20px;
  }

  .drawer-title-group h3 {
    font-size: 16px;
  }

  .drawer-body {
    padding: 20px;
  }

  .tab-header {
    padding: 0 20px;
  }

  .tab-btn {
    padding: 12px 16px;
    font-size: 13px;
  }

  .tab-content {
    padding: 20px;
  }

  /* Details grid single column */
  .details-grid {
    grid-template-columns: 1fr;
  }

  .detail-item.full-width {
    grid-column: span 1;
  }

  /* Form grid single column */
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  /* Modal responsive */
  .modal {
    width: 95%;
    max-width: 95%;
    max-height: 95vh;
  }

  .modal-header {
    padding: 16px 20px;
  }

  .modal-header h3 {
    font-size: 16px;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Form actions */
  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
  /* Sidebar narrower on small mobile */
  .sidebar {
    width: 260px;
  }

  /* Topbar */
  .topbar {
    padding: 0 12px;
  }

  .title-area h2 {
    font-size: 14px;
  }

  .search-box {
    width: 140px;
  }

  .search-box input {
    padding: 8px 10px 8px 32px;
    font-size: 12px;
  }

  .btn {
    padding: 8px 10px;
  }

  .btn i {
    font-size: 14px;
  }

  /* Content */
  .content-body {
    padding: 12px;
  }

  /* Stats */
  .stat-card {
    padding: 12px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .stat-value {
    font-size: 18px;
  }

  .stat-label {
    font-size: 12px;
  }

  /* Table */
  .process-table {
    min-width: 500px;
  }

  .process-table th,
  .process-table td {
    padding: 10px 12px;
    font-size: 12px;
  }

  /* Hide more columns on very small screens */
  .process-table th:nth-child(5),
  .process-table th:nth-child(6),
  .process-table td:nth-child(5),
  .process-table td:nth-child(6) {
    display: none;
  }

  /* Drawer */
  .drawer-header {
    padding: 12px 16px;
  }

  .drawer-title-group h3 {
    font-size: 14px;
  }

  .drawer-body {
    padding: 16px;
  }

  .tab-header {
    padding: 0 16px;
  }

  .tab-btn {
    padding: 10px 12px;
    font-size: 12px;
  }

  .tab-content {
    padding: 16px;
    gap: 20px;
  }

  /* Details */
  .details-section h4 {
    font-size: 13px;
  }

  .detail-label {
    font-size: 11px;
  }

  .detail-value {
    font-size: 13px;
  }

  /* Forms */
  .form-group-section h5 {
    font-size: 12px;
  }

  .form-group label {
    font-size: 11px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 8px 10px;
    font-size: 13px;
  }

  /* Modal */
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-header {
    padding: 12px 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-intro {
    font-size: 12px;
  }

  .help-text {
    font-size: 10px;
  }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Pagination Styling */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.01);
  font-size: 13px;
  color: var(--text-muted);
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-num {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  transition: var(--transition-fast);
}

.page-num:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.page-num.active {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 10px var(--primary-glow);
}

.page-num.dots {
  background: none;
  border: none;
  cursor: default;
}

.page-num.dots:hover {
  background: none;
  color: var(--text-muted);
}

/* Extra mobile improvements for topbar */
@media (max-width: 600px) {
  .topbar {
    flex-direction: column;
    height: auto;
    padding: 16px 16px;
    gap: 12px;
    align-items: stretch;
  }
  
  .title-area {
    width: 100%;
    justify-content: space-between;
  }
  
  .search-and-actions {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }
  
  .search-box {
    flex: 1;
    width: auto !important;
  }
  
  .pagination-container {
    flex-direction: column;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
  }
}
