:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --surface-color: rgba(255, 255, 255, 0.9);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    position: relative;
    padding-bottom: 80px;
    /* Space for footer */
}

/* Header */
.app-header {
    background-color: var(--surface-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.header-left {
    display: flex;
    justify-content: flex-start;
}

.header-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
}

.date-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex: 1;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    /* Adding a subtle glow to make it pop */
    filter: drop-shadow(0 0 4px rgba(37, 99, 235, 0.2));
}

.header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
}

.date-nav-widget {
    background-color: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
}

#display-date {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    min-width: 80px;
    text-align: center;
}

#current-date {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-primary);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn-small {
    background: white;
    border: 1px solid var(--border-color);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.icon-btn-small:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.icon-btn.highlight {
    color: var(--success-color);
}

/* Summary Card */
.summary-card {
    background-color: #0D1B3E;
    color: white;
    padding: 2.25rem 1.5rem;
    border-radius: 1.25rem;
    margin: 1rem;
    text-align: center;
    box-shadow: 0 8px 24px -4px rgba(13, 27, 62, 0.4);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.card-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.wave {
    position: absolute;
    background: #1E3A6E;
    border-radius: 50%;
    opacity: 0.25;
    filter: blur(25px);
}

.wave:nth-child(1) {
    width: 250px;
    height: 180px;
    bottom: -80px;
    left: -40px;
    animation: animation-drift 8s infinite alternate ease-in-out;
}

.wave:nth-child(2) {
    width: 200px;
    height: 140px;
    top: -40px;
    right: -20px;
    animation: animation-drift 12s infinite alternate-reverse ease-in-out;
    opacity: 0.15;
}

.wave:nth-child(3) {
    width: 300px;
    height: 200px;
    bottom: -60px;
    right: -60px;
    animation: animation-drift 15s infinite alternate ease-in-out;
    opacity: 0.2;
}

.shimmer {
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: skewX(-25deg);
    animation: animation-shimmer 7s infinite;
}

@keyframes animation-drift {
    0%   { transform: translateX(0) scaleY(1); }
    100% { transform: translateX(35px) scaleY(1.15); }
}

@keyframes animation-shimmer {
    0%   { left: -150%; }
    40%, 100% { left: 150%; }
}

.total-count {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.total-count-label {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.total-value-secondary {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    background: transparent;
    padding: 0;
    border-radius: 0;
    backdrop-filter: none;
}

.total-details {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 0 1rem 1rem 1rem;
}

.stat-item {
    background-color: #ffffff;
    padding: 1.2rem 0.5rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    border-top: 3px solid transparent;
}

.stat-item i {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.stat-item span {
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.2;
}

.stat-item small {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

/* Alerts Badge */
#alerts-btn {
    position: relative;
}

#alerts-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none; /* Inicia escondido */
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Stat Card Colors */
.stat-total {
    border-top-color: #e67e22;
}

.stat-total i,
.stat-total span {
    color: #e67e22;
}

.stat-unique {
    border-top-color: #2ecc71;
}

.stat-unique i,
.stat-unique span {
    color: #2ecc71;
}

.stat-repeated {
    border-top-color: #e74c3c;
}

.stat-repeated i,
.stat-repeated span {
    color: #e74c3c;
}

.categories-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 1rem 1rem 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    justify-content: center;
}

.cat-pill {
    background-color: var(--surface-color);
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
}

/* Action Area */
.action-area {
    margin: 0 1rem 1.5rem 1rem;
}

.primary-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.1s;
}

.primary-btn:active {
    transform: scale(0.98);
}

.secondary-btn {
    width: 100%;
    background-color: var(--surface-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.1s;
}

.secondary-btn:active {
    transform: scale(0.98);
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.divider {
    text-align: center;
    color: var(--text-secondary);
    margin: 1rem 0;
    font-size: 0.875rem;
    position: relative;
}

.mb-1 {
    margin-bottom: 1rem;
}

.date-range-inputs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.date-range-inputs .input-group {
    margin-bottom: 0;
    flex: 1;
}

.date-range-inputs input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* Order List */
.order-list-section {
    flex: 1;
    background-color: var(--surface-color);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    padding: 1.5rem 1rem;
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.badge {
    background-color: var(--border-color);
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background-color: #fcfdfe;
    border-radius: var(--radius-md);
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s;
}

.order-item:hover {
    transform: translateX(4px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
    background-color: white;
}

.order-info {
    flex: 1;
}

.order-address {
    font-weight: 500;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-ok {
    background-color: var(--success-color);
}

.status-repeated {
    background-color: var(--danger-color);
}

.order-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* .order-time inherits from .order-meta — no special styling needed */

.repeated-badge {
    background-color: #fee2e2;
    color: var(--danger-color);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Cancelled Order Styles */
.order-item.cancelled {
    background-color: rgba(239, 68, 68, 0.06);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin: -0.25rem;
    opacity: 0.7;
}

.status-cancelled {
    background-color: #9ca3af;
}

.address-cancelled {
    text-decoration: line-through;
    color: var(--danger-color);
    opacity: 0.75;
}

.cancelled-badge {
    background-color: #fef2f2;
    color: #dc2626;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.text-deleted {
    text-decoration: line-through;
    opacity: 0.5;
}

/* Observations Modal Cards */
.obs-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.obs-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.obs-card-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.obs-icon-discount {
    color: #f59e0b;
    font-size: 1rem;
}

.obs-icon-cancel {
    color: #ef4444;
    font-size: 1rem;
}

.obs-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.obs-form-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.obs-input {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--bg-color);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.obs-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.obs-input-sm {
    flex: 1;
    min-width: 0;
}

.obs-input-with-prefix {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-color);
    overflow: hidden;
}

.obs-prefix {
    padding: 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.obs-input-with-prefix .obs-input {
    border: none;
    background: transparent;
    padding-left: 0;
    flex: 1;
}

.obs-input-with-prefix .obs-input:focus {
    outline: none;
}

.obs-add-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: transform 0.1s, background 0.2s;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.obs-add-btn:active {
    transform: scale(0.92);
}

.obs-add-btn:hover {
    background: var(--primary-dark);
}

.obs-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0 0;
}

.obs-list:empty {
    display: none;
}

.obs-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
}

.obs-list-item:last-child {
    border-bottom: none;
}

.obs-item-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.obs-item-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.obs-badge-discount {
    background: #fef3c7;
    color: #92400e;
}

.obs-badge-cancel {
    background: #fee2e2;
    color: #dc2626;
}

.obs-item-text {
    font-size: 0.82rem;
    color: var(--text-primary);
    word-break: break-word;
}

.obs-item-reason {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.obs-item-delete {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 50%;
    font-size: 0.8rem;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.obs-item-delete:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.order-actions {
    display: flex;
    gap: 0.5rem;
}

/* Footer */
.app-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.developer-credit {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0.8;
}

.developer-credit strong {
    color: var(--primary-color);
    font-weight: 600;
}

.text-btn {
    background: none;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.text-btn.danger {
    color: var(--danger-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    /* Sheet style on mobile */
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--surface-color);
    width: 100%;
    max-width: 480px;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    padding: 1.5rem;
    animation: slideUp 0.3s ease-out;
}

.modal-content.full-screen {
    height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    resize: none;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.cat-btn {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-btn.selected {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.full-width {
    width: 100%;
}

.warning-box {
    background-color: #fff7ed;
    color: var(--warning-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.warning-box.hidden {
    display: none;
}

/* Purple Alert */
.warning-box.alert-purple {
    background-color: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #d8b4fe;
}

body.dark-mode .warning-box.alert-purple {
    background-color: rgba(147, 51, 234, 0.15);
    color: #d8b4fe;
    border-color: rgba(147, 51, 234, 0.3);
}

/* Camera UI */
.camera-viewport {
    flex: 1;
    background-color: black;
    position: relative;
    overflow: hidden;
    margin: -1.5rem -1.5rem 0 -1.5rem;
    /* Fullbleed */
}

#camera-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    aspect-ratio: 1;
    max-width: 280px;
    max-height: 280px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
    transition: border-color 0.3s;
}

.scan-overlay.active {
    animation: scan-pulse 2s ease-in-out infinite;
}

@keyframes scan-pulse {

    0%,
    100% {
        border-color: rgba(255, 255, 255, 0.4);
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45), 0 0 20px rgba(74, 108, 247, 0);
    }

    50% {
        border-color: rgba(74, 108, 247, 0.9);
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45), 0 0 30px rgba(74, 108, 247, 0.3);
    }
}

/* Scan Status Indicator */
.scan-status {
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.3s, background 0.3s;
    min-height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.scan-status.scanning {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(74, 108, 247, 0.15);
    animation: status-blink 1.5s ease-in-out infinite;
}

.scan-status.found {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
}

.scan-status.error {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

@keyframes status-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.camera-hint {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.82rem;
}

/* Search Bar */
.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#search-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s, transform 0.3s;
    min-width: 300px;
    justify-content: space-between;
}

.toast-container.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
    pointer-events: none;
}

.toast-action {
    background: none;
    border: none;
    color: var(--warning-color);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* Address Input with Floating Actions */
/* Address Field (Mobile First) */
.address-field-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0.5rem;
}

.address-textarea {
    width: 100%;
    resize: none;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.5;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--input-bg, #fff);
    transition: border-color 0.2s;
}

.address-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.address-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    /* Fixed height to prevent layout shift */
}

.action-btn-group {
    display: flex;
    gap: 8px;
    margin-left: auto;
    /* Push to right if clear btn is missing */
}

/* Base Action Button */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.action-btn:active {
    transform: scale(0.95);
}

/* Clear Button */
.btn-clear {
    background: var(--danger-light, #fdecea);
    color: var(--danger-color, #e53935);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.btn-clear:hover {
    background: var(--danger-color, #e53935);
    color: #fff;
}

/* Icon Buttons (Voice & Camera) */
.btn-voice,
.btn-camera {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface-secondary, #f0f0f0);
    color: var(--text-secondary);
    font-size: 15px;
    justify-content: center;
}

.btn-voice:hover,
.btn-camera:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Recording State */
.btn-voice.recording {
    background: var(--danger-color, #e53935);
    color: #fff;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(229, 57, 63, 0.4);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(229, 57, 53, 0);
    }
}



.mic-status {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--danger-color);
    font-weight: 500;
    animation: mic-blink 1s ease-in-out infinite;
}

.mic-status.hidden {
    display: none;
}

@keyframes mic-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Export Dashboard */
.summary-hero {
    background: linear-gradient(135deg, #2d3a8c, #4a6cf7);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    color: #fff;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.summary-hero-label {
    font-size: 13px;
    opacity: 0.9;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.summary-hero-value {
    font-size: 38px;
    font-weight: 700;
    display: block;
    margin: 8px 0;
}

.summary-hero-period {
    font-size: 13px;
    opacity: 0.8;
    display: block;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.summary-card-dashboard {
    background: var(--surface-color, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

body.dark-mode .summary-card-dashboard {
    background: var(--surface-color);
    border-color: var(--border-color);
}

.summary-card-dashboard.card-danger {
    background: #fef2f2;
    border-color: #fee2e2;
}

body.dark-mode .summary-card-dashboard.card-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.summary-card-dashboard.card-danger .card-value {
    color: #ef4444;
}

.card-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.category-breakdown {
    margin-bottom: 32px;
}

.category-breakdown h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.category-row {
    display: grid;
    grid-template-columns: 90px 1fr 50px 100px;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.cat-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.cat-bar-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

body.dark-mode .cat-bar-track {
    background: #334155;
}

.cat-bar-fill {
    height: 100%;
    background: #4a6cf7;
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.cat-count {
    text-align: right;
    font-size: 13px;
    color: var(--text-secondary);
}

.cat-value {
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════
   Already Scanned Modal (ASM)
═══════════════════════════════════════════ */

.asm-modal-content {
    border-radius: var(--radius-lg) !important;
    padding: 2rem 1.5rem 1.5rem !important;
    text-align: center;
    max-width: 360px;
    width: 100%;
    animation: asm-slide-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes asm-slide-in {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.asm-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.asm-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    animation: asm-pulse 1.8s infinite;
}

@keyframes asm-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(239, 68, 68, 0.6); }
    70%  { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0);   }
    100% { box-shadow: 0 0 0 0   rgba(239, 68, 68, 0);   }
}

.asm-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.asm-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.asm-info-card {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.25rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.asm-info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.asm-info-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #b91c1c;
    width: 100px;
    flex-shrink: 0;
    padding-top: 1px;
}

.asm-info-value {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
    word-break: break-word;
}

.asm-mono {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    background: rgba(0,0,0,0.05);
    padding: 1px 5px;
    border-radius: 4px;
}

.asm-badge {
    font-weight: 700;
    color: #dc2626;
}

.asm-address-row {
    border-top: 1px solid #fecaca;
    padding-top: 0.4rem;
    margin-top: 0.1rem;
}

.asm-address-val {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.asm-close-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border: none !important;
    font-size: 0.95rem;
}

.asm-close-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
}

/* Dark mode overrides for ASM */
.dark-mode .asm-info-card {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.dark-mode .asm-info-label {
    color: #f87171;
}

.dark-mode .asm-address-row {
    border-top-color: rgba(239, 68, 68, 0.3);
}

/* ═══════════════════════════════════════════
   Settings Modal (Prices)
═══════════════════════════════════════════ */

.prices-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 8px;
}

@media (max-width: 380px) {
    .prices-grid {
        grid-template-columns: 1fr;
    }
}

.price-edit-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.price-edit-card:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.price-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.price-header i {
    color: var(--primary-color);
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.price-input-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 8px;
    height: 38px;
    transition: border-color 0.2s;
}

.price-input-wrapper:focus-within {
    border-color: var(--primary-color);
    background: #fff;
}

.currency-prefix {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-right: 4px;
}

.price-input-wrapper input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0;
    outline: none;
}

/* Dark Mode Overrides */
.dark-mode .price-edit-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: #334155;
}

.dark-mode .price-input-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border-color: #334155;
}

.dark-mode .price-input-wrapper:focus-within {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.dark-mode .price-header {
    color: #94a3b8;
}

/* PWA Install Button */
.pwa-install-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}

.pwa-install-btn:hover {
    background: linear-gradient(135deg, #047857, #059669);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.pwa-install-btn:active {
    transform: scale(0.98);
}

.pwa-install-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 0.4rem;
    margin-bottom: 0;
}
