/* ============================================
   LA CEBOLLA - Custom CSS
   Tema Verde | Modo Oscuro | Mejoras Visuales
   ============================================ */

/* === CSS Custom Properties (Light Theme) === */
:root {
  /* Brand Colors */
  --brand-primary: #198754;
  --brand-primary-dark: #146c43;
  --brand-primary-light: #20c997;
  --brand-sidebar-bg: #1a1a2e;
  --brand-sidebar-text: #adb5bd;

  /* Backgrounds */
  --bg-body: #f4f6f9;
  --bg-card: #ffffff;
  --bg-card-header: #f8f9fa;
  --bg-sidebar: #1a1a2e;
  --bg-sidebar-hover: #2d2d44;
  --bg-sidebar-active: #198754;
  --bg-navbar: #ffffff;
  --bg-input: #ffffff;
  --bg-table-header: #343a40;
  --bg-table-stripe: #f8f9fa;

  /* Text */
  --text-primary: #333333;
  --text-secondary: #6c757d;
  --text-muted: #999999;
  --text-sidebar: #adb5bd;
  --text-on-primary: #ffffff;

  /* Borders */
  --border-color: #dee2e6;
  --border-card: #dee2e6;
  --border-input: #ced4da;

  /* Shadows */
  --shadow-card: 0 0 15px rgba(0, 0, 0, 0.05);
  --shadow-card-hover: 0 5px 20px rgba(0, 0, 0, 0.1);
  --shadow-navbar: 0 2px 4px rgba(0, 0, 0, 0.04);

  /* Currency Colors */
  --color-cup: #28a745;
  --color-cup-light: #d4edda;
  --color-usd: #0d6efd;
  --color-usd-light: #cce5ff;
  --color-eur: #fd7e14;
  --color-eur-light: #fde2cc;
  --color-transfer: #17a2b8;
  --color-transfer-light: #d1ecf1;
  --color-zelle: #6f42c1;
  --color-zelle-light: #e8daef;
  --color-clasica: #ffc107;
  --color-clasica-light: #fff3cd;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
}

/* === Dark Mode === */
body.dark-mode {
  --bg-body: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-header: #1a1a2e;
  --bg-sidebar: #0f0f1a;
  --bg-sidebar-hover: #1a1a2e;
  --bg-sidebar-active: #198754;
  --bg-navbar: #16213e;
  --bg-input: #1a1a2e;
  --bg-table-header: #0f0f1a;
  --bg-table-stripe: #1a1a2e;

  --text-primary: #e0e0e0;
  --text-secondary: #adb5bd;
  --text-muted: #6c757d;
  --text-sidebar: #adb5bd;

  --border-color: #2d2d44;
  --border-card: #2d2d44;
  --border-input: #3d3d5c;

  --shadow-card: 0 0 15px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 5px 20px rgba(0, 0, 0, 0.4);
  --shadow-navbar: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.dark-mode .content-wrapper {
  background: var(--bg-body);
}

body.dark-mode .main-header.navbar {
  background: var(--bg-navbar);
  border-bottom: 1px solid var(--border-color);
}

body.dark-mode .nav-link {
  color: var(--text-secondary) !important;
}

body.dark-mode .nav-link:hover {
  color: var(--brand-primary-light) !important;
}

body.dark-mode .main-sidebar {
  background: var(--bg-sidebar);
}

body.dark-mode .sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
  background: var(--brand-primary);
  color: #fff !important;
}

body.dark-mode .sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link:hover {
  background: var(--bg-sidebar-hover);
  color: #fff !important;
}

body.dark-mode .sidebar-dark-primary .nav-header {
  color: var(--text-muted);
}

body.dark-mode .brand-link {
  border-bottom: 1px solid var(--border-color);
}

body.dark-mode .brand-text {
  color: var(--brand-primary-light) !important;
}

body.dark-mode .card {
  background: var(--bg-card);
  border-color: var(--border-card);
  box-shadow: var(--shadow-card);
}

body.dark-mode .card-header {
  background: var(--bg-card-header);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .card-body {
  color: var(--text-primary);
}

body.dark-mode .table {
  color: var(--text-primary);
}

body.dark-mode .table td,
body.dark-mode .table th {
  border-color: var(--border-color);
}

body.dark-mode .thead-dark th {
  background: var(--bg-table-header);
  color: #e0e0e0;
  border-color: var(--border-color);
}

body.dark-mode .table-hover tbody tr:hover {
  background: rgba(25, 135, 84, 0.08);
  color: var(--text-primary);
}

body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
  background: var(--bg-table-stripe);
}

