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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
}

.container {
    background: #16213e;
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    color: #e94560;
    margin-bottom: 30px;
    font-size: 1.6rem;
}

h2 {
    text-align: center;
    color: #e94560;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.hamburger-menu {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 2000;
}

.hamburger-btn {
    width: 38px;
    height: 38px;
    background: #16213e;
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 8px;
    transition: background 0.2s;
}

.hamburger-btn:hover {
    background: #1a4a7a;
}

.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #e0e0e0;
    border-radius: 1px;
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger-menu.open .hamburger-btn span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-menu.open .hamburger-btn span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.open .hamburger-btn span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.hamburger-dropdown {
    display: none;
    position: absolute;
    top: 45px;
    left: 0;
    background: #16213e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.hamburger-menu.open .hamburger-dropdown {
    display: block;
}

.hamburger-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #a8a8b3;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    border-bottom: 1px solid #1a1a3a;
}

.hamburger-dropdown a:last-child {
    border-bottom: none;
}

.hamburger-dropdown a:hover {
    background: #1a4a7a;
    color: #e0e0e0;
}

.hamburger-dropdown .dropdown-active {
    color: #e94560;
    font-weight: 700;
}

.main-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #2a2a4a;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: #a8a8b3;
    background: #0f3460;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
    background: #1a4a7a;
    color: #e0e0e0;
}

.nav-active {
    background: #e94560;
    color: #fff;
}

.nav-active:hover {
    background: #c73652;
    color: #fff;
}

.view-link {
    color: #4ecca3;
    text-decoration: none;
    font-weight: 600;
}

.view-link:hover {
    color: #3dbb91;
    text-decoration: underline;
}

.loans-table tbody td {
    font-size: 0.85rem;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #a8a8b3;
    font-size: 0.9rem;
}

input[type="date"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    background: #0f3460;
    color: #e0e0e0;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="date"]:focus {
    outline: none;
    border-color: #e94560;
}

input[type="number"],
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    background: #0f3460;
    color: #e0e0e0;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #e94560;
}

.duration-row {
    display: flex;
    gap: 10px;
}

.duration-row input {
    flex: 2;
}

.duration-row select {
    flex: 1;
}

button {
    width: 100%;
    padding: 14px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #c73652;
}

.error {
    background: #5c1a1a;
    color: #ff6b6b;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.results {
    margin-top: 30px;
    background: #0f3460;
    border-radius: 8px;
    padding: 20px;
}

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

td {
    padding: 10px 8px;
    border-bottom: 1px solid #2a2a4a;
    font-size: 0.95rem;
}

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

td:first-child {
    color: #a8a8b3;
}

td:last-child {
    text-align: right;
    font-weight: 600;
    color: #e0e0e0;
}

.total-row td {
    color: #e94560 !important;
    font-size: 1.1rem;
    font-weight: 700;
    padding-top: 14px;
    border-top: 2px solid #e94560;
}

.apr-row td {
    color: #4ecca3 !important;
    font-size: 1.2rem;
    font-weight: 700;
    padding-top: 16px;
    border-top: 2px solid #4ecca3;
}

.formula-note {
    margin-top: 20px;
    padding: 14px;
    background: #16213e;
    border-radius: 8px;
    text-align: center;
}

.formula-note p {
    font-size: 1rem;
    color: #a8a8b3;
    font-style: italic;
}

.formula-note .formula-legend {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #6b6b80;
    font-style: normal;
}

.breakdown {
    margin-top: 20px;
    background: #0f3460;
    border-radius: 8px;
    padding: 20px;
}

.step {
    padding: 10px 0;
    border-bottom: 1px solid #2a2a4a;
}

.step:last-child {
    border-bottom: none;
}

.step-label {
    font-size: 0.85rem;
    color: #a8a8b3;
    margin-bottom: 4px;
}

.step-formula {
    font-size: 0.95rem;
    color: #e0e0e0;
}

.step-formula strong {
    color: #4ecca3;
}

.payment-detail {
    background: #1a3a2a;
    padding: 12px;
    border-radius: 6px;
    margin: 8px 0;
    border-left: 3px solid #4ecca3;
}

.payment-detail .step-label {
    color: #4ecca3;
    font-weight: 600;
}

th {
    text-align: left;
}

.container-wide {
    max-width: 900px;
}

.summary-type {
    color: #4ecca3 !important;
    margin-bottom: 20px;
}

.summary-buttons {
    margin-top: 20px;
}

.btn-row {
    display: flex;
    gap: 10px;
}

.summary-btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
}

.summary-btn-active {
    background: #4ecca3;
    color: #1a1a2e;
}

.summary-btn-active:hover {
    background: #3dbb91;
}

.summary-btn-disabled {
    background: #2a2a4a;
    color: #6b6b80;
    cursor: not-allowed;
}

.payment-form {
    margin-bottom: 15px;
}

.payment-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.payment-field {
    flex: 1;
}

.payment-field-btn {
    flex: 0 0 80px;
}

.payment-field-btn button {
    margin-top: 0;
}

.payment-list {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #2a2a4a;
}

.payment-list h3 {
    color: #a8a8b3;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #2a2a4a;
    font-size: 0.9rem;
}

