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

/* CSS Variables for Premium MEDLUME Brand */
:root {
  /* Medlume Brand Color Tokens */
  --color-brand-deep: #135C84;            /* Azul Profundo Medlume */
  --color-brand-live: #1A658F;            /* Azul Vivo Medlume */
  --color-brand-medium: #21729A;          /* Azul Médio Medlume */
  --color-brand-turquoise: #3FD2C7;       /* Turquesa Medlume */
  --color-brand-turquoise-light: #62DFD6; /* Turquesa Claro Medlume */
  --color-brand-white: #FFFFFF;
  --color-brand-bg: #F0F6F9;              /* Cinza Azulado muito claro */
  --color-brand-gray: #334A5C;            /* Cinza Escuro Medlume */
  --color-brand-dark: #112331;            /* Azul quase preto Medlume */

  /* Status Colors */
  --color-brand-success: #10B981;         /* Verde */
  --color-brand-warning: #F59E0B;         /* Amarelo/Laranja */
  --color-brand-danger: #EF4444;          /* Vermelho */

  /* Core compatibility mapping */
  --color-red: var(--color-brand-live);
  --color-red-hover: #135275;
  --color-red-light: #f0f6fa;
  --color-red-border: #d0e3ef;
  
  --color-navy: var(--color-brand-deep);
  --color-navy-hover: #0a3b57;
  --color-navy-light: #e8f0f4;
  --color-navy-border: #d1e2ec;
  
  --color-yellow: var(--color-brand-warning);
  --color-yellow-hover: #d98706;
  --color-yellow-light: #fef5e7;
  --color-yellow-border: #fde2b4;
  
  --color-gray-dark: var(--color-brand-dark);
  --color-gray-medium: var(--color-brand-gray);
  --color-gray-light: #E5E7EB;
  --color-bg-subtle: var(--color-brand-bg);
  --color-white: var(--color-brand-white);
  
  --color-green: var(--color-brand-success);
  --color-green-light: #ecfdf5;
  --color-green-border: #a7f3d0;
  
  --color-blue-info: var(--color-brand-medium);
  --color-blue-info-light: #ebf5f7;
  --color-blue-info-border: #cde6ec;
  
  --font-primary: 'Inter', sans-serif;
  --font-header: 'Poppins', sans-serif;
  
  --sidebar-width: 220px;
  --header-height: 72px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 18px;
  
  --transition-fast: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  --shadow-xs: 0 1px 2px 0 rgba(19, 92, 132, 0.05);
  --shadow-sm: 0 3px 6px 0 rgba(19, 92, 132, 0.08), 0 1px 3px -1px rgba(19, 92, 132, 0.04);
  --shadow-md: 0 10px 20px -3px rgba(19, 92, 132, 0.12), 0 4px 8px -2px rgba(19, 92, 132, 0.06);
  --shadow-lg: 0 20px 32px -4px rgba(19, 92, 132, 0.16), 0 8px 16px -2px rgba(19, 92, 132, 0.08);
  --shadow-xl: 0 28px 50px -8px rgba(19, 92, 132, 0.22), 0 12px 24px -4px rgba(19, 92, 132, 0.10);

  /* Brand Gradient Utility */
  --gradient-brand: linear-gradient(135deg, #135C84 0%, #1A658F 50%, #3FD2C7 100%);
}

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

@keyframes fadeInSection {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-brand-white);
  color: var(--color-brand-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings with proper tracking/letter-spacing */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-header);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-brand-dark);
  line-height: 1.3;
}

/* Secondary Typography and Descriptions */
.text-muted, .text-secondary, p.subtitle, .section-desc {
  color: var(--color-brand-gray) !important;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 400;
}

/* Auth / Login Page - Two Column Layout inspired by Audit */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #FFFFFF 0%, var(--color-brand-bg) 100%);
  padding: 24px;
}

.login-container {
  display: flex;
  background: var(--color-white);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 50px -15px rgba(7, 59, 130, 0.12);
  width: 100%;
  max-width: 860px;
  height: 480px;
  max-height: 90vh;
  overflow: hidden;
  border: 1px solid var(--color-gray-light);
}

