/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #eef1f8;
  color: #1f2933;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: #2563eb;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background: linear-gradient(160deg, #102a43 0%, #243b53 40%, #1b1f3a 100%);
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  background: rgba(12, 25, 51, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  position: sticky;
  top: 0;
}

/* Sidebar scrollbar styling */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.sidebar-header {
  margin-bottom: 2.5rem;
}

/* Sidebar close button (hidden on desktop, shown on mobile) */
.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s ease;
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-close-btn span {
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  display: block;
}

/* Mobile combined footer (hidden on desktop, shown on mobile) */
.sidebar-mobile-footer {
  display: none;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.sidebar-footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-language-switch {
  display: flex;
  gap: 0.5rem;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #f8fafc;
  gap: 0.75rem;
}

.sidebar-brand img {
  max-height: 90px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  color: rgba(241, 245, 249, 0.76);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
  color: #ffffff;
  transform: translateX(4px);
}

.nav-link.active {
  background: linear-gradient(135deg, #46aef7 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.35);
}

.sidebar-footer {
  margin-top: auto;
  margin-bottom: 3rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  color: rgba(226, 232, 240, 0.8);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sidebar-user {
  font-weight: 600;
  color: #e0e7ff;
}

.sidebar-signout {
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.9);
}

.sidebar-signout:hover {
  color: #ffffff;
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f8fafc 0%, #eef1f8 100%);
  height: 100vh;
  overflow-y: auto;
}

/* Dashboard main scrollbar styling */
.dashboard-main::-webkit-scrollbar {
  width: 8px;
}

.dashboard-main::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.dashboard-main::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.dashboard-main::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #1f2933;
  text-transform: uppercase;
}

.topbar-client-name {
  font-weight: 600;
  color: #2563eb;
  text-transform: none;
  font-size: 1rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.language-switch {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.language-link {
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #475569;
  background: rgba(148, 163, 184, 0.12);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.language-link:hover {
  color: #1d4ed8;
  border-color: rgba(99, 102, 241, 0.3);
}

.language-link.active {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.15);
  color: #1d4ed8;
  font-weight: 600;
}

.auth-layout .language-link {
  color: rgba(226, 232, 240, 0.85);
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.12);
}

.auth-layout .language-link:hover {
  color: #ffffff;
  border-color: rgba(148, 163, 184, 0.35);
}

.auth-layout .language-link.active {
  color: #ffffff;
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.25);
}

.impersonation-banner {
  margin: 0 2rem;
  margin-top: 1rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.08) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 10px;
  padding: 0.9rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #1e3a8a;
  font-weight: 600;
}

.impersonation-stop {
  color: #1d4ed8;
  font-weight: 600;
}

.content-wrapper {
  padding: 2rem;
  overflow: visible;
}

.content-area {
  max-width: 1200px;
  margin: 0 auto;
  overflow: visible;
}

.flash {
  padding: 0.9rem 1.2rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  animation: slideDown 0.3s ease-out;
}

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

.auth-layout .flash {
  max-width: 600px;
  margin: 1rem auto 1.5rem;
  text-align: center;
}

.flash.notice,
.flash.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
  color: #047857;
}

.flash.alert,
.flash.error {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.15), rgba(248, 113, 113, 0.08));
  color: #b91c1c;
}

.flash.warning {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(252, 211, 77, 0.1));
  color: #b45309;
}

.card {
  background-color: #ffffff;
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: 0 35px 60px -25px rgba(15, 23, 42, 0.25);
  margin-bottom: 1.75rem;
  border: 1px solid rgba(226, 232, 240, 0.6);
  overflow: visible;
  position: relative;
  z-index: 0;
}

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

.table th,
.table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  text-align: left;
  font-size: 0.95rem;
}

.table th {
  background: rgba(226, 232, 240, 0.45);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 18px 30px -15px rgba(37, 99, 235, 0.6);
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 35px -12px rgba(79, 70, 229, 0.5);
  text-decoration: none;
}

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

.button.secondary {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  box-shadow: 0 16px 28px -14px rgba(71, 85, 105, 0.45);
}

.button.danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 16px 28px -14px rgba(220, 38, 38, 0.45);
}

.button.outline {
  background: transparent;
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.4);
  box-shadow: none;
}