.inline-form {
    display: inline;
}

.remove-btn {
    width: auto;
    padding: 4px 10px;
    background: #5c1a1a;
    color: #ff6b6b;
    font-size: 1rem;
    border-radius: 4px;
}

.remove-btn:hover {
    background: #7a2a2a;
}

.clear-btn {
    margin-top: 10px;
    padding: 8px 14px;
    background: #2a2a4a;
    color: #a8a8b3;
    font-size: 0.85rem;
}

.clear-btn:hover {
    background: #3a3a5a;
}

.table-scroll {
    overflow-x: auto;
}

.daily-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.daily-table thead th {
    padding: 10px 8px;
    background: #16213e;
    color: #a8a8b3;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid #e94560;
    white-space: nowrap;
}

.daily-table tbody td {
    padding: 6px 8px;
    border-bottom: 1px solid #1a1a3a;
    color: #e0e0e0;
    font-weight: normal;
    white-space: nowrap;
}

.daily-table tbody td:first-child {
    color: #6b6b80;
}

.daily-table tbody tr:hover {
    background: #1a2a50;
}

.daily-table tbody tr.payment-day {
    background: #1a3a2a;
}

.daily-table tbody tr.payment-day td {
    color: #4ecca3;
    font-weight: 600;
}

.nav-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.nav-buttons .back-btn {
    margin-top: 0;
}

.back-btn {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #c73652;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.compare-table thead th {
    padding: 12px 10px;
    background: #16213e;
    color: #a8a8b3;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid #e94560;
}

.compare-table thead th.compare-aspect {
    width: 22%;
}

.compare-table thead th.compare-col {
    width: 39%;
}

.compare-table tbody td {
    padding: 10px;
    border-bottom: 1px solid #2a2a4a;
    vertical-align: top;
    color: #e0e0e0;
    font-weight: normal;
    line-height: 1.5;
}

.compare-table tbody td.compare-label {
    color: #a8a8b3;
    font-weight: 600;
}

.compare-section {
    margin: 10px 0 20px 0;
}

.compare-heading {
    font-size: 1rem;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 0;
    text-align: left;
}

.compare-heading-fixed {
    background: #2a2040;
    color: #b388ff;
}

.compare-heading-simple {
    background: #0f3460;
    color: #e94560;
}

.compare-heading-npa {
    background: #1a3a2a;
    color: #4ecca3;
}

.compare-table thead th.compare-aspect-3 {
    width: 18%;
}

.compare-table thead th.compare-col-3 {
    width: 27%;
}

.summary-btn-super {
    background: linear-gradient(135deg, #e94560, #b388ff, #4ecca3);
    color: #fff;
    font-size: 1.1rem;
    padding: 14px;
}

.summary-btn-super:hover {
    opacity: 0.9;
}

.container-super {
    max-width: 1100px;
}

.reduce-day-btn {
    background: #2a2a4a;
    color: #e94560;
    border: 1px solid #e94560;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.reduce-day-btn:hover {
    background: #3a1a2a;
}

.row-tooltip {
    display: none;
    position: fixed;
    background: #0a0a1a;
    border: 1px solid #4ecca3;
    border-radius: 8px;
    padding: 12px 16px;
    color: #e0e0e0;
    font-size: 0.8rem;
    line-height: 1.6;
    white-space: pre;
    z-index: 1000;
    pointer-events: none;
    max-width: 360px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.has-tooltip {
    cursor: pointer;
}

.site-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #2a2a4a;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #a8a8b3;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #4ecca3;
}

.footer-copy {
    color: #666;
    font-size: 0.75rem;
}

.policy-page h3 {
    color: #4ecca3;
    margin: 20px 0 8px 0;
    font-size: 1rem;
}

.policy-page h4 {
    color: #b388ff;
    margin: 15px 0 5px 0;
    font-size: 0.9rem;
}

.policy-page p {
    color: #c0c0c0;
    line-height: 1.7;
    margin-bottom: 8px;
    font-size: 0.88rem;
}

.policy-page ul {
    color: #c0c0c0;
    margin: 5px 0 10px 20px;
    font-size: 0.88rem;
    line-height: 1.7;
}

.policy-updated {
    color: #a8a8b3;
    font-size: 0.8rem;
    font-style: italic;
    margin-bottom: 15px;
}

.sitemap-section {
    margin-bottom: 15px;
}

.sitemap-item {
    margin-bottom: 10px;
    padding: 10px 15px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
}

.sitemap-item a {
    color: #e94560;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.sitemap-item a:hover {
    color: #4ecca3;
}

.sitemap-item p {
    color: #a8a8b3;
    font-size: 0.8rem;
    margin-top: 3px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination-active {
    background: #e94560 !important;
    color: #fff !important;
}

.ip-link {
    position: absolute;
    bottom: 8px;
    left: 10px;
    color: #a8a8b3;
    text-decoration: none;
    font-size: 0.7rem;
    opacity: 0.6;
    transition: opacity 0.2s, color 0.2s;
}

.ip-link:hover {
    opacity: 1;
    color: #4ecca3;
}

.site-footer {
    position: relative;
}