.login-sidebar {
  width: 50%;
  background: var(--gradient-brand);
  padding: 30px;
  display: flex;
  flex-direction: column;
  color: var(--color-white);
  position: relative;
  text-align: left;
}

.login-sidebar-logo-container {
  margin-bottom: 20px;
  text-align: left;
}

.login-sidebar-logo {
  display: block;
  background-color: var(--color-white);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1.5px solid rgba(8, 181, 181, 0.25);
  box-shadow: 0 4px 12px rgba(7, 59, 130, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
  max-width: 140px;
  height: auto;
  transition: var(--transition-smooth);
}

.login-sidebar-logo:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(7, 59, 130, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
}

.login-sidebar-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 20px;
  color: var(--color-white) !important;
  font-family: var(--font-header);
}

.login-sidebar-title .highlight-word {
  color: #19C5C5;
  font-weight: 700;
}

.login-benefits-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

.benefit-item {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.benefit-item:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(3px);
}

.benefit-icon-wrapper {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.benefit-icon-wrapper i {
  color: #19C5C5;
  font-size: 14px;
}

.benefit-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.benefit-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-white) !important;
}

.benefit-desc {
  font-size: 10.5px;
  opacity: 0.8;
  line-height: 1.35;
}

.login-sidebar-footer {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 15px;
  text-align: left;
}

/* Right Column Form Area */
.login-form-area {
  width: 50%;
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.login-form-title {
  color: var(--color-brand-dark);
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.login-form-subtitle {
  color: var(--color-brand-gray);
  font-size: 13px;
  margin-bottom: 16px;
}

.form-group-custom {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-label-custom {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-brand-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-label-custom i {
  color: var(--color-brand-gray);
  font-size: 13px;
}

.form-control-custom {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-primary);
  font-size: 13px;
  color: var(--color-brand-dark);
  border: 1px solid var(--color-gray-light);
  border-radius: var(--border-radius-md);
  outline: none;
  background-color: #F0F4F8;
  transition: var(--transition-fast);
}

.form-control-custom:focus {
  border-color: var(--color-brand-live);
  background-color: var(--color-white);
  box-shadow: 0 0 0 3px rgba(8, 121, 232, 0.1);
}

.btn-login-submit {
  width: 100%;
  background-color: var(--color-brand-live);
  border: none;
  color: var(--color-white);
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(8, 121, 232, 0.15);
  transition: var(--transition-fast);
  margin-top: 10px;
}

.btn-login-submit:hover {
  background-color: #0661ba;
  box-shadow: 0 6px 16px rgba(8, 121, 232, 0.25);
}

.login-form-secure {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-brand-success);
  font-size: 11px;
  font-weight: 500;
  margin-top: 16px;
}

.login-form-secure i {
  font-size: 13px;
}

/* Responsiveness */
@media (max-width: 768px) {
  .login-container {
    max-width: 400px;
    flex-direction: column;
    min-height: auto;
  }
  .login-sidebar {
    display: none;
  }
  .login-form-area {
    width: 100%;
    padding: 32px 24px;
  }
}

/* Forms styling */
.form-group {
  margin-bottom: 14px;
  text-align: left;
}

.login-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-light);
}

.login-card .form-group {
  margin-bottom: 10px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-gray-dark);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  padding: 5px 10px;
  font-family: var(--font-primary);
  font-size: 12px;
  color: var(--color-gray-dark);
  border: 1px solid var(--color-gray-light);
  border-radius: var(--border-radius-sm);
  outline: none;
  background-color: var(--color-white);
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--color-navy);
  box-shadow: 0 0 0 3px rgba(23, 22, 107, 0.12);
}

.form-control::placeholder {
  color: var(--color-gray-medium);
  opacity: 0.7;
}

/* Buttons with tactile premium feels */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  gap: 6px;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1.5px);
  box-shadow: var(--shadow-sm);
}

.btn:active:not(:disabled) {
  transform: translateY(0.5px);
  box-shadow: var(--shadow-xs);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gradient-brand);
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-secondary {
  background-color: var(--color-navy);
  color: var(--color-white);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--color-navy-hover);
}

