/* Buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.action-btn.icon-btn {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

body.light-theme .action-btn.icon-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.action-btn.icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

body.light-theme .action-btn.icon-btn:hover {
    background: #e2e8f0;
}

.action-btn.primary-btn {
    background: linear-gradient(135deg, #00e699, #00b377);
    color: #0b0e14;
    box-shadow: 0 4px 15px var(--primary-glow);
}

body.light-theme .action-btn.primary-btn {
    background: linear-gradient(135deg, #00a86b, #008756);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 168, 107, 0.3);
}

.action-btn.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
    filter: brightness(1.08);
}

.action-btn.success-btn {
    background: linear-gradient(135deg, #00e699, #02aab0);
    color: #000;
    box-shadow: 0 4px 20px rgba(0, 230, 153, 0.3);
}

body.light-theme .action-btn.success-btn {
    background: linear-gradient(135deg, #00a86b, #008756);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 168, 107, 0.35);
}

.action-btn.success-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 230, 153, 0.45);
}

.action-btn.secondary-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

body.light-theme .action-btn.secondary-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

.action-btn.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

body.light-theme .action-btn.secondary-btn:hover {
    background: #e2e8f0;
}

.action-btn.full-btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.text-btn:hover {
    color: var(--text-main);
}

.text-btn.danger-text:hover {
    color: var(--sell-color);
}

/* Bank Source Selector Bar */
.bank-source-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 4px;
}

