/* ==================== ETELMIR MOBILE ==================== */

:root {
  --ask-bg: #000000;
  --ask-surface: rgba(255, 255, 255, 0.05);
  --ask-surface-2: rgba(255, 255, 255, 0.08);
  --ask-border: rgba(255, 255, 255, 0.10);
  --ask-border-2: rgba(255, 255, 255, 0.14);
  --ask-muted: rgba(255, 255, 255, 0.60);
  --ask-muted-2: rgba(255, 255, 255, 0.45);
  --ask-accent: #3b82f6;
  --ask-accent-2: #60a5fa;
  --ask-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(1200px 800px at 15% -10%, rgba(59, 130, 246, 0.18), transparent 55%),
    radial-gradient(900px 600px at 85% 10%, rgba(96, 165, 250, 0.10), transparent 55%),
    var(--ask-bg);
}

#accounting-executive-panels > section:first-child,
#page-admin > div > div:nth-of-type(3),
#page-admin > div > div:nth-of-type(4) > section:first-child {
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(15, 23, 42, 0.35)),
    rgba(255, 255, 255, 0.05);
}

#accounting-profile-summary > div,
#accounting-books > div,
#admin-client-dashboard > div {
  backdrop-filter: blur(10px);
}

#accounting-upload-file,
#admin-chart-upload-file {
  min-height: 48px;
}

input,
textarea,
select,
button {
  max-width: 100%;
}

.ask-card,
.nav-item {
  min-width: 0;
}

.nav-item {
  position: relative;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

#sidebar {
  transition: width 180ms ease, transform 180ms ease, padding 180ms ease;
}

.sidebar-copy,
.nav-label,
.sidebar-account-meta,
.sidebar-account-grid {
  transition: opacity 140ms ease, transform 180ms ease;
}

body.sidebar-collapsed #sidebar {
  width: 5.5rem !important;
}

body.sidebar-collapsed #sidebar .sidebar-copy,
body.sidebar-collapsed #sidebar .nav-label,
body.sidebar-collapsed #sidebar .sidebar-account-meta,
body.sidebar-collapsed #sidebar .sidebar-account-grid {
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed #sidebar .sidebar-copy,
body.sidebar-collapsed #sidebar .nav-label {
  transform: translateX(-6px);
}

body.sidebar-collapsed #sidebar nav {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

body.sidebar-collapsed #sidebar .nav-item {
  justify-content: center;
  gap: 0;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

body.sidebar-collapsed #sidebar .nav-item[aria-current="page"]::before {
  left: 50%;
  top: auto;
  bottom: 6px;
  width: 24px;
  height: 2px;
  transform: translateX(-50%);
}

body.sidebar-collapsed #sidebar .sidebar-account {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

body.sidebar-collapsed #sidebar .sidebar-toggle-icon {
  transform: rotate(180deg);
}

.swal2-popup.asktel-swal-popup {
  border: 1px solid var(--ask-border-2);
  border-radius: 1.25rem;
  background:
    radial-gradient(140% 160% at 0% 0%, rgba(59, 130, 246, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(10, 10, 10, 0.99));
  color: #f5f5f5;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.swal2-title.asktel-swal-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.swal2-html-container.asktel-swal-html,
.swal2-input-label.asktel-swal-input-label {
  color: rgba(255, 255, 255, 0.72);
}

.swal2-input.asktel-swal-input {
  border: 1px solid var(--ask-border-2) !important;
  border-radius: 0.9rem !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f5f5f5 !important;
  box-shadow: none !important;
}

.swal2-input.asktel-swal-input:focus {
  border-color: rgba(96, 165, 250, 0.8) !important;
}

.swal2-confirm.asktel-swal-confirm,
.swal2-cancel.asktel-swal-cancel {
  border-radius: 0.9rem !important;
  font-weight: 700 !important;
}

.swal2-confirm.asktel-swal-confirm {
  background: linear-gradient(135deg, var(--ask-accent), var(--ask-accent-2)) !important;
}

.swal2-cancel.asktel-swal-cancel {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f5f5f5 !important;
}

.swal2-popup.asktel-swal-toast {
  border: 1px solid var(--ask-border);
  border-radius: 1rem;
  background: rgba(12, 12, 12, 0.92);
  color: #f5f5f5;
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.nav-item[aria-current="page"] {
  background: var(--ask-surface);
  border-color: var(--ask-border);
}

.nav-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--ask-accent), var(--ask-accent-2));
  opacity: 0.95;
}

.nav-item:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 2px;
}

select option,
select optgroup {
  color: #0a0a0a;
  background-color: #ffffff;
}

.ask-card {
  background: var(--ask-surface);
  border: 1px solid var(--ask-border);
  box-shadow: var(--ask-shadow);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #404040;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  body {
    overflow: auto !important;
  }

  #page-chat > div {
    height: auto !important;
  }

  #chat-messages {
    padding-bottom: calc(1rem + 140px);
  }

  .chat-input-mobile {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    background: rgba(45, 45, 45, 0.98) !important;
    border-top: 1px solid #404040 !important;
    padding: 0.75rem !important;
    padding-bottom: calc(0.75rem + 40px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #chat-input {
    font-size: 16px !important;
  }
}

@media (max-width: 480px) {
  html, body {
    overflow-x: hidden;
  }

  .chat-input-mobile > .max-w-5xl {
    flex-direction: column;
    align-items: stretch;
  }

  #send-button {
    width: 100%;
  }

  #page-chat header .max-w-5xl > div:last-child > div:nth-child(1),
  #page-chat header .max-w-5xl > div:last-child > div:nth-child(2),
  #page-chat header label {
    display: none !important;
  }
  #send-button {
    padding: 0.6rem 0.9rem !important;
    font-size: 0.9rem !important;
    border-radius: 0.9rem !important;
  }
  #chat-input {
    line-height: 1.35 !important;
  }
}

@media (max-width: 767px) {
  #chat-messages {
    padding-right: 0.25rem;
  }
  #page-chat .max-w-5xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  #page-chat .chat-input-mobile .max-w-5xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  #sidebar {
    width: 14rem;
  }
  #page-history .grid {
    grid-template-columns: 14rem 1fr;
  }
  #page-chat .max-w-5xl,
  #page-docs .max-w-5xl,
  #page-admin .max-w-5xl,
  #page-account .max-w-md,
  #page-login .max-w-md,
  #page-register .max-w-md {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (min-width: 1024px) and (max-width: 1439px) {
  #sidebar {
    width: 16rem;
  }
  #page-history .grid {
    grid-template-columns: 16rem 1fr;
  }
}

@media (min-width: 1440px) and (max-width: 1919px) {
  #page-history .grid {
    grid-template-columns: 18rem 1fr;
  }
}

@media (min-width: 1920px) {
  #page-chat header .max-w-5xl,
  #page-chat .max-w-5xl {
    max-width: 80rem;
  }
  #page-history .max-w-6xl {
    max-width: 88rem;
  }
  #page-admin .max-w-5xl {
    max-width: 80rem;
  }
}