.btn-highlight {
  background-color: var(--color-yellow);
  color: var(--color-gray-dark);
}

.btn-highlight:hover:not(:disabled) {
  background-color: var(--color-yellow-hover);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--color-navy-border);
  color: var(--color-navy);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--color-navy-light);
  border-color: var(--color-navy);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* Main Dashboard Shell */
.app-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--color-bg-subtle);
}

/* Refined Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--color-navy);
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03);
  z-index: 1010;
  position: relative;
  border-bottom-right-radius: 12px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Collapsed Styles */
.app-container.sidebar-collapsed .sidebar {
  width: 70px;
}
.app-container.sidebar-collapsed .sidebar .logo-full {
  opacity: 0 !important;
  max-width: 0 !important;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none;
}
.app-container.sidebar-collapsed .sidebar .logo-icon {
  display: block !important;
  opacity: 1 !important;
  max-width: 40px !important;
}
.app-container.sidebar-collapsed .sidebar .link-text {
  opacity: 0 !important;
  max-width: 0 !important;
  margin-left: 0 !important;
  pointer-events: none;
}
.app-container.sidebar-collapsed .sidebar-profile .profile-info {
  opacity: 0 !important;
  max-width: 0 !important;
  pointer-events: none;
}
.app-container.sidebar-collapsed .sidebar .sidebar-footer span {
  opacity: 0 !important;
  max-width: 0 !important;
  margin-left: 0 !important;
  pointer-events: none;
}
.app-container.sidebar-collapsed .sidebar-profile {
  padding: 15px 0 !important;
  justify-content: center !important;
  gap: 0 !important;
}
.app-container.sidebar-collapsed .sidebar-brand {
  padding: 8px 0 !important;
}
.app-container.sidebar-collapsed .sidebar-link {
  padding: 8px 0 !important;
  justify-content: center !important;
  gap: 0 !important;
}
.app-container.sidebar-collapsed .sidebar-footer {
  padding: 10px 8px !important;
}
.app-container.sidebar-collapsed .sidebar-footer .btn {
  padding: 8px 0 !important;
  justify-content: center !important;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1005;
  transition: opacity 0.3s ease;
}

.sidebar-brand {
  padding: 12px 24px;
  text-align: center;
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logo {
  max-width: 150px;
  height: auto;
  display: block;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-full {
  max-width: 150px;
  opacity: 1;
}

.logo-icon {
  max-width: 0;
  opacity: 0;
  display: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-profile {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(0, 0, 0, 0.1);
  transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--color-red);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.profile-info {
  font-size: 13px;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  max-width: 130px;
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  overflow: hidden;
}

.profile-name {
  font-weight: 600;
  display: block;
  color: rgba(255, 255, 255, 0.95);
}

.profile-role {
  font-size: 11px;
  color: var(--color-yellow);
  font-weight: 500;
}

.sidebar-menu {
  list-style: none;
  padding: 10px 0;
  flex-grow: 1;
}

.sidebar-item {
  margin-bottom: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 4px solid transparent;
  transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1), gap 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s ease, background-color 0.15s ease;
}

.sidebar .link-text {
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  max-width: 150px;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  vertical-align: middle;
}

.sidebar .sidebar-footer span {
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  max-width: 100px;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  vertical-align: middle;
}

.sidebar-link:hover {
  color: var(--color-white);
  background-color: rgba(255, 255, 255, 0.04);
}

.sidebar-item.active .sidebar-link {
  color: var(--color-white);
  background-color: rgba(255, 255, 255, 0.08);
  border-left-color: var(--color-red);
  font-weight: 600;
}

.sidebar-link i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: 0.8;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Premium Header with soft outline */
.main-header {
  height: var(--header-height);
  background-color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--color-gray-light);
  z-index: 5;
}

.header-title {
  color: var(--color-navy);
  font-size: 18px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-clock {
  font-size: 13px;
  color: var(--color-gray-medium);
  font-weight: 600;
  font-family: var(--font-header);
}

/* Main Body View */
.content-body {
  padding: 16px 20px;
  flex-grow: 1;
  overflow-y: auto;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
  animation: fadeInSection 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Metric Cards with depth */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.card {
  background: var(--color-white);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px 18px;
  border: 1px solid rgba(19, 92, 132, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(63, 210, 199, 0.5);
}

.card::before {
  display: none;
}

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

.card-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--color-brand-gray);
  margin-bottom: 4px;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.card-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-brand-dark);
  line-height: 1.1;
}

.card-icon {
  font-size: 22px;
  color: var(--color-brand-medium);
  transition: var(--transition-smooth);
}

.card:hover .card-icon {
  transform: scale(1.15);
  color: var(--color-brand-turquoise);
}

/* Secondary Panels */
.dashboard-details {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-card {
  background: var(--color-white);
  border-radius: var(--border-radius-md);
  border: 1px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  position: relative;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.panel-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.panel-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(0, 0, 0, 0.02);
  pointer-events: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-gray-light);
}

.panel-title {
  color: var(--color-navy);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Clean Tables with fine spacing */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gray-medium);
  background-color: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-gray-light);
}