body.dark-mode .table-bordered td,
body.dark-mode .table-bordered th {
  border-color: var(--border-color);
}

body.dark-mode .content-header h1 {
  color: var(--text-primary);
}

body.dark-mode .text-muted {
  color: var(--text-muted) !important;
}

body.dark-mode .text-dark {
  color: var(--text-primary) !important;
}

body.dark-mode .bg-white {
  background-color: var(--bg-card) !important;
}

body.dark-mode .main-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

body.dark-mode .dropdown-menu {
  background: var(--bg-card);
  border-color: var(--border-color);
}

body.dark-mode .dropdown-item {
  color: var(--text-primary);
}

body.dark-mode .dropdown-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-primary);
}

body.dark-mode .dropdown-header {
  color: var(--text-muted);
}

body.dark-mode .alert-light {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .form-control {
  background: var(--bg-input);
  border-color: var(--border-input);
  color: var(--text-primary);
}

body.dark-mode .form-control:focus {
  background: var(--bg-input);
  border-color: var(--brand-primary);
  color: var(--text-primary);
}

body.dark-mode .input-group-text {
  background: var(--bg-card-header);
  border-color: var(--border-input);
  color: var(--text-secondary);
}

body.dark-mode .badge-dark {
  background: var(--bg-sidebar-hover);
}

body.dark-mode .login-box .card {
  background: var(--bg-card);
  border-color: var(--border-card);
}

body.dark-mode .login-card-body {
  color: var(--text-primary);
}

body.dark-mode .login-box-msg {
  color: var(--text-secondary);
}

body.dark-mode .hr,
body.dark-mode hr {
  border-color: var(--border-color);
}

body.dark-mode .modal-content {
  background: var(--bg-card);
  border-color: var(--border-card);
  color: var(--text-primary);
}

body.dark-mode .modal-header {
  border-bottom-color: var(--border-color);
}

body.dark-mode .modal-footer {
  border-top-color: var(--border-color);
}

body.dark-mode .list-group-item {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode pre,
body.dark-mode code {
  background: var(--bg-sidebar);
  color: var(--text-primary);
}

body.dark-mode .small-box {
  background: var(--bg-card);
  border-color: var(--border-card);
}

body.dark-mode .small-box h3,
body.dark-mode .small-box p {
  color: var(--text-primary);
}

/* === Brand Theme - Green === */
.sidebar-dark-primary {
  background: var(--brand-sidebar-bg);
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
  background: var(--brand-primary) !important;
  color: #fff !important;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link:hover {
  background: var(--brand-sidebar-hover);
  color: #fff !important;
}

.sidebar-dark-primary .nav-header {
  color: var(--brand-sidebar-text);
  font-weight: 600;
  letter-spacing: 0.5px;
  font-size: 0.7rem;
}

.brand-link {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.8rem 1rem;
}

.brand-text {
  color: var(--brand-primary-light) !important;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

/* === Dropdown Notifications === */
.dropdown-notificaciones {
  min-width: 320px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.dropdown-notificaciones::-webkit-scrollbar {
  width: 6px;
}

.dropdown-notificaciones::-webkit-scrollbar-track {
  background: transparent;
}

.dropdown-notificaciones::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

/* === Cards Improvements === */
.card {
  border-radius: 0.75rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-card);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
}

.card-header {
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
}

.card-header h3,
.card-header h5 {
  margin-bottom: 0;
  color: var(--text-primary);
}

.card-header.bg-dark,
.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-warning,
.card-header.bg-info,
.card-header.bg-danger,
.card-header.bg-secondary {
  border-bottom: none;
}

.card-header.bg-dark { background: var(--bg-table-header) !important; }
.card-header.bg-primary { background: var(--brand-primary) !important; }

.card-body {
  color: var(--text-primary);
}

/* Card Outline Variants */
.card-outline.card-success { border-left: 3px solid var(--color-cup); }
.card-outline.card-primary { border-left: 3px solid var(--color-usd); }
.card-outline.card-warning { border-left: 3px solid var(--color-eur); }
.card-outline.card-info { border-left: 3px solid var(--color-transfer); }
.card-outline.border-info { border-left: 3px solid var(--color-transfer); }
.card-outline.border-dark { border-left: 3px solid var(--bg-table-header); }
.card-outline.border-success { border-left: 3px solid var(--color-cup); }
.card-outline.border-warning { border-left: 3px solid var(--color-eur); }

/* === Tables Improvements === */
.table {
  color: var(--text-primary);
  margin-bottom: 0;
}

.table thead th {
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 0.5rem;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
  padding: 0.6rem 0.5rem;
  font-size: 0.9rem;
}

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

.table-hover tbody tr:hover {
  background: rgba(25, 135, 84, 0.06);
}

.table-bordered {
  border-color: var(--border-color);
}

.table-bordered td,
.table-bordered th {
  border-color: var(--border-color);
}

/* Table Footer */
.table tfoot th {
  background: var(--bg-table-header);
  color: #fff;
  font-weight: 600;
  border-color: var(--border-color);
}

/* === Currency Colors - CSS Classes === */
.bg-currency-cup { background: var(--color-cup) !important; color: #fff; }
.bg-currency-usd { background: var(--color-usd) !important; color: #fff; }
.bg-currency-eur { background: var(--color-eur) !important; color: #fff; }
.bg-currency-transfer { background: var(--color-transfer) !important; color: #fff; }
.bg-currency-zelle { background: var(--color-zelle) !important; color: #fff; }
.bg-currency-clasica { background: var(--color-clasica) !important; color: #000; }

.bg-currency-cup-light { background: var(--color-cup-light) !important; }
.bg-currency-usd-light { background: var(--color-usd-light) !important; }
.bg-currency-eur-light { background: var(--color-eur-light) !important; }
.bg-currency-transfer-light { background: var(--color-transfer-light) !important; }
.bg-currency-zelle-light { background: var(--color-zelle-light) !important; }
.bg-currency-clasica-light { background: var(--color-clasica-light) !important; }

/* === Buttons Improvements === */
.btn {
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  letter-spacing: 0.3px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
}

.btn-success {
  background: var(--color-cup);
  border-color: var(--color-cup);
}

.btn-outline-primary {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-outline-primary:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.btn-outline-success {
  color: var(--color-cup);
  border-color: var(--color-cup);
}

.btn-outline-success:hover {
  background: var(--color-cup);
  border-color: var(--color-cup);
  color: #fff;
}

/* Quick Access Buttons */
.quick-access-btn {
  border-radius: 0.75rem;
  font-weight: 500;
  transition: all var(--transition-normal);
  border-width: 2px;
}

.quick-access-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-outline-success.quick-access-btn:hover {
  background: var(--color-cup);
  border-color: var(--color-cup);
}

.btn-outline-warning.quick-access-btn:hover {
  background: var(--color-eur);
  border-color: var(--color-eur);
}

.btn-outline-info.quick-access-btn:hover {
  background: var(--color-transfer);
  border-color: var(--color-transfer);
}

.btn-outline-dark.quick-access-btn:hover {
  background: var(--bg-table-header);
  border-color: var(--bg-table-header);
}

.btn-outline-primary.quick-access-btn:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}

/* === Badges Improvements === */
.badge {
  font-weight: 500;
  letter-spacing: 0.3px;
  border-radius: 0.35rem;
}

.badge-success { background: var(--color-cup) !important; }
.badge-primary { background: var(--brand-primary) !important; }
.badge-warning { background: var(--color-eur) !important; }
.badge-info { background: var(--color-transfer) !important; }
.badge-danger { background: #dc3545 !important; }

/* === Page Header === */
.content-header h1 {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.5rem;
}

/* === Currency Cards === */
.currency-card .card-header {
  padding: 0.5rem 0.75rem;
}

.currency-card .badge {
  font-size: 14px;
  padding: 0.4em 0.6em;
}

.currency-card .card-body {
  padding: 0.5rem;
}

/* === Login Page Improvements === */
.login-page {
  background: linear-gradient(135deg, #1a1a2e 0%, #146c43 50%, #198754 100%);
  min-height: 100vh;
}

.login-box {
  animation: fadeInDown 0.6s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-logo a {
  color: var(--brand-primary-light) !important;
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.login-box .card {
  border-radius: 1rem;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.login-card-body {
  padding: 2rem;
}

.login-box-msg {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.login-box .btn-primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  border-radius: 0.5rem;
  padding: 0.6rem;
  font-weight: 600;
  transition: all var(--transition-normal);
}

.login-box .btn-primary:hover {
  background: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(25, 135, 84, 0.4);
}

.login-box .input-group-text {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  border-radius: 0.5rem;
}

.login-box .form-control {
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
}

.login-box .form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.15rem rgba(25, 135, 84, 0.25);
}

.login-box select.form-control {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 8px 10px;
  padding-right: 2rem;
}

/* === Transitions === */
.content-wrapper {
  transition: background-color var(--transition-normal);
}

.sidebar-mini .main-sidebar {
  transition: width var(--transition-normal), background-color var(--transition-normal);
}

/* === Alert Improvements === */
.alert {
  border-radius: 0.5rem;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.alert-success {
  border-left: 4px solid var(--color-cup);
}

.alert-warning {
  border-left: 4px solid var(--color-eur);
}

.alert-danger {
  border-left: 4px solid #dc3545;
}

.alert-info {
  border-left: 4px solid var(--color-transfer);
}

/* === Form Controls === */
.form-control {
  border-radius: 0.5rem;
  border-color: var(--border-input);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.15rem rgba(25, 135, 84, 0.25);
}

/* === Scrollbar Custom (Webkit) === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* === TOGGLE MODE - Mobile View === */

/* Sidebar: hidden off-screen with transform */
body.mobile-view .main-sidebar {
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: fixed !important;
  z-index: 1040;
  height: 100vh;
  top: 0;
  left: 0;
}

/* Sidebar: visible on screen */
body.mobile-view.sidebar-expand .main-sidebar {
  transform: translateX(0);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
}

/* Content wrapper: no margin in mobile view */
body.mobile-view .content-wrapper,
body.mobile-view .main-footer {
  margin-left: 0 !important;
}

/* Real overlay - created by JavaScript */
body.mobile-view .sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1035;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.mobile-view.sidebar-expand .sidebar-overlay {
  opacity: 1;
  visibility: visible;
}

/* Floating sidebar toggle button */
body.mobile-view .sidebar-toggle-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(25, 135, 84, 0.4);
  transition: all 0.3s ease;
  animation: pulseGlow 2s infinite;
}

body.mobile-view .sidebar-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(25, 135, 84, 0.5);
}

body.mobile-view .sidebar-toggle-btn i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

body.mobile-view.sidebar-expand .sidebar-toggle-btn {
  left: 270px;
}

body.mobile-view.sidebar-expand .sidebar-toggle-btn i {
  transform: rotate(180deg);
}

/* Hide toggle button when sidebar is visible on desktop */
@media (min-width: 769px) {
  body.mobile-view .sidebar-toggle-btn {
    display: none;
  }
}

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

/* Content wrapper */
body.mobile-view .content-wrapper {
  padding: 0.5rem;
}

/* Cards */
body.mobile-view .card {
  margin-bottom: 0.75rem;
  border-radius: 0.5rem;
}

body.mobile-view .card-body {
  padding: 0.75rem;
}

body.mobile-view .card-header {
  padding: 0.6rem 0.75rem;
}

body.mobile-view .card-header h3,
body.mobile-view .card-header h5 {
  font-size: 0.95rem;
}

/* Currency cards */
body.mobile-view .currency-card {
  min-width: calc(50% - 0.75rem);
  flex: 0 0 calc(50% - 0.75rem);
  max-width: calc(50% - 0.75rem);
}

/* Quick access buttons - 2x2 grid */
body.mobile-view .quick-access-btn {
  min-height: 70px;
  font-size: 0.8rem;
  padding: 0.75rem 0.5rem;
  border-width: 2px;
}

body.mobile-view .quick-access-btn i {
  font-size: 1.5rem !important;
}

/* Forms */
body.mobile-view .form-row {
  flex-direction: column;
}

body.mobile-view .form-row > div {
  width: 100%;
  flex: 0 0 100%;
  max-width: 100%;
}

body.mobile-view .form-group {
  margin-bottom: 1rem;
}

body.mobile-view .form-inline {
  flex-direction: column;
  align-items: stretch;
}

body.mobile-view .form-inline .form-control {
  margin-bottom: 0.5rem;
}

/* Tables - improved mobile */
body.mobile-view .table-responsive {
  -webkit-overflow-scrolling: touch;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
}

body.mobile-view .table {
  font-size: 0.85rem;
  margin-bottom: 0;
}

body.mobile-view .table td,
body.mobile-view .table th {
  padding: 0.5rem 0.4rem;
  white-space: nowrap;
}

body.mobile-view .table td:first-child,
body.mobile-view .table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg-card);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

body.mobile-view .table thead th:first-child {
  background: var(--bg-table-header);
  color: #fff;
  z-index: 2;
}

body.mobile-view .table tbody tr:hover td:first-child {
  background: rgba(25, 135, 84, 0.06);
}

/* Buttons */
body.mobile-view .btn {
  min-height: 48px;
  font-size: 0.95rem;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
}

body.mobile-view .btn-sm {
  min-height: 40px;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
}

body.mobile-view .btn-block {
  min-height: 52px;
  font-size: 1rem;
  font-weight: 600;
}

/* Nav tabs - scrollable */
body.mobile-view .nav-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: none;
  padding-bottom: 0.5rem;
}

body.mobile-view .nav-tabs::-webkit-scrollbar {
  display: none;
}

body.mobile-view .nav-tabs .nav-link {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Page header */
body.mobile-view .content-header h1 {
  font-size: 1.3rem;
}

body.mobile-view .content-header .row {
  flex-direction: column;
}

body.mobile-view .content-header .col-sm-6 {
  flex: 0 0 100%;
  max-width: 100%;
}

/* Navbar */
body.mobile-view .main-header .nav-link {
  padding: 0.6rem;
  font-size: 1.1rem;
}

body.mobile-view .navbar-nav .nav-item .nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Dropdown notifications - full width on mobile */
body.mobile-view .dropdown-notificaciones {
  min-width: calc(100vw - 20px);
  right: -10px;
  max-height: 60vh;
}

body.mobile-view .dropdown-menu {
  min-width: calc(100vw - 20px) !important;
}

/* Badges */
body.mobile-view .badge {
  font-size: 0.75rem;
  padding: 0.35em 0.5em;
}

body.mobile-view .navbar-badge {
  font-size: 0.65rem;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
}

/* Alerts */
body.mobile-view .alert {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

/* Modals */
body.mobile-view .modal-dialog {
  margin: 0.25rem;
  max-width: calc(100% - 0.5rem);
}

body.mobile-view .modal-content {
  border-radius: 0.75rem;
}

/* Small boxes */
body.mobile-view .small-box {
  margin-bottom: 0.75rem;
  border-radius: 0.5rem;
}

body.mobile-view .small-box h3 {
  font-size: 1.5rem;
}

body.mobile-view .small-box p {
  font-size: 0.85rem;
}

/* Filter cards */
body.mobile-view .card-outline.card-primary .card-body {
  padding: 0.5rem;
}

/* Footer */
body.mobile-view .main-footer {
  font-size: 0.75rem;
  padding: 0.5rem;
  text-align: center;
}

body.mobile-view .main-footer .float-right {
  float: none !important;
  display: block;
  margin-top: 0.25rem;
}

/* Sidebar nav items - bigger touch targets */
body.mobile-view .sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link {
  padding: 0.75rem 1rem;
  margin: 3px 8px;
  border-radius: 0.5rem;
}

body.mobile-view .sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link p {
  font-size: 0.9rem;
}

body.mobile-view .sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link .nav-icon {
  font-size: 1rem;
}

/* Summary sections - stack vertically */
body.mobile-view .row > .col-md-6 {
  flex: 0 0 100%;
  max-width: 100%;
}

body.mobile-view .row > .col-md-4 {
  flex: 0 0 100%;
  max-width: 100%;
}

body.mobile-view .row > .col-md-3 {
  flex: 0 0 calc(50% - 1rem);
  max-width: calc(50% - 1rem);
}

/* Currency amount display */
body.mobile-view .currency-amount {
  font-size: 0.9rem;
}

/* Login page */
body.mobile-view.login-page {
  padding-top: 2rem;
}

body.mobile-view .login-box {
  width: 90%;
  margin: 0 auto;
}

body.mobile-view .login-card-body {
  padding: 1.5rem;
}

/* Print - disable mobile styles */
@media print {
  body.mobile-view .main-sidebar,
  body.mobile-view .main-header,
  body.mobile-view .main-footer {
    display: block !important;
  }
}

/* === Media Queries - Always Apply === */

/* Extra small: phone */
@media (max-width: 576px) {
  .card {
    margin-bottom: 0.5rem;
  }

  .table td, .table th {
    padding: 0.4rem;
    font-size: 0.85rem;
  }

  .form-control {
    font-size: 16px;
    min-height: 44px;
  }

  .form-control-sm {
    font-size: 14px;
    min-height: 38px;
  }

  .dropdown-menu {
    min-width: 100% !important;
    right: 0;
    left: 0;
  }

  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.4em;
  }

  .main-footer {
    font-size: 0.75rem;
    padding: 0.5rem;
  }
}

/* Small: tablet */
@media (min-width: 577px) and (max-width: 768px) {
  .table td, .table th {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .form-control {
    font-size: 16px;
  }
}

/* Medium: small desktop */
@media (min-width: 769px) and (max-width: 992px) {
  .sidebar-mini.sidebar-collapse .main-sidebar {
    width: 250px;
  }
}

/* === Sidebar mobile overlay === */
@media (max-width: 768px) {
  .main-sidebar {
    box-shadow: none;
    transition: transform 0.3s ease;
  }

  .sidebar-open .main-sidebar {
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
  }

  .sidebar-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
  }
}

/* === Print styles === */
@media print {
  .main-sidebar,
  .main-header,
  .main-footer,
  .no-print {
    display: none !important;
  }

  .content-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  body.dark-mode .card,
  body.dark-mode .table,
  body.dark-mode .content-wrapper {
    background: #fff !important;
    color: #000 !important;
  }
}

/* ============================================
   MICRO-INTERACCIONES Y ANIMACIONES
   ============================================ */

/* === Keyframes === */
@keyframes slideInFromLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

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

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

@keyframes rippleEffect {
  to { transform: scale(4); opacity: 0; }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(25, 135, 84, 0); }
  100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); }
}

@keyframes underlineSlide {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes iconBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* === Nav-Tabs Micro-interacciones === */
.nav-tabs {
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

.nav-tabs .nav-item {
  margin-bottom: -2px;
}

.nav-tabs .nav-link {
  color: var(--text-secondary);
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem 0.5rem 0 0;
}

.nav-tabs .nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--brand-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
  border-radius: 3px 3px 0 0;
}

.nav-tabs .nav-link:hover {
  color: var(--brand-primary);
  background: rgba(25, 135, 84, 0.06);
  transform: translateY(-2px);
}

.nav-tabs .nav-link:hover::before {
  width: 60%;
  opacity: 0.5;
}

.nav-tabs .nav-link.active {
  color: var(--brand-primary);
  border-bottom-color: transparent;
  background: transparent;
  font-weight: 600;
}

.nav-tabs .nav-link.active::before {
  width: 100%;
  animation: underlineSlide 0.3s ease forwards;
}

.nav-tabs .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand-primary);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 -2px 8px rgba(25, 135, 84, 0.3);
}

/* Tab content animation */
.tab-content .tab-pane {
  animation: fadeInScale 0.3s ease;
}

.tab-content .tab-pane.active {
  animation: slideInFromBottom 0.35s ease;
}

/* === Sidebar Nav Micro-interacciones === */
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-radius: 0.5rem;
  margin: 2px 8px;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleX(0);
  width: 4px;
  height: 60%;
  background: var(--brand-primary-light);
  border-radius: 0 4px 4px 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link:hover {
  background: var(--bg-sidebar-hover);
  color: #fff !important;
  transform: translateX(4px);
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link:hover .nav-icon {
  animation: iconBounce 0.4s ease;
  color: var(--brand-primary-light);
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
  background: var(--brand-primary) !important;
  color: #fff !important;
  transform: translateX(0);
  box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active::before {
  transform: translateY(-50%) scaleX(1);
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active .nav-icon {
  color: #fff;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

/* Sidebar nav-header animation */
.sidebar-dark-primary .nav-header {
  animation: slideInFromLeft 0.3s ease;
  padding: 0.75rem 1rem 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 1px;
}

/* === Botones - Ripple Effect === */
.btn {
  position: relative;
  overflow: hidden;
}

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: rippleEffect 0.6s ease-out;
  pointer-events: none;
}

.btn-outline-primary .ripple,
.btn-outline-success .ripple,
.btn-outline-warning .ripple,
.btn-outline-info .ripple,
.btn-outline-dark .ripple {
  background: rgba(25, 135, 84, 0.2);
}

/* Quick access button animations */
.quick-access-btn {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-access-btn:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.quick-access-btn:hover i {
  animation: iconBounce 0.5s ease;
}

.quick-access-btn:active {
  transform: translateY(-2px) scale(0.98);
}

/* === Inputs - Focus Glow === */
.form-control {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.15), 0 0 20px rgba(25, 135, 84, 0.1);
  transform: translateY(-1px);
}

.form-control:hover:not(:focus) {
  border-color: var(--brand-primary-light);
}

/* Input group animations */
.input-group .form-control:focus + .input-group-append .input-group-text {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  transform: scale(1.05);
  transition: all 0.3s ease;
}

.input-group .input-group-text {
  transition: all 0.3s ease;
}

.input-group .input-group-text:hover {
  background: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
}

/* === Cards - Hover Lift === */
.card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
  transition: all 0.3s ease;
}

/* Card outline glow on hover */
.card-outline:hover {
  box-shadow: 0 0 20px rgba(25, 135, 84, 0.15);
}

.card-outline.card-success:hover {
  box-shadow: 0 0 20px rgba(40, 167, 69, 0.2);
  border-left-color: var(--brand-primary-light);
}

.card-outline.card-primary:hover {
  box-shadow: 0 0 20px rgba(13, 110, 253, 0.2);
}

.card-outline.card-warning:hover {
  box-shadow: 0 0 20px rgba(255, 193, 7, 0.2);
}

/* === Dropdown Notifications Animation === */
.dropdown-notificaciones {
  animation: slideInFromRight 0.3s ease;
}

.dropdown-notificaciones .dropdown-item {
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.dropdown-notificaciones .dropdown-item:hover {
  border-left-color: var(--brand-primary);
  padding-left: 1.25rem;
  background: rgba(25, 135, 84, 0.06);
}

/* === Badges Animation === */
.badge {
  transition: all 0.3s ease;
}

.badge:hover {
  transform: scale(1.1);
}

.badge-success:hover {
  box-shadow: 0 0 10px rgba(40, 167, 69, 0.4);
}

.badge-warning:hover {
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.4);
}

.badge-danger:hover {
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.4);
}

.badge-info:hover {
  box-shadow: 0 0 10px rgba(23, 162, 184, 0.4);
}

/* === Alert Animations === */
.alert {
  animation: slideInFromBottom 0.4s ease;
}

.alert-success {
  animation: slideInFromLeft 0.4s ease;
}

.alert-warning {
  animation: slideInFromLeft 0.4s ease;
}

.alert-danger {
  animation: shakeX 0.4s ease;
}

/* === Table Row Hover === */
.table-hover tbody tr {
  transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
  background: rgba(25, 135, 84, 0.06);
  transform: scale(1.005);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* === Select Dropdown Animation === */
select.form-control {
  transition: all 0.3s ease;
}

select.form-control:hover {
  border-color: var(--brand-primary-light);
}

/* === Brand Logo Animation === */
.brand-link {
  transition: all 0.3s ease;
}

.brand-link:hover .brand-text {
  color: #fff !important;
  text-shadow: 0 0 10px rgba(32, 201, 151, 0.5);
  letter-spacing: 2px;
}

/* === Scroll Animations === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.content-wrapper > .content > .container-fluid > .row,
.content-wrapper > .content > .container-fluid > .card {
  animation: fadeInUp 0.5s ease;
}

/* === Page Header Animation === */
.content-header h1 {
  animation: slideInFromLeft 0.4s ease;
}

/* === Loading Spinner === */
.btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* === Toast Animation === */
.toast-notification {
  animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-notification.toast-exit {
  animation: slideOutToRight 0.3s ease forwards;
}

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

/* === Print - Disable Animations === */
@media print {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
