:root {
    /* Emerald / Slate Theme */
    --primary: #10B981;
    /* Emerald 500 */
    --primary-hover: #059669;
    /* Emerald 600 */
    --secondary: #34D399;
    /* Emerald 400 */
    --accent: #6EE7B7;
    /* Emerald 300 */

    --bg-main: #0F172A;
    /* Slate 900 */
    --bg-panel: rgba(30, 41, 59, 0.7);
    /* Slate 800 */
    --border-glass: rgba(16, 185, 129, 0.2);

    --text-main: #F8FAFC;
    --text-muted: #94A3B8;

    --error: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;

    --radius: 12px;
    --font-base: 'Inter', system-ui, sans-serif;
}

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

body {
    font-family: var(--font-base);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background Effects */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(52, 211, 153, 0.05) 0%, transparent 40%);
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    border-radius: 0 0 var(--radius) var(--radius);
    margin-bottom: 2rem;
    border-top: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Layout */
.container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    padding: 0 2rem 2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.panel {
    padding: 1.75rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.subsection-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Forms */
.form-row {
    display: flex;
    gap: 1rem;
}

.two-cols>* {
    flex: 1;
    min-width: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

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

.input-control {
    width: 100%;
    padding: 0.7rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.input-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.hs-input-group {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.hs-input-group .input-control {
    flex-grow: 1;
}

.hs-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.hs-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.2s;
}

.hs-item:hover {
    background: rgba(16, 185, 129, 0.1);
}

.hs-item strong {
    display: block;
    color: var(--primary);
    font-family: monospace;
}

.hs-item span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.meta-desc {
    font-size: 0.85rem;
    color: var(--accent);
    padding: 0.5rem;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 6px;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.alert.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Results */
.flex-col {
    display: flex;
    flex-direction: column;
}

.gap-4 {
    gap: 1rem;
}

.gap-1 {
    gap: 0.25rem;
}

.total-display {
    text-align: center;
    padding: 2rem 1rem;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.15), transparent);
    border-radius: 8px;
    border: 1px dashed rgba(16, 185, 129, 0.3);
}

.total-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.total-amount {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.summary-line {
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

.breakdown-item.highlight {
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

.info-box {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Modals & Utilities */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    width: 600px;
    max-width: 90%;
    padding: 2rem;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.history-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.h-route {
    font-weight: 600;
    font-size: 0.95rem;
}

.h-hs {
    font-family: monospace;
    color: var(--accent);
    font-size: 0.85rem;
}

.h-amt {
    font-weight: 700;
    color: #fff;
}

.btn {
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-large {
    padding: 1rem;
    font-size: 1.05rem;
}

.btn.small {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
}

.primary-btn {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

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

.secondary-btn {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
    border: 1px solid var(--primary);
}

.secondary-btn:hover {
    background: rgba(16, 185, 129, 0.2);
}

.outline-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.outline-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
}

.icon-btn:hover {
    color: #fff;
}

.full-width {
    width: 100%;
}

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

.flex-end {
    display: flex;
    justify-content: flex-end;
}

.hidden {
    display: none !important;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.text-xs {
    font-size: 0.75rem;
}

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

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 500;
    opacity: 0;
    transition: 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
    }

    .two-cols {
        flex-direction: column;
    }
}