.table td {
  padding: 6px 10px;
  font-size: 11px;
  border-bottom: 1px solid var(--color-gray-light);
  vertical-align: middle;
  color: var(--color-gray-dark);
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr {
  transition: var(--transition-fast);
}

.table tr:hover {
  background-color: var(--color-bg-subtle);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.badge-waiting {
  background-color: var(--color-yellow-light);
  color: var(--color-yellow-hover);
  border-color: var(--color-yellow-border);
}

.badge-serving {
  background-color: var(--color-navy-light);
  color: var(--color-navy);
  border-color: var(--color-navy-border);
}

.badge-completed {
  background-color: var(--color-green-light);
  color: var(--color-green);
  border-color: var(--color-green-border);
}

.badge-canceled {
  background-color: var(--color-red-light);
  color: var(--color-red);
  border-color: var(--color-red-border);
}

.badge-info {
  background-color: var(--color-blue-info-light);
  color: var(--color-blue-info);
  border-color: var(--color-blue-info-border);
}

/* Dynamic SVG chart columns */
.svg-chart-container {
  height: 220px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 20px 10px 10px 10px;
  border-left: 1px solid var(--color-gray-light);
  border-bottom: 1px solid var(--color-gray-light);
}

.chart-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 14%;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  background-color: var(--color-navy);
  border-radius: 4px 4px 0 0;
  min-height: 10px;
  transition: var(--transition-smooth);
  position: relative;
}

.chart-bar:hover {
  background-color: var(--color-red);
}

.chart-bar-tooltip {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translate(-50%, -100%);
  background-color: var(--color-gray-dark);
  color: var(--color-white);
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-fast);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  text-align: center;
  line-height: 1.4;
}

.chart-bar:hover .chart-bar-tooltip {
  opacity: 1;
}

.chart-label {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-gray-medium);
  text-align: center;
}

/* Mobile check-in page layout (cadastro.html) */
.mobile-wrapper {
  background-color: var(--color-bg-subtle);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
}

.mobile-card {
  width: 100%;
  max-width: 480px;
  background: var(--color-white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  border-top: 6px solid var(--color-navy);
  padding: 36px 24px;
  margin-top: 20px;
  position: relative;
}

.mobile-logo-container {
  text-align: center;
  margin-bottom: 15px;
}

.mobile-logo {
  max-width: 130px;
  height: auto;
  border: 1.5px solid #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  padding: 4px;
  background: #FFFFFF;
}

.mobile-title {
  color: var(--color-navy);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.mobile-subtitle {
  color: var(--color-gray-medium);
  font-size: 14px;
  text-align: center;
  margin-bottom: 28px;
}

/* Printed check-in ticket */
.ticket-container {
  border: 2px dashed var(--color-navy-border);
  border-radius: var(--border-radius-md);
  padding: 24px;
  text-align: center;
  margin-top: 24px;
  background-color: var(--color-bg-subtle);
}

.ticket-number {
  font-size: 46px;
  font-weight: 700;
  color: var(--color-red);
  letter-spacing: 2px;
  margin: 12px 0;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
}

/* TV Waiting Room layout (painel.html) */
.waiting-panel-body {
  background-color: #0B0A33; /* Darker Cinematic Navy */
  color: var(--color-white);
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 92px 1fr;
  font-family: var(--font-header);
}

.waiting-header {
  background-color: var(--color-white);
  color: var(--color-navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  border-bottom: 4px solid var(--color-red);
}

.waiting-logo {
  height: 56px;
  width: auto;
}

.waiting-clock {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-navy);
}

.waiting-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  height: 100%;
  overflow: hidden;
}

.current-call-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at center, rgba(23, 22, 107, 0.4) 0%, rgba(11, 10, 51, 0.8) 100%);
}

