/* ===== Navbar Styles ===== */
.navbar {
    background-color: #2a3f54; /* Deep blue-gray */
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand:hover {
    color: #ffffff;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.nav-link i {
    font-size: 0.9em;
}

.nav-item {
    margin: 0 0.2rem;
}

/* Dropdown menu */
.dropdown-menu {
    border: none;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    border-radius: 0.25rem;
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    color: #495057;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #2a3f54;
}

/* Mobile menu button */
.navbar-toggler {
    border: none;
    padding: 0.35rem 0.75rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Active menu item highlight */
.nav-item.active .nav-link {
    color: #ffffff;
    position: relative;
}

.nav-item.active .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
}

/* Add padding to the body to account for the fixed navbar */
body {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    margin: 0;
    padding: 0; /* Ensure no padding is applied */
    background-color: #f4f4f9;
}

/* Custom styles for the container */
.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px 10px;
}

.container small {
    color: #4a5568
}

/* ===== Spreadsheet Styles ===== */
.table-responsive-container {
    width: calc(100% + 20px); /* Compensate for reduced container padding */
    margin-left: -10px;       /* Pull to edge of container */
    margin-right: -10px;      /* Pull to edge of container */
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}
.spreadsheet.compact {
    width: auto;
    min-width: 100%;
}
.spreadsheet.compact td {
    padding: 0.5rem 0.75rem;
}
.spreadsheet.compact th {
    white-space: nowrap;
}
.spreadsheet {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

.spreadsheet th {
    background-color: #3a5169; /* Darker shade of navbar color */
    color: #ffffff;
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    position: sticky;
    top: 0;
}

.spreadsheet td {
    padding: 0.85rem 1rem;
    text-align: center;
    border-bottom: 1px solid #eaeef2;
    border-right: 1px solid #eaeef2;
    font-size: 0.9rem;
    color: #4a5568;
}

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

.spreadsheet tr:hover td {
    background-color: #f8fafc;
}

/* Remove right border from last cell in each row */
.spreadsheet td:last-child {
    border-right: none;
}

/* Specific row styling */
.spreadsheet tr:first-child td {
    font-weight: 600;
    color: #2d3748;
}

.spreadsheet tr:nth-child(2) td {
    font-weight: 500;
}

/* ===== Button System ===== */
/* Base Button Styles */
.btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn i {
    font-size: 0.9em;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Primary Action (Blue) */
.btn-primary {
    background-color: #3a6ea5; /* Muted blue */
    color: white;
}

.btn-primary:hover {
    background-color: #2d5680;
}

/* Success/Confirm (Green) */
.btn-success {
    background-color: #2e7d32; /* Forest green */
    color: white;
}

.btn-success:hover {
    background-color: #245c27;
}

/* Danger/Destructive (Red) */
.btn-danger {
    background-color: #8d4f39; /* Clay red */
    color: white;
}

.btn-danger:hover {
    background-color: #a32020;
}

/* Secondary (Gray) */
.btn-secondary {
    background-color: #f5f7fa;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

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

/* Action Button Container */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 1.5rem 0;
}

.action-buttons > * {
    flex: 1;
    min-width: fit-content;
}

/* Important Buttons (Compra/Venta) */
.action-buttons .btn-important {
    flex: 2;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Compra (Buy) - Professional Green */
.btn-compra {
    background-color: #388e3c; /* Muted forest green */
    color: #f5f5f5; /* Off-white for better readability */
}

/* Venta (Sell) - Clay Red */
.btn-venta {
    background-color: #8d4f39;
    color: #f8f9fa;
}

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.8rem 1.75rem;
    font-size: 1rem;
}

/* Loading spinner animation */
.btn-loading .spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
    }

    .action-buttons > * {
        width: 100%;
    }

    .action-buttons .btn-important {
        flex: 1;
    }
}


/* Mobile styles */
@media (max-width: 768px) {
    .close-cashier-container {
        padding: 10px; /* Reduced padding on mobile */
        align-items: flex-start; /* Align to top on mobile */
    }

    .close-cashier-card {
        padding: 1.5rem;
        width: calc(100% - 20px); /* Account for container padding */
        margin: 10px; /* Small margin on mobile */
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem; /* Reduced gap on mobile */
        width: 100%; /* Ensure full width */
    }

    .form-group input {
        width: 70%;
        box-sizing: border-box; /* Include padding in width calculation */
        max-width: 70%; /* Prevent overflow */
    }
}

/* Close Cashier Styles */
.close-cashier-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px;
    box-sizing: border-box; /* Ensure padding is included in width */
}

.close-cashier-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 2rem;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box; /* Fix padding overflow */
    margin: 0 auto; /* Center the card */
}

