* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom Scrollbar - Match Theme */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #2d2d2d;
    border-radius: 6px;
    border: 2px solid #f5f5f5;
}

::-webkit-scrollbar-thumb:hover {
    background: #1a1a1a;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #2d2d2d #f5f5f5;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05),
                0 4px 12px rgba(0, 0, 0, 0.08),
                0 8px 24px rgba(0, 0, 0, 0.05);
    padding: 50px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 2px solid #e5e5e5;
    padding-bottom: 30px;
    gap: 25px;
}

/* Centered header variant for landing page */
header.header-centered {
    border-bottom: none;
    padding-bottom: 40px;
    justify-content: center;
}

header.header-centered .header-left {
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Header actions container */
.header-actions {
    display: flex;
    gap: 8px;
}

.logo {
    max-width: 120px;
    height: auto;
}

/* Landing page specific styles */
.landing-section {
    margin-top: 0;
}

.landing-title {
    text-align: center;
    margin-bottom: 24px;
}

.cards-grid {
    display: grid;
    gap: 16px;
}

.card-link {
    text-decoration: none;
}

.card-interactive {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-icon {
    width: 48px;
    height: 48px;
    background: #2d2d2d;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon svg {
    width: 28px;
    height: 28px;
}

.card-text-content {
    flex: 1;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 4px;
}

.card-description {
    font-size: 14px;
    color: #666;
}

.card-arrow {
    width: 20px;
    height: 20px;
}

/* Reports page specific styles */
.loading-state,
.error-state {
    display: none;
    text-align: center;
    padding: 40px;
}

.error-text {
    color: #d32f2f;
}

.error-subtext {
    font-size: 14px;
    color: #666;
}

.period-info {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.revenue-amount {
    color: #2e7d32;
    font-weight: bold;
}

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

.report-table thead tr {
    background: #f5f5f5;
}

.report-table th {
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid #ddd;
}

.report-table th.text-right {
    text-align: right;
}

.report-table td {
    padding: 20px;
    text-align: center;
    color: #999;
}

.table-container {
    /* Inherits from existing styles */
}

.btn-new {
    background-color: transparent;
    color: #2d2d2d;
    border: 2px solid #2d2d2d;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    min-height: 48px;
}

.btn-new:hover {
    background-color: #2d2d2d;
    color: white;
    box-shadow: 0 2px 8px rgba(45, 45, 45, 0.2);
}

.btn-new:active {
    transform: scale(0.98);
}

/* Tab Buttons */
.tab-button {
    background-color: transparent;
    color: #666;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tab-button:hover {
    color: #2d2d2d;
    background-color: #f5f5f5;
}

.tab-button.active {
    color: #2d2d2d;
    border-bottom-color: #2d2d2d;
}

/* Comparison View */
.comparison-metric-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.comparison-metric-header {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-metric-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comparison-metric-item {
    text-align: center;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
}

.comparison-metric-label {
    font-size: 9px;
    color: #999;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.comparison-metric-value {
    font-size: 16px;
    font-weight: 700;
    color: #2d2d2d;
}

.comparison-metric-change {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
}

/* Smaller badges for table cells */
.comparison-metric-change-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.comparison-metric-change.positive,
.comparison-metric-change-small.positive {
    background-color: #d1fae5;
    color: #059669;
}

.comparison-metric-change.negative,
.comparison-metric-change-small.negative {
    background-color: #fee2e2;
    color: #dc2626;
}

.comparison-metric-change.neutral,
.comparison-metric-change-small.neutral {
    background-color: #f3f4f6;
    color: #666;
}

.comparison-arrow {
    font-size: 16px;
}

/* Comparison tables */
.comparison-table th {
    padding: 8px;
    font-size: 11px;
    font-weight: 600;
}

.comparison-table td {
    padding: 8px;
    font-size: 13px;
}

/* Autocomplete Dropdown */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #2d2d2d;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: -2px;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
    color: #2d2d2d;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #f5f5f5;
}

.autocomplete-item:active {
    background-color: #e8e8e8;
}

.autocomplete-dropdown::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 0 0 8px 0;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: #2d2d2d;
    border-radius: 4px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: #1a1a1a;
}

.autocomplete-wrapper input:focus {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

h1 {
    color: #1a1a1a;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.title-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #9ca3af;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.status-dot.ready {
    background-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    animation: pulse-ready 2s ease-in-out infinite;
}

@keyframes pulse-ready {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.1);
    }
}

/* Status Indicators */
.status-indicators {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background-color: #f5f5f5;
    border: 1px solid #e5e5e5;
    transition: all 0.3s;
}

.status-icon {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

.status-text {
    font-size: 12px;
}

/* Online Status States */
.status-indicator.online {
    background-color: #d1fae5;
    border-color: #a7f3d0;
    color: #065f46;
}

.status-indicator.online .status-icon {
    stroke: #065f46;
}

.status-indicator.offline {
    background-color: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.status-indicator.offline .status-icon {
    stroke: #991b1b;
}

.status-indicator.checking {
    background-color: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.status-indicator.checking .status-icon {
    stroke: #92400e;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Data Status States */
.status-indicator.data-success {
    background-color: #d1fae5;
    border-color: #a7f3d0;
    color: #065f46;
}

.status-indicator.data-success .status-icon {
    stroke: #065f46;
}

.status-indicator.data-error {
    background-color: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.status-indicator.data-error .status-icon {
    stroke: #991b1b;
}

h2 {
    color: #2d2d2d;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.4;
    letter-spacing: -0.3px;
}

.form-section {
    margin-bottom: 40px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
}

.form-group.full-width {
    flex: 100%;
}

label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.4;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    line-height: 1.5;
    background: white;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #2d2d2d;
    box-shadow: 0 0 0 3px rgba(45, 45, 45, 0.08);
}

input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Conceptos Section - Card Layout */
.conceptos-section {
    margin-bottom: 40px;
}

#conceptosContainer {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.concepto-card {
    background-color: white;
    border: 2px solid #e5e5e5;
    border-radius: 16px;
    padding: 24px;
    position: relative;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.concepto-card:hover {
    border-color: #2d2d2d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08),
                0 4px 16px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.btn-remove-card {
    width: 100%;
    background-color: transparent;
    color: #ff4757;
    border: 2px solid #ff4757;
    border-radius: 10px;
    padding: 13px 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    min-height: 48px;
}

.btn-remove-card svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.btn-remove-card:hover {
    background-color: #ff4757;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.25);
}

.btn-remove-card:hover svg {
    transform: scale(1.1);
}

.btn-remove-card:active {
    transform: scale(0.98);
}

.card-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.card-row:last-of-type {
    margin-bottom: 20px;
}

.card-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-field.full-width {
    flex: 1 1 100%;
}

.card-field label {
    font-weight: 600;
    font-size: 15px;
    color: #555;
    line-height: 1.4;
}

.card-field input {
    padding: 13px 14px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.card-field input:focus {
    outline: none;
    border-color: #2d2d2d;
    box-shadow: 0 0 0 3px rgba(45, 45, 45, 0.08);
}

.card-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    margin-top: 8px;
}

.importe-label {
    font-weight: 600;
    color: #555;
    font-size: 15px;
}

.importe {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 22px;
    letter-spacing: -0.3px;
}

.btn-add {
    background-color: #2d2d2d;
    color: white;
    border: 2px solid #2d2d2d;
    padding: 13px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    min-height: 48px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-add:hover {
    background-color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.btn-add:active {
    background-color: #1a1a1a;
    transform: scale(0.98);
}

.totals-section {
    background-color: #f8f9fa;
    padding: 28px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
}

.total-row:last-child {
    border-bottom: none;
}

.total-row label {
    font-weight: 600;
    color: #555;
    margin: 0;
    font-size: 16px;
}

.total-row span {
    font-size: 19px;
    font-weight: 600;
    color: #2d2d2d;
    letter-spacing: -0.2px;
}

.total-row input[type="number"] {
    width: 80px;
    margin-right: 12px;
}

.total-final {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid #2d2d2d;
}

.total-final label,
.total-final span {
    font-size: 28px;
    color: #1a1a1a;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.actions-section {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-primary,
.btn-secondary,
.btn-success {
    padding: 16px 32px;
    border: 2px solid #2d2d2d;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2d2d2d;
    color: white;
    min-height: 52px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-success:hover {
    background-color: #1a1a1a;
    border-color: #1a1a1a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.btn-primary:active,
.btn-secondary:active,
.btn-success:active {
    background-color: #1a1a1a;
    border-color: #1a1a1a;
    transform: scale(0.98);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-success:disabled,
.btn-primary.disabled,
.btn-secondary.disabled,
.btn-success.disabled {
    background-color: #e5e5e5;
    border-color: #e5e5e5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.btn-primary:disabled:hover,
.btn-secondary:disabled:hover,
.btn-success:disabled:hover,
.btn-primary.disabled:hover,
.btn-secondary.disabled:hover,
.btn-success.disabled:hover {
    background-color: #e5e5e5;
    border-color: #e5e5e5;
    color: #999;
    transform: none;
    box-shadow: none;
}

.status-message {
    text-align: center;
    padding: 15px;
    border-radius: 5px;
    font-weight: 600;
    display: none;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.status-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* Screen Management */
.screen {
    animation: fadeIn 0.3s ease-in;
}

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

/* Start Screen */
.start-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 40px 0;
    max-width: 400px;
    margin: 0 auto;
}

.btn-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    font-size: 20px;
    font-weight: 600;
    border: 2px solid #2d2d2d;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    min-height: 150px;
    background-color: white;
    color: #2d2d2d;
}

.btn-large:active {
    transform: scale(0.98);
    background-color: #f5f5f5;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.btn-large .btn-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    stroke-width: 2;
}

.btn-large .btn-text {
    font-size: 22px;
}

/* SVG Icons */
.icon-inline {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
}

/* Back Button */
.btn-back {
    background-color: #f5f5f5;
    color: #2d2d2d;
    border: 2px solid #e5e5e5;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
}

.btn-back:active {
    background-color: #e5e5e5;
    transform: scale(0.98);
}

.btn-back .icon-inline {
    margin-right: 10px;
}

/* History Screen */
.history-content {
    margin-top: 20px;
}

.history-item {
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.2s;
}

.history-item:active {
    background-color: #fafafa;
}

.history-item-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.history-item-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.history-item-remision {
    font-size: 18px;
    font-weight: 700;
    color: #2d2d2d;
    flex: 1;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-deleted {
    background-color: #fee2e2;
    color: #991b1b;
}

.history-item-date {
    font-size: 14px;
    color: #666;
}

.history-item-info {
    margin-bottom: 10px;
}

.history-item-label {
    font-weight: 600;
    color: #555;
    margin-right: 5px;
}

.history-item-value {
    color: #333;
}

.history-item-total {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #e5e5e5;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e5e5e5;
    background-color: white;
    color: #666;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background-color: #2d2d2d;
    border-color: #2d2d2d;
    color: white;
}

.filter-btn:active {
    transform: scale(0.98);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #e5e5e5;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #2d2d2d;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background-color: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-close:active {
    background-color: #e5e5e5;
    transform: scale(0.95);
}

.modal-body {
    padding: 20px;
}

.modal-section {
    margin-bottom: 25px;
}

.modal-section h4 {
    font-size: 16px;
    font-weight: 700;
    color: #2d2d2d;
    margin-bottom: 15px;
}

.modal-info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.modal-label {
    font-weight: 600;
    color: #666;
}

.modal-value {
    color: #2d2d2d;
    font-weight: 500;
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
}

.modal-table th {
    background-color: #f5f5f5;
    color: #2d2d2d;
    padding: 10px 6px;
    text-align: left;
    font-size: 12px;
    line-height: 1.3;
    word-wrap: break-word;
}

.modal-table th:nth-child(1) {
    width: 15%;
}

.modal-table th:nth-child(2) {
    width: 40%;
}

.modal-table th:nth-child(3) {
    width: 22%;
}

.modal-table th:nth-child(4) {
    width: 23%;
}

.modal-table td {
    padding: 10px 6px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.modal-totals {
    background-color: #fafafa;
    padding: 15px;
    border-radius: 10px;
}

.modal-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 16px;
}

.modal-total-final {
    border-top: 2px solid #2d2d2d;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 20px;
    font-weight: 700;
    color: #2d2d2d;
}

.modal-actions {
    display: flex;
    gap: 10px;
    padding-top: 10px;
}

.btn-modal {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid #2d2d2d;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-delete {
    background-color: white;
    color: #dc2626;
    border-color: #dc2626;
}

.btn-delete:active {
    background-color: #fee2e2;
    transform: scale(0.98);
}

.btn-restore {
    background-color: white;
    color: #059669;
    border-color: #059669;
}

.btn-restore:active {
    background-color: #d1fae5;
    transform: scale(0.98);
}

.history-item {
    cursor: pointer;
}

/* Confirmation Modal */
.modal-overlay {
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.confirm-content {
    background: white;
    border-radius: 20px;
    padding: 30px 25px;
    max-width: 90%;
    width: 340px;
    text-align: center;
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.confirm-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.confirm-icon svg {
    width: 32px;
    height: 32px;
    stroke-width: 2.5;
}

.confirm-icon.icon-danger {
    background-color: #fee2e2;
}

.confirm-icon.icon-danger svg {
    stroke: #dc2626;
}

.confirm-icon.icon-success {
    background-color: #d1fae5;
}

.confirm-icon.icon-success svg {
    stroke: #059669;
}

.confirm-title {
    font-size: 22px;
    font-weight: 700;
    color: #2d2d2d;
    margin-bottom: 12px;
}

.confirm-message {
    font-size: 15px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 25px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.btn-confirm-cancel,
.btn-confirm-action {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid;
}

.btn-confirm-cancel {
    background-color: white;
    color: #666;
    border-color: #e5e5e5;
}

.btn-confirm-cancel:active {
    background-color: #f5f5f5;
    transform: scale(0.98);
}

.btn-confirm-action {
    background-color: #2d2d2d;
    color: white;
    border-color: #2d2d2d;
}

.btn-confirm-action:active {
    background-color: #1a1a1a;
    transform: scale(0.98);
}

.btn-confirm-action.danger {
    background-color: #dc2626;
    border-color: #dc2626;
}

.btn-confirm-action.danger:active {
    background-color: #b91c1c;
}

.btn-confirm-action.success {
    background-color: #059669;
    border-color: #059669;
}

.btn-confirm-action.success:active {
    background-color: #047857;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 90%;
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideDown 0.3s ease;
    border-left: 4px solid;
}

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

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #2d2d2d;
}

.toast.success {
    border-left-color: #059669;
}

.toast.success .toast-icon {
    stroke: #059669;
}

.toast.error {
    border-left-color: #dc2626;
}

.toast.error .toast-icon {
    stroke: #dc2626;
}

.toast.info {
    border-left-color: #0891b2;
}

.toast.info .toast-icon {
    stroke: #0891b2;
}

/* Delete Confirmation Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    padding: 36px 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12),
                0 8px 32px rgba(0, 0, 0, 0.15),
                0 16px 48px rgba(0, 0, 0, 0.08);
    animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-icon.warning {
    background-color: #fef2f2;
    color: #ff4757;
}

.modal-icon.success {
    background-color: #d1fae5;
    color: #059669;
}

.modal-icon svg {
    width: 34px;
    height: 34px;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
    line-height: 1.3;
}

.modal-message {
    font-size: 15px;
    color: #666;
    margin-bottom: 28px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-modal-cancel,
.btn-modal-delete,
.btn-modal-confirm {
    flex: 1;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid;
    min-height: 48px;
}

.btn-modal-cancel {
    background-color: transparent;
    color: #666;
    border-color: #ddd;
}

.btn-modal-cancel:hover {
    background-color: #f5f5f5;
    border-color: #999;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-modal-delete {
    background-color: #ff4757;
    color: white;
    border-color: #ff4757;
}

.btn-modal-delete:hover {
    background-color: #e84118;
    border-color: #e84118;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

.btn-modal-confirm {
    background-color: #2d2d2d;
    color: white;
    border-color: #2d2d2d;
}

.btn-modal-confirm:hover {
    background-color: #1a1a1a;
    border-color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(45, 45, 45, 0.3);
}

.btn-modal-cancel:active,
.btn-modal-delete:active,
.btn-modal-confirm:active {
    transform: scale(0.98);
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 24px;
        border-radius: 12px;
    }

    header {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        margin-bottom: 32px;
        padding-bottom: 24px;
    }

    .header-left {
        /* justify-content: center;  Removed to keep logo left aligned on mobile */
        gap: 16px;
    }

    h1 {
        font-size: 26px;
    }

    h2 {
        font-size: 20px;
    }

    .logo {
        max-width: 100px;
    }

    .btn-new {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 15px;
        min-height: 48px;
    }

    /* Status indicators mobile */
    .status-indicators {
        gap: 10px;
        margin-top: 12px;
    }

    .status-indicator {
        padding: 5px 10px;
        font-size: 11px;
    }

    .status-icon {
        width: 12px;
        height: 12px;
    }

    .status-text {
        font-size: 11px;
    }

    /* Confirmation modal mobile */
    .confirm-content {
        padding: 25px 20px;
        width: 85%;
    }

    .confirm-icon {
        width: 50px;
        height: 50px;
    }

    .confirm-icon svg {
        width: 28px;
        height: 28px;
    }

    .confirm-title {
        font-size: 20px;
    }

    .confirm-message {
        font-size: 14px;
    }

    .btn-confirm-cancel,
    .btn-confirm-action {
        padding: 16px 20px;
        font-size: 15px;
    }

    /* Toast mobile */
    .toast-container {
        top: 15px;
        max-width: 95%;
    }

    .toast {
        min-width: 0;
        max-width: 100%;
        padding: 14px 16px;
    }

    /* Modal mobile optimization */
    .modal-content {
        padding: 25px 20px;
        width: 85%;
    }

    .modal-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }

    .modal-icon svg {
        width: 28px;
        height: 28px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-message {
        font-size: 14px;
    }

    .btn-modal-cancel,
    .btn-modal-delete,
    .btn-modal-confirm {
        padding: 14px 20px;
        font-size: 16px;
        min-height: 48px;
    }

    .toast-icon {
        width: 20px;
        height: 20px;
    }

    .toast-message {
        font-size: 14px;
    }

    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .actions-section {
        flex-direction: column;
        gap: 12px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-success {
        width: 100%;
        padding: 16px 20px;
        font-size: 16px;
        min-height: 52px;
    }

    .btn-primary:disabled,
    .btn-secondary:disabled,
    .btn-success:disabled,
    .btn-primary.disabled,
    .btn-secondary.disabled,
    .btn-success.disabled {
        background-color: #e5e5e5;
        border-color: #e5e5e5;
        color: #999;
    }

    /* Card layout mobile optimization */
    .concepto-card {
        padding: 20px;
    }

    .card-field input {
        padding: 14px;
        font-size: 16px;
    }

    .btn-remove-card {
        padding: 14px 20px;
        min-height: 48px;
        font-size: 16px;
    }

    .btn-remove-card svg {
        width: 20px;
        height: 20px;
    }

    .btn-add {
        width: 100%;
        padding: 14px 20px;
        min-height: 48px;
    }

    .totals-section {
        padding: 20px;
    }

    .total-row span {
        font-size: 17px;
    }

    .total-final label,
    .total-final span {
        font-size: 24px;
    }

    /* Better touch targets for mobile */
    input[type="text"],
    input[type="email"],
    input[type="date"],
    input[type="number"] {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Start screen mobile optimization */
    .start-buttons {
        padding: 20px 0;
    }

    .btn-large {
        padding: 35px 25px;
        min-height: 140px;
    }

    .btn-large .btn-icon {
        font-size: 45px;
        margin-bottom: 12px;
    }

    .btn-large .btn-text {
        font-size: 20px;
    }

    .btn-back {
        padding: 14px 20px;
        font-size: 18px;
    }

    /* History mobile optimization */
    .history-item {
        padding: 18px;
        margin-bottom: 12px;
    }

    .history-item-title-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .history-item-remision {
        font-size: 18px;
    }

    .status-badge {
        font-size: 11px;
        padding: 3px 10px;
    }

    .history-item-date {
        font-size: 13px;
    }

    .history-item-info {
        margin-bottom: 8px;
        font-size: 15px;
    }

    .history-item-total {
        font-size: 20px;
    }

    /* Modal table mobile optimization */
    .modal-table {
        font-size: 12px;
    }

    .modal-table th {
        padding: 8px 4px;
        font-size: 11px;
    }

    .modal-table td {
        padding: 8px 4px;
        font-size: 12px;
    }
}