.current-call-title {
  color: var(--color-yellow);
  font-size: 30px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
  letter-spacing: 3px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.current-patient-name {
  font-size: 68px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 24px;
  line-height: 1.15;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  letter-spacing: -0.01em;
}

.current-room-info {
  display: inline-flex;
  gap: 20px;
  background-color: var(--color-red);
  color: var(--color-white);
  padding: 16px 48px;
  border-radius: 40px;
  box-shadow: 0 10px 25px rgba(160, 0, 0, 0.4);
  font-size: 34px;
  font-weight: 700;
  text-transform: uppercase;
  border: 3px solid var(--color-white);
  letter-spacing: 1px;
}

.waiting-list-area {
  display: flex;
  flex-direction: column;
  padding: 36px;
  background-color: rgba(0, 0, 0, 0.15);
  overflow-y: auto;
}

.waiting-list-title {
  color: var(--color-yellow);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 24px;
  border-bottom: 2px solid rgba(242, 192, 0, 0.2);
  padding-bottom: 12px;
  letter-spacing: 1px;
}

.waiting-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.waiting-list-item {
  background-color: rgba(255, 255, 255, 0.05);
  border-left: 6px solid var(--color-yellow);
  border-radius: var(--border-radius-sm);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255,255,255,0.02);
}

.waiting-list-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.waiting-item-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-white);
}

.waiting-item-dest {
  font-size: 16px;
  color: var(--color-yellow);
  font-weight: 700;
}

/* Custom Modal blur effect backdrop (Requirement 3) */
#tx-modal, #patient-modal {
  backdrop-filter: blur(4px);
  background-color: rgba(14, 13, 64, 0.4) !important;
}

/* Custom warning alerts styles */
.alert-warning {
  border-left: 4px solid var(--color-yellow) !important;
  border-color: var(--color-yellow-border) !important;
}

/* Animations */
.flash-alert {
  animation: bgFlash 0.8s ease-in-out 3;
}

