/* Reset & Base */
*{box-sizing:border-box;margin:0;padding:0}
html,body{
  height:100%;
  /* Prefer Geist Mono if available, fall back to other monospace fonts */
  font-family: 'Geist Mono', 'Courier New', Courier, monospace;
  font-size:16px;
  background:#fff;
  color:#111;
}

/* App Bar - matches mobile */
.app-bar{
  display:flex;
  align-items:center;
  padding:12px 16px;
  background:#fff;
  border-bottom:1px solid #f0f0f0;
  position:sticky;
  top:0;
  z-index:100;
}
.menu-btn{
  width:40px;
  height:40px;
  background:transparent;
  color:#111;
  border:none;
  border-radius:10px;
  font-size:28px;
  cursor:pointer;
}
.app-bar h1{
  flex:1;
  text-align:center;
  font-size:26px;
  font-weight:400;
  letter-spacing:0.5px;
}

/* Loading */
.loading{padding:40px;text-align:center;color:#888}

/* Date Selector - horizontal scroll with pills */
#date-selector{
  display:flex;
  gap:10px;
  padding:16px;
  overflow-x:auto;
  background:#fff;
  -webkit-overflow-scrolling:touch;
}
#date-selector::-webkit-scrollbar{display:none}

.date-pill{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-width:56px;
  height:70px;
  padding:10px 12px;
  background:#fff;
  border:1px solid #e0e0e0;
  border-radius:12px;
  font-size:11px;
  font-weight:600;
  color:#9b9b9b;
  letter-spacing:0.5px;
  cursor:pointer;
  flex-shrink:0;
}
.date-pill .day-number{
  font-size:20px;
  font-weight:700;
  color:#111;
  margin-top:4px;
}
.date-pill.active{
  background:#000;
  border-color:#000;
  color:#fff;
}
.date-pill.active .day-number{
  color:#fff;
}

/* Arqueo List */
#lista{
  background:#fff;
}

.arqueo-item{
  display:flex;
  align-items:center;
  padding:18px 20px;
  border-bottom:1px solid #f5f5f5;
  cursor:pointer;
  transition:background 0.15s;
}
.arqueo-item:hover,.arqueo-item:active{
  background:#fafafa;
}

.caja-name{
  flex:1;
  font-size:14px;
  font-weight:400;
  letter-spacing:2px;
  color:#111;
  text-transform:uppercase;
}

.amount{
  font-size:15px;
  font-weight:700;
  color:#111;
  margin-right:8px;
}

.chevron{
  font-size:20px;
  color:#ccc;
  font-weight:300;
}

/* Empty / Error states */
.empty,.error{
  padding:40px 20px;
  text-align:center;
  color:#888;
}
.error{color:#c00}

/* Detail Panel - full screen slide-in like mobile endDrawer */
.detail-panel{
  position:fixed;
  top:0;
  right:-100%;
  width:100%;
  height:100%;
  background:#fff;
  z-index:200;
  transition:right 0.3s ease;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
}
.detail-panel.open{
  right:0;
}

.detail-header{
  display:flex;
  align-items:center;
  padding:12px 16px;
  background:#fff;
  position:sticky;
  top:0;
  z-index:10;
}

.close-btn{
  width:40px;
  height:40px;
  background:none;
  border:none;
  font-size:24px;
  cursor:pointer;
  color:#111;
  display:flex;
  align-items:center;
  justify-content:center;
}

.detail-body{
  flex:1;
  padding:24px 16px;
  overflow-y:auto;
  display:flex;
  justify-content:center;
  align-items:flex-start;
}

/* Receipt text - monospace like mobile FittedBox with texto_original */
.receipt{
  font-family:'Courier New', Courier, monospace;
  font-size:15px;
  line-height:1.45;
  white-space:pre; /* preserve exact receipt formatting */
  overflow-x:auto;
  max-width:760px; /* limit width and center */
  width:100%;
  box-sizing:border-box;
  margin:0 8px 48px; /* bottom spacing */
  color:#111;
  background:#fff;
}


/* Responsive */
@media(min-width:768px){
  .app-bar h1{font-size:20px}
  .arqueo-item{padding:20px 24px}
  .caja-name{font-size:15px}
  .amount{font-size:16px}
}
/* ============================================
   Firesoft Sede - HTMX App Styles
   Clean, minimal, mobile-first design
   ============================================ */

:root {
  /* Colors */
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-secondary: #64748b;
  --color-success: #22c55e;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;

  /* Neutrals */
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #1e293b;
  --color-text-muted: #64748b;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Sizing */
  --sidebar-width: 250px;
  --detail-panel-width: 400px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ============================================
   Authentication Pages
   ============================================ */

.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-md);
}

.auth-card {
  background: var(--color-surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 400px;
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-header h1 {
  font-size: 1.75rem;
  margin-bottom: var(--space-xs);
}

.auth-header p {
  color: var(--color-text-muted);
}

.auth-footer {
  margin-top: var(--space-xl);
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ============================================
   Forms
   ============================================ */

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  font-size: 0.875rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
  color: var(--color-text-muted);
}

.hidden {
  display: none !important;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn-primary {
  background-color: var(--color-primary);
  color: white;
  width: 100%;
}

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

.btn-secondary {
  background-color: var(--color-border);
  color: var(--color-text);
}

.btn-secondary:hover {
  background-color: #cbd5e1;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-xs);
  color: var(--color-text-muted);
}

/* HTMX Loading Indicator */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline;
}

.htmx-request.htmx-indicator {
  display: inline;
}

/* ============================================
   App Layout (Dashboard)
   ============================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.sidebar-header h2 {
  font-size: 1.25rem;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: 8px;
  color: var(--color-text);
  text-decoration: none;
  transition: background-color var(--transition-fast);
  margin-bottom: var(--space-xs);
}

.nav-item:hover {
  background-color: var(--color-bg);
}

.nav-item.active {
  background-color: var(--color-primary);
  color: white;
}

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

.sidebar-footer .btn {
  width: 100%;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: var(--space-xl);
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.content-header h1 {
  font-size: 1.5rem;
}

/* Detail Panel */
.detail-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: var(--detail-panel-width);
  height: 100vh;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: right var(--transition-normal);
  overflow-y: auto;
}

.detail-panel.open {
  right: 0;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-surface);
}

.detail-header h3 {
  flex: 1;
}

#detail-content {
  padding: var(--space-lg);
}

/* ============================================
   Data Display
   ============================================ */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table th,
.data-table td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  background: var(--color-bg);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

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

/* Cards */
.card {
  background: var(--color-surface);
  border-radius: 12px;
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.card-title {
  font-weight: 600;
  font-size: 1.125rem;
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

/* Loading State */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--color-text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--color-text-muted);
}

.empty-state p {
  margin-bottom: var(--space-md);
}

/* Alerts */
.alert {
  padding: var(--space-md);
  border-radius: 8px;
  margin-bottom: var(--space-md);
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }

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

  .main-content {
    margin-left: 0;
    padding: var(--space-md);
  }

  .detail-panel {
    max-width: 100%;
  }

  .data-table {
    display: block;
    overflow-x: auto;
  }

  .content-header {
    flex-direction: column;
    gap: var(--space-md);
    align-items: flex-start;
  }
}