.close-cashier-title {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.close-cashier-title i {
    margin-right: 10px;
    color: #e74c3c;
}

.close-cashier-details {
    text-align: center;
    margin-bottom: 2rem;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Cashier Cards */
.card {
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.card-text {
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* Messages */
.alert {
    padding: 10px;
    margin: 10px 0;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-info {
    color: #31708f;
    background-color: #d9edf7;
    border-color: #bce8f1;
}

.alert-warning {
    color: #8a6d3b;
    background-color: #fcf8e3;
    border-color: #faebcc;
}

.alert-error {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    top: 50%; /* Center vertically */
    left: 50%; /* Center horizontally */
    transform: translate(-50%, -50%); /* Center the modal */
    width: 90%; /* Responsive width */
    max-width: 500px; /* Maximum width */
    background-color: white; /* Background color */
    padding: 20px; /* Padding inside the modal */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Shadow for depth */
    z-index: 1000; /* Ensure it's above other content */
}

/* Overlay Styles */
.overlay {
    display: none; /* Hidden by default */
    position: fixed; /* Cover the entire screen */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    z-index: 999; /* Below the modal but above other content */
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem; /* Space between form fields */
}

.form-group label {
    display: block; /* Make labels block-level */
    margin-bottom: 0.5rem; /* Space between label and input */
    font-weight: bold; /* Bold labels */
}

.form-control {
    width: 100%; /* Full width */
    padding: 0.5rem; /* Padding inside inputs */
    border: 1px solid #ddd; /* Border color */
    border-radius: 4px; /* Rounded corners */
    font-size: 1rem; /* Font size */
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-actions {
    text-align: center;
    margin-top: 2rem;
}

/* Expense Specific Styles */
.expense-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 20px;
}

.expense-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 2rem;
    width: 100%;
    max-width: 800px;
}

.expense-title {
    color: #d9534f;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.expense-details {
    text-align: center;
    margin-bottom: 2rem;
}

.expense-form .form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .expense-form .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}


/* ===== Unified Container Styles ===== */
/* Base Container Style (used for all three) */
.operation-container {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: 70vh;
    box-sizing: border-box;
}

.operation-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.operation-title {
    font-size: 1.5rem;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 1.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.operation-title i {
    font-size: 1.3em;
    color: #3a5169; /* Matching navbar color */
}

.operation-details {
    text-align: center;
    margin-bottom: 2rem;
    color: #4a5568;
    line-height: 1.6;
}

/* Form Styles (for forms in these containers) */
.operation-form .form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .operation-form .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Tab Styles (if needed) */
.operation-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.rate-desc small {
    font-size: 0.85rem;
    color: #666;
}
.rate-values {
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #ccc;
}


/* Specific Overrides (if absolutely needed) */
.close-cashier-title i {
    color: #e74c3c; /* Can keep red icon for close action if preferred */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .operation-card {
        padding: 1.5rem;
    }

    .operation-title {
        font-size: 1.3rem;
    }
}



.tab-btn {
    padding: 10px 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: #666;
}

.tab-btn.active {
    color: #3a5169;
    border-bottom: 2px solid #007bff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.full-width {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .mobile-full {
        grid-column: span 2;
    }

    /* Optional: make gap smaller on mobile */
    .form-grid {
        gap: 10px;
    }
}


.form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.open-operations-list {
    margin-bottom: 20px;
}

.operation-item {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
}

.operation-item:hover {
    background-color: #f8f9fa;
}

.operation-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.operation-type {
    font-weight: bold;
}

.closing-entry {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.closing-entry select, .closing-entry input {
    flex: 1;
}

.remove-entry {
    width: 40px;
}

.remaining-balance {
    font-weight: bold;
    color: #d9534f;
    margin: 5px 0;
}

/* Exchange Rates Styles */
.rates-list {
    margin-bottom: 2rem;
}

.rate-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.currency-info {
    flex: 1;
    min-width: 120px;
}

.currency-code {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

.currency-name {
    display: block;
    font-size: 0.9rem;
    color: #666;
}

.rate-values {
    flex: 1;
    display: flex;
    min-width: 200px;
}

.rate-value {
    flex: 1;
    text-align: center;
}

.rate-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
}

.rate-amount {
    font-weight: bold;
    font-size: 1.1rem;
}

.rate-date {
    flex: 0 0 100%;
    text-align: right;
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.5rem;
}

.rate-entry {
    width: 100%;
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #ccc;
}

.rate-desc {
    margin-top: 0.3rem;
}

@media (max-width: 768px) {
    .rate-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .rate-values {
        width: 100%;
        margin: 0.5rem 0;
    }

    .rate-date {
        text-align: left;
    }

    .rate-entry {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #eee;
        padding-top: 0.5rem;
        margin-top: 0.5rem;
    }
}

.movements-section {
    margin-top: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

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

.movements-table th, .movements-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.movements-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.delete-form {
    display: inline;
}