@keyframes bgFlash {
  0%, 100% { background-color: #0B0A33; }
  50% { background-color: var(--color-red); }
}

/* Responsive breakdowns */
@media (max-width: 992px) {
  .dashboard-details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: row;
  }
  
  .main-content {
    width: 100%;
    flex-grow: 1;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: 1010;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  
  .app-container.sidebar-open .sidebar {
    transform: translateX(0);
  }
  
  .app-container.sidebar-open .sidebar-overlay {
    display: block;
  }

  .app-container.sidebar-open .sidebar .logo-full {
    display: block !important;
  }
  
  .app-container.sidebar-open .sidebar .logo-icon {
    display: none !important;
  }
  
  .app-container.sidebar-open .sidebar .link-text {
    display: inline !important;
  }
  
  .app-container.sidebar-open .sidebar-profile .profile-info {
    display: block !important;
  }
  
  .sidebar-brand {
    padding: 16px;
  }
  
  .sidebar-profile {
    display: flex !important;
  }
  
  .sidebar-menu {
    display: block;
    padding: 20px 0;
  }
  
  .sidebar-item {
    margin-bottom: 4px;
  }
  
  .sidebar-link {
    padding: 12px 24px;
    font-size: 14px;
  }
  
  .sidebar-item.active .sidebar-link {
    border-left: 4px solid var(--color-red);
    border-bottom: none;
  }

  .main-header {
    padding: 0 16px;
    flex-direction: row;
    height: var(--header-height);
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  
  .content-body {
    padding: 16px;
  }
  
  .waiting-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1.4fr 1fr;
  }
  
  .current-patient-name {
    font-size: 40px;
  }
  
  .current-room-info {
    font-size: 22px;
    padding: 8px 24px;
  }

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

/* Settings Administration Split Layout */
.settings-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}
.settings-menu {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-gray-light);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.settings-menu-item {
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-gray-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 3px solid transparent;
  transition: var(--transition-fast);
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
.settings-menu-item:hover {
  background-color: var(--color-bg-subtle);
  color: var(--color-navy);
}
.settings-menu-item.active {
  background-color: var(--color-navy-light);
  color: var(--color-navy);
  border-left-color: var(--color-navy);
}
.settings-menu-item i {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

/* Toast Notifications Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10100;
  pointer-events: none;
}

.toast {
  background-color: var(--color-brand-dark);
  color: var(--color-white);
  padding: 12px 20px;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
  pointer-events: auto;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.3s ease;
  border-left: 4px solid var(--color-brand-live);
}

.toast-success {
  border-left-color: var(--color-brand-success);
}

.toast-warning {
  border-left-color: var(--color-brand-warning);
}

.toast-error {
  border-left-color: var(--color-brand-danger);
}

.toast-info {
  border-left-color: var(--color-brand-live);
}

.toast i {
  font-size: 16px;
}

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

@keyframes fadeOutToast {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Agenda Premium Cards */
.agenda-app-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-light);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.agenda-app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(23, 22, 107, 0.15);
}

.agenda-app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--color-navy); /* Default/Scheduled = Navy accent */
}

.agenda-app-card.card-confirmed::before {
  background-color: var(--color-brand-success); /* Confirmed = Green accent */
}

.agenda-app-card.card-checkin::before {
  background-color: var(--color-brand-warning); /* Check-in = Yellow accent */
}

.agenda-app-card.card-canceled::before {
  background-color: var(--color-brand-danger); /* Canceled = Red accent */
}

/* Patients Tab Buttons */
.ficha-tab-btn {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: var(--color-gray-medium);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  gap: 8px;
}

.ficha-tab-btn:hover {
  color: var(--color-navy);
  border-bottom-color: var(--color-gray-light);
}

.ficha-tab-btn.active {
  color: var(--color-navy);
  border-bottom-color: var(--color-navy);
}

.ficha-tab-btn.active span {
  background-color: var(--color-navy-light) !important;
  color: var(--color-navy) !important;
}

.ficha-tab-btn span {
  background-color: var(--color-gray-light) !important;
  color: var(--color-gray-dark) !important;
  transition: all 0.2s ease;
}

/* Financial Tab Navigation (Requirement 1 & 24) */
.fin-tab-nav {
  display: flex;
  border-bottom: 2px solid var(--color-gray-light);
  margin-bottom: 12px;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-gray-medium) var(--color-bg-subtle);
  padding-bottom: 6px;
}
.fin-tab-nav::-webkit-scrollbar {
  height: 4px;
}
.fin-tab-nav::-webkit-scrollbar-track {
  background: var(--color-bg-subtle);
  border-radius: 4px;
}
.fin-tab-nav::-webkit-scrollbar-thumb {
  background: var(--color-gray-medium);
  border-radius: 4px;
}
.fin-tab-nav::-webkit-scrollbar-thumb:hover {
  background: var(--color-navy);
}

.fin-sub-item {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  color: var(--color-gray-dark);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  gap: 6px;
  white-space: nowrap;
}
.fin-sub-item:hover {
  color: var(--color-navy);
  border-bottom-color: var(--color-gray-light);
}
.fin-sub-item.active {
  color: var(--color-navy);
  border-bottom-color: var(--color-navy);
}
.fin-sub-item.disabled {
  opacity: 0.35 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

.report-grid-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}
.report-metric-box {
  background: #F8FAFC;
  border-radius: 6px;
  padding: 15px;
  border: 1px solid var(--color-gray-light);
  border-left: 4px solid var(--color-navy);
  text-align: center;
}
.report-metric-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--color-gray-medium);
  font-weight: 600;
  display: block;
  margin-bottom: 5px;
}
.report-metric-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-navy);
}