.button.outline:hover {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(59, 130, 246, 0.25));
  border-color: rgba(37, 99, 235, 0.5);
}

.button.danger:hover {
  box-shadow: 0 20px 32px -14px rgba(220, 38, 38, 0.55);
}

.button_to {
  display: inline;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #334155;
}

.form-group label.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

.form-group label.checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(203, 213, 225, 0.8);
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.7);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

/* Date picker fix */
.form-group {
  position: relative;
  z-index: 1;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.form-group input[type="date"] {
  position: relative;
  z-index: 2;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.form-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  z-index: 0;
}

.form-error {
  color: #b91c1c;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.auth-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: radial-gradient(circle at top left, #1e3a8a 0%, #111827 65%), linear-gradient(180deg, #1f2937, #0f172a);
}

.auth-language-switch {
  margin-bottom: 1.5rem;
}

.login-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.login-card {
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 2.75rem;
  width: min(420px, 95%);
  box-shadow: 0 40px 90px -35px rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(14px);
}

.login-card h2 {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
  text-align: center;
  font-size: 1.9rem;
  color: #0f172a;
}

.brand-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.brand-login img {
  max-width: 220px;
}

.badge {
  display: inline-flex;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.card h1,
.card h2,
.card h3 {
  margin-top: 0;
  color: #1f2933;
}

/* Drag and Drop Styles */
.drag-drop-area {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  background-color: #f8fafc;
  transition: all 0.3s ease;
  cursor: pointer;
}

.drag-drop-area:hover {
  border-color: #3b82f6;
  background-color: #eff6ff;
}

.drag-drop-area.drag-over {
  border-color: #2563eb;
  background-color: #dbeafe;
  border-style: solid;
}

.drag-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.drag-drop-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: #334155;
  margin: 0;
}

.drag-drop-hint {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

.file-input-hidden {
  display: none;
}

.file-list {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: #f1f5f9;
  border-radius: 8px;
}

.file-list ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}

.file-list li {
  padding: 0.5rem;
  background-color: white;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-list li:last-child {
  margin-bottom: 0;
}

.card p {
  color: #52606d;
  line-height: 1.6;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 200px 1fr;
  }

  .sidebar {
    padding: 1.5rem 1rem;
  }

  .sidebar-brand {
    font-size: 1.2rem;
  }

  .nav-link {
    font-size: 0.9rem;
    padding: 0.65rem 0.85rem;
  }

  .topbar {
    padding: 1rem 1.5rem;
  }

  .content-wrapper {
    padding: 1.5rem;
  }
}

/* Mobile Landscape / Small Tablet (481px - 767px) */
@media (max-width: 767px) {
  .dashboard-layout {
    grid-template-columns: 180px 1fr;
  }

  .sidebar {
    padding: 1rem 0.75rem;
  }

  .sidebar-brand {
    font-size: 1rem;
    justify-content: center;
  }

  .sidebar-brand img {
    max-height: 100%;
    max-width: 100%;
  }

  .sidebar-header {
    margin-bottom: 1.5rem;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
    gap: 0.5rem;
  }

  .sidebar-footer {
    padding: 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 2rem;
  }

  .topbar {
    padding: 1rem;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }

  .topbar-title {
    font-size: 1.1rem;
  }

  .content-wrapper {
    padding: 1rem;
  }

  .content-area {
    padding: 1rem;
  }

  /* Adjust grids */
  .year-grid,
  .month-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

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

  .table {
    font-size: 0.9rem;
  }

  .table th,
  .table td {
    padding: 0.75rem 0.5rem;
  }

  /* Cards */
  .card {
    padding: 1.25rem;
  }

  .card h2 {
    font-size: 1.3rem;
  }
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: #1f2933;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Sidebar Overlay */
.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

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

/* Mobile Portrait (320px - 480px) */
@media (max-width: 480px) {
  body {
    overflow-x: hidden;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }

  /* Show mobile menu button */
  .mobile-menu-btn {
    display: flex;
  }

  .mobile-sidebar-overlay {
    display: block;
  }

  /* Fixed topbar on mobile */
  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .topbar-title {
    font-size: 0.85rem;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100vw - 120px);
  }

  .topbar-client-name {
    font-size: 0.8rem;
    display: block;
    margin-top: 0.15rem;
  }

  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
  }

  /* Hide topbar language switcher on mobile */
  .topbar .language-switch {
    display: none;
  }

  /* Show combined mobile footer on mobile */
  .sidebar-mobile-footer {
    display: block;
  }

  /* Hide regular sidebar footer on mobile */
  .sidebar-footer {
    display: none;
  }

  /* User info styling in mobile footer */
  .sidebar-mobile-footer .sidebar-user {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e0e7ff;
  }

  .sidebar-mobile-footer .sidebar-signout {
    font-size: 0.9rem;
    color: rgba(252, 165, 165, 0.9);
    transition: color 0.2s ease;
  }

  .sidebar-mobile-footer .sidebar-signout:hover {
    color: #fca5a5;
  }

  /* Language switcher styling in mobile footer */
  .sidebar-mobile-footer .sidebar-language-switch {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
  }

  .sidebar-mobile-footer .language-link {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  .sidebar-mobile-footer .language-link.active {
    background: rgba(70, 174, 247, 0.3);
    border-color: rgba(70, 174, 247, 0.5);
    color: #ffffff;
  }

  /* Sidebar slides from right */
  .sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    max-height: 100vh;
    padding: 1rem;
    background: rgba(12, 25, 51, 0.98);
    z-index: 1000;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.3);
  }

  .sidebar.active {
    right: 0;
  }

  /* Show close button on mobile */
  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-header {
    margin-bottom: -0.5rem;
  }

  .sidebar-brand {
    font-size: 1.2rem;
  }

  .sidebar-brand img {
    max-height: 100%;
    width: 100%;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav-link {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    text-align: left;
    justify-content: flex-start;
  }

  .sidebar-footer {
    margin-top: auto;
    margin-bottom: 1rem;
    padding: 0.75rem;
  }

  .sidebar-user {
    font-size: 0.9rem;
  }

  .sidebar-signout {
    font-size: 0.9rem;
  }

  /* Main content with proper scrolling */
  .dashboard-main {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 56px; /* Height of fixed topbar */
    -webkit-overflow-scrolling: touch;
  }

  .content-wrapper {
    padding: 0.75rem;
    overflow: visible;
    position: relative;
    z-index: 1;
  }

  .content-area {
    padding: 0.75rem;
    overflow: visible;
    position: relative;
    z-index: 1;
  }

  /* Full width cards */
  .card {
    padding: 1rem;
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
  }

  .card h2 {
    font-size: 1.2rem;
  }

  /* Force single column grid on mobile */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Fix reports page layout on mobile */
  .form-actions {
    flex-direction: column !important;
    gap: 1rem !important;
    align-items: stretch !important;
  }

  .form-actions > div {
    width: 100%;
  }

  /* Stack form and button vertically on mobile */
  .form-actions > div[style*="display:flex"],
  .form-actions > div[style*="display: flex"] {
    flex-direction: column !important;
    gap: 1rem !important;
    align-items: center !important;
  }

  .form-actions form {
    width: 100%;
    order: -1; /* Place form first */
  }

  .form-actions .button {
    width: 50% !important;
    order: 1; /* Place button second */
  }

  .form-actions .form-group {
    margin: 0 !important;
  }

  /* Ensure month grid buttons work on mobile */
  .card .button {
    width: 85%;
    min-height: 48px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    white-space: normal;
    text-align: center;
    margin: 0 auto;
  }

  /* Buttons */
  .button {
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
    min-height: 44px;
    touch-action: manipulation;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Forms */
  .form-group label {
    font-size: 0.9rem;
  }

  .form-control {
    font-size: 0.9rem;
    padding: 0.6rem;
  }

  /* Tables on mobile */
  .table {
    font-size: 0.85rem;
  }

  .table th,
  .table td {
    padding: 0.5rem 0.25rem;
  }
}

/* Very small mobile (< 360px) */
@media (max-width: 359px) {
  .sidebar-brand {
    font-size: 0.95rem;
  }

  .nav-link {
    font-size: 0.75rem;
    padding: 0.5rem;
  }

  .topbar-title {
    font-size: 0.95rem;
  }

  .card h2 {
    font-size: 1.1rem;
  }
}