body.light-theme .bank-source-bar {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.source-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.source-select-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bank-select-form {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    outline: none;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

body.light-theme .bank-select-form {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

.sync-btn {
    padding: 8px 12px;
    white-space: nowrap;
}

/* Rate Board Section */
.rates-display-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rate-badge-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: var(--transition);
}

body.light-theme .rate-badge-card {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.rate-badge-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

body.light-theme .rate-badge-card:hover {
    border-color: #00a86b;
}

.currency-pair-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.currency-pair-header .flags {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.1rem;
}

.pair-code {
    color: var(--primary-accent);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
}

.rate-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.rate-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rate-row .lbl {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.rate-row .val {
    font-weight: 700;
    font-size: 1.05rem;
}

.buy-val {
    color: var(--buy-color);
}

.sell-val {
    color: var(--sell-color);
}

/* Quick Pair Buttons */
.quick-pairs-section {
    margin-top: 10px;
}

.quick-pairs-section h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.pair-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.pair-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    color: var(--text-main);
    font-family: var(--font-family);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition);
}

body.light-theme .pair-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

.pair-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

body.light-theme .pair-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.pair-btn.active {
    background: rgba(0, 230, 153, 0.15);
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    box-shadow: 0 0 12px rgba(0, 230, 153, 0.2);
}

body.light-theme .pair-btn.active {
    background: #e6f4ea;
    border-color: #008756;
    color: #008756;
    box-shadow: 0 2px 8px rgba(0, 135, 86, 0.15);
}

/* Main Converter Calculator */
.converter-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mode-badge {
    background: rgba(245, 176, 39, 0.15);
    border: 1px solid rgba(245, 176, 39, 0.4);
    color: var(--secondary-accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

body.light-theme .mode-badge {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.input-group-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: var(--transition);
}

body.light-theme .input-group-box {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.input-group-box:focus-within {
    border-color: var(--primary-accent);
    box-shadow: 0 0 15px rgba(0, 230, 153, 0.15);
}

body.light-theme .input-group-box:focus-within {
    border-color: #008756;
    box-shadow: 0 0 15px rgba(0, 135, 86, 0.15);
}

.input-group-box.result-box {
    background: rgba(0, 230, 153, 0.03);
    border-color: rgba(0, 230, 153, 0.2);
}

body.light-theme .input-group-box.result-box {
    background: #f0fdf4;
    border-color: #86efac;
}

.input-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.curr-name {
    color: var(--primary-accent);
    font-weight: 600;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.curr-symbol-prefix {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 24px;
}

body.light-theme .curr-symbol-prefix {
    color: #475569;
}

.amount-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

body.light-theme .amount-input {
    color: #0f172a;
}

.amount-input.result-input {
    color: var(--primary-accent);
}

body.light-theme .amount-input.result-input {
    color: #008756;
}

.currency-select-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

body.light-theme .currency-select-pill {
    background: #e2e8f0;
    color: #0f172a;
}

/* Swap Button & Rate Info */
.swap-divider {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 0 10px;
}

.swap-circle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px solid var(--primary-accent);
    color: var(--primary-accent);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 0 15px rgba(0, 230, 153, 0.3);
}

body.light-theme .swap-circle-btn {
    background: #ffffff;
    border-color: #008756;
    color: #008756;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.swap-circle-btn:hover {
    transform: rotate(180deg) scale(1.1);
    background: var(--primary-accent);
    color: #000;
}

body.light-theme .swap-circle-btn:hover {
    background: #008756;
    color: #ffffff;
}

.applied-rate-info {
    font-size: 0.82rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--card-border);
}

body.light-theme .applied-rate-info {
    background: #fffbeb;
    border-color: #fde68a;
    color: #475569;
}

.applied-rate-info strong {
    color: var(--secondary-accent);
    margin-left: 4px;
}

body.light-theme .applied-rate-info strong {
    color: #b45309;
}

/* Presets */
.quick-amounts {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.preset-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.presets-wrapper {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

body.light-theme .preset-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.preset-btn:hover {
    background: var(--primary-accent);
    color: var(--text-inverse);
    border-color: var(--primary-accent);
}

body.light-theme .preset-btn:hover {
    background: #008756;
    color: #ffffff;
    border-color: #008756;
}

/* Tabs & Right Section */
.tools-tab-header {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
}

body.light-theme .tools-tab-header {
    background: #e2e8f0;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

body.light-theme .tab-btn {
    color: #64748b;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-accent);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.light-theme .tab-btn.active {
    background: #ffffff;
    color: #008756;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tab-content-area {
    min-height: 380px;
}

.tab-pane {
    display: none;
    flex-direction: column;
    gap: 14px;
}

.tab-pane.active {
    display: flex;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pane-header h3 {
    font-size: 0.95rem;
    color: var(--text-main);
}

/* History Log Items */
.history-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

.history-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

body.light-theme .history-item {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.history-item:hover {
    border-color: rgba(0, 230, 153, 0.3);
}

body.light-theme .history-item:hover {
    border-color: #008756;
}

.history-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-pair {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
}

.history-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-from-to {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-accent);
}

.history-rate {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.empty-history {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: var(--text-muted);
    gap: 10px;
}

.empty-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

/* Denomination Counter */
.curr-select-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-main);
}

.form-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    outline: none;
    font-family: var(--font-family);
    font-weight: 600;
}

body.light-theme .form-select {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

.denominations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.denom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

body.light-theme .denom-row {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.denom-label {
    font-weight: 600;
    width: 90px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.denom-qty-input {
    width: 60px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    text-align: center;
    border-radius: var(--radius-sm);
    padding: 4px;
    font-weight: 600;
}

body.light-theme .denom-qty-input {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

.denom-subtotal {
    font-weight: 700;
    color: var(--secondary-accent);
    font-size: 0.85rem;
    width: 100px;
    text-align: right;
}

body.light-theme .denom-subtotal {
    color: #b45309;
}

.counter-total-box {
    background: rgba(245, 176, 39, 0.1);
    border: 1px solid rgba(245, 176, 39, 0.3);
    padding: 12px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    color: var(--text-main);
}

body.light-theme .counter-total-box {
    background: #fffbeb;
    border-color: #fde68a;
    color: #1e293b;
}

.counter-total-box strong {
    font-size: 1.2rem;
    color: var(--secondary-accent);
}

body.light-theme .counter-total-box strong {
    color: #b45309;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-box {
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme .modal-box {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

body.light-theme .modal-header {
    border-bottom-color: #e2e8f0;
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

body.light-theme .close-modal-btn {
    color: #64748b;
}

.close-modal-btn:hover {
    color: var(--text-main);
}

.rate-fieldset {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 14px;
}

body.light-theme .rate-fieldset {
    border-color: #cbd5e1;
}

.rate-fieldset legend {
    padding: 0 8px;
    color: var(--secondary-accent);
    font-weight: 600;
    font-size: 0.88rem;
}

body.light-theme .rate-fieldset legend {
    color: #b45309;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

body.light-theme .form-group label {
    color: #475569;
}

.input-with-unit {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding-right: 10px;
}

body.light-theme .input-with-unit {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.form-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    padding: 8px 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

body.light-theme .form-input {
    color: #0f172a;
}

.input-with-unit .unit {
    color: var(--text-muted);
    font-weight: 600;
}

body.light-theme .input-with-unit .unit {
    color: #475569;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

/* Receipt Paper Styles */
.receipt-modal-box {
    max-width: 400px;
}

.receipt-paper {
    background: #ffffff;
    color: #111111;
    padding: 24px;
    border-radius: 8px;
    font-family: 'Kantumruy Pro', monospace;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.receipt-header {
    text-align: center;
}

.receipt-logo {
    font-size: 2rem;
    color: #00b377;
    margin-bottom: 4px;
}

.receipt-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111;
}

.receipt-sub {
    font-size: 0.72rem;
    color: #666;
    letter-spacing: 1px;
}

.receipt-divider {
    text-align: center;
    color: #aaa;
    font-size: 0.75rem;
    margin: 8px 0;
    overflow: hidden;
}

.receipt-divider-sm {
    border-top: 1px dashed #ccc;
    margin: 8px 0;
}

.receipt-info-rows, .receipt-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
}

.r-row {
    display: flex;
    justify-content: space-between;
}

.r-row.highlight strong {
    color: #000;
    font-size: 1rem;
}

.r-row.grand-total strong {
    color: #00b377;
    font-size: 1.2rem;
}

.receipt-footer {
    text-align: center;
    font-size: 0.8rem;
    margin-top: 12px;
}

.receipt-small {
    font-size: 0.7rem;
    color: #777;
}

.barcode-mock {
    font-family: monospace;
    letter-spacing: 3px;
    font-weight: bold;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #444;
}

@media print {
    body * {
        visibility: hidden;
    }
    #receiptPrintArea, #receiptPrintArea * {
        visibility: visible;
    }
    #receiptPrintArea {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
    }
}