/* Compact dashboard styling (Requirement 3) */
.fin-compact-card {
  padding: 10px 12px !important;
  margin-bottom: 10px !important;
}

.fin-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.fin-chart-card {
  min-height: 185px !important;
  padding: 8px 10px !important;
  margin-bottom: 0 !important;
}

.fin-chart-card .panel-header {
  margin-bottom: 5px !important;
  padding-bottom: 5px !important;
  border-bottom: 1px solid var(--color-bg-subtle) !important;
}

.fin-chart-card .panel-title {
  font-size: 11px !important;
  font-weight: 700 !important;
}

/* Slim Indicators Overrides - Left Border Only */
#fin-dash-stats .card {
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
  border-left: 4px solid transparent !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  padding: 8px 12px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#fin-dash-stats .card-info {
  display: flex;
  flex-direction: column;
}
#fin-dash-stats .card-title {
  font-size: 10px !important;
  color: var(--color-gray-dark) !important;
  margin-bottom: 2px;
  text-transform: uppercase;
  font-weight: 600;
}
#fin-dash-stats .card-value {
  font-size: 15px !important;
  font-weight: 700;
  color: #0F172A !important; /* High contrast dark text */
}
#fin-dash-stats .card-icon {
  font-size: 18px !important;
  color: #475569 !important;
}

/* Accent left-border colors & soft colored shadows */
.card.card-accent-green {
  border-left: 4px solid #2C7E55 !important;
  box-shadow: 0 3px 8px rgba(44, 126, 85, 0.07) !important;
}
.card.card-accent-red {
  border-left: 4px solid #9E3D3D !important;
  box-shadow: 0 3px 8px rgba(158, 61, 61, 0.07) !important;
}
.card.card-accent-navy {
  border-left: 4px solid #2E5B88 !important;
  box-shadow: 0 3px 8px rgba(46, 91, 136, 0.07) !important;
}
.card.card-accent-orange {
  border-left: 4px solid #B7791F !important;
  box-shadow: 0 3px 8px rgba(183, 121, 31, 0.07) !important;
}
.card.card-accent-purple {
  border-left: 4px solid #5C5470 !important;
  box-shadow: 0 3px 8px rgba(92, 84, 112, 0.07) !important;
}
.card.card-accent-slate {
  border-left: 4px solid #475569 !important;
  box-shadow: 0 3px 8px rgba(71, 85, 105, 0.07) !important;
}

/* Indicators localized icon and value colors for premium design */
#fin-dash-stats .card-accent-green .card-icon,
#fin-dash-stats .card-accent-green .card-value {
  color: #2C7E55 !important;
}
#fin-dash-stats .card-accent-red .card-icon,
#fin-dash-stats .card-accent-red .card-value {
  color: #9E3D3D !important;
}

/* QR Code Box and Container styling (Requirement 22) */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.qr-code-box {
  width: 240px !important;
  height: 240px !important;
  margin: 5px auto 12px auto;
  padding: 8px;
  border: 1px solid var(--color-gray-light);
  border-radius: 6px;
  background: var(--color-white);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.qr-code-box svg, .qr-code-box img {
  width: 100% !important;
  height: 100% !important;
}

/* Responsive Grid Classes for Totem / Mobile Portal */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row-ratio-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 520px) {
  .mobile-wrapper {
    padding: 10px 8px;
  }
  .mobile-card {
    padding: 24px 16px;
    margin-top: 10px;
  }
  .form-row-2, .form-row-ratio-2 {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }
  .qr-nav-bar {
    gap: 4px;
    padding-bottom: 4px;
  }
  .qr-nav-link {
    font-size: 11.5px;
    padding: 8px 4px;
  }
}




