/* ================================================
   MODULES.CSS — Styles for new app modules
   Dashboard, Tools, Closing Costs, Running Costs,
   Compare, Guide, Profile, Nav
   ================================================ */

/* ---------- App Views ---------- */
.app-view {
    display: none;
}

/* ---------- Desktop App Nav ---------- */
.app-nav {
    display: none;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 50;
}
.app-nav__inner {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}
.app-nav__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    background: none;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.app-nav__item:hover {
    background: #f1f5f9;
    color: #1a3a5c;
}
.app-nav__item.active {
    background: #1a3a5c;
    color: #f5e6b8;
}
.app-nav__item svg {
    flex-shrink: 0;
}
@media (min-width: 769px) {
    .app-nav {
        display: block;
    }
}

/* ---------- Section Subtitle ---------- */
.section-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: -16px;
    margin-bottom: 24px;
}

/* ---------- Back Button ---------- */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: 16px;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.back-btn:hover {
    background: #f1f5f9;
    color: #1a3a5c;
    border-color: #cbd5e1;
}

/* ========================================
   DASHBOARD
   ======================================== */
.dash-welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1a3a5c, #2c5282);
    color: #fff;
    border: none;
}
.dash-welcome__title {
    font-size: 1.4rem;
    font-weight: 700;
}
.dash-welcome__sub {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    margin-top: 4px;
}
.dash-welcome__date {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.55);
    text-align: right;
}

/* Stats */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.dash-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.dash-stat__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}
.dash-stat__icon--gold {
    background: rgba(212,168,75,0.12);
    color: #d4a84b;
}
.dash-stat__icon--teal {
    background: rgba(45,122,79,0.1);
    color: #2d7a4f;
}
.dash-stat__icon--blue {
    background: rgba(26,58,92,0.08);
    color: #1a3a5c;
}
.dash-stat__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a3a5c;
    line-height: 1.2;
}
.dash-stat__value small {
    font-size: 0.7rem;
    font-weight: 500;
    color: #94a3b8;
}
.dash-stat__label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* Quick access tiles */
.dash-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.dash-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 0.2s;
}
.dash-tile:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}
.dash-tile__icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dash-tile__icon--navy { background: rgba(26,58,92,0.1); color: #1a3a5c; }
.dash-tile__icon--gold { background: rgba(212,168,75,0.12); color: #d4a84b; }
.dash-tile__icon--teal { background: rgba(45,122,79,0.1); color: #2d7a4f; }
.dash-tile__icon--blue { background: rgba(37,99,235,0.1); color: #2563eb; }
.dash-tile__icon--purple { background: rgba(124,58,237,0.1); color: #7c3aed; }
.dash-tile__label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a3a5c;
}
.dash-tile__desc {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* Saved calcs list */
.dash-saved-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dash-saved-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.dash-saved-item__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a3a5c;
}
.dash-saved-item__meta {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 2px;
}
.dash-saved-item__actions {
    display: flex;
    gap: 8px;
}
.btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-small--primary {
    background: #1a3a5c;
    color: #f5e6b8;
}
.btn-small--primary:hover {
    background: #2c5282;
}
.btn-small--danger {
    background: #fee2e2;
    color: #dc2626;
}
.btn-small--danger:hover {
    background: #fecaca;
}

/* ========================================
   TOOLS HUB
   ======================================== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 8px;
}
.tools-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.tools-card:hover {
    border-color: #d4a84b;
    box-shadow: 0 4px 16px rgba(212,168,75,0.15);
    transform: translateY(-3px);
}
.tools-card__icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.tools-card__icon--gold { background: rgba(212,168,75,0.12); color: #d4a84b; }
.tools-card__icon--teal { background: rgba(45,122,79,0.1); color: #2d7a4f; }
.tools-card__icon--blue { background: rgba(37,99,235,0.1); color: #2563eb; }
.tools-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a3a5c;
    margin-bottom: 8px;
}
.tools-card__desc {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.5;
}

/* ========================================
   COST TABLES (Closing + Running)
   ======================================== */
.cost-table {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.cost-table__header,
.cost-table__header--3col {
    display: grid;
    padding: 12px 16px;
    background: #f8fafc;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e2e8f0;
}
.cost-table__header {
    grid-template-columns: 1fr auto;
}
.cost-table__header--3col {
    grid-template-columns: 1fr auto auto;
    gap: 16px;
}
.cost-table__row,
.cost-table__row--3col {
    display: grid;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    font-size: 0.88rem;
}
.cost-table__row {
    grid-template-columns: 1fr auto;
}
.cost-table__row--3col {
    grid-template-columns: 1fr auto auto;
    gap: 16px;
}
.cost-table__label {
    color: #475569;
}
.cost-table__rate {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-left: 6px;
}
.cost-table__value {
    font-weight: 600;
    color: #1a3a5c;
    text-align: right;
}
.cost-table__value--sub {
    color: #94a3b8;
    font-weight: 500;
}
.cost-table__total,
.cost-table__total--3col {
    display: grid;
    padding: 14px 16px;
    font-weight: 700;
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    font-size: 0.92rem;
    color: #1a3a5c;
}
.cost-table__total {
    grid-template-columns: 1fr auto;
}
.cost-table__total--3col {
    grid-template-columns: 1fr auto auto;
    gap: 16px;
}
.cost-table__total--grand {
    background: linear-gradient(135deg, #1a3a5c, #2c5282);
    color: #f5e6b8;
    border-top: none;
}
.cost-table__note {
    padding: 10px 16px;
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: center;
    background: #fefce8;
}

/* ========================================
   COMPARE — 3 Columns
   ======================================== */
.cmp-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.cmp-col {
    border-top: 3px solid #e2e8f0;
}
.cmp-col--rb { border-top-color: #d4a84b; }
.cmp-col--mortgage { border-top-color: #2563eb; }
.cmp-col--rent { border-top-color: #94a3b8; }
.cmp-col__title {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    padding-bottom: 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.cmp-col__title--rb { color: #d4a84b; }
.cmp-col__title--mortgage { color: #2563eb; }
.cmp-col__title--rent { color: #64748b; }
.cmp-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.84rem;
    color: #475569;
    border-bottom: 1px solid #f8fafc;
}
.cmp-row span:last-child {
    font-weight: 600;
    color: #1a3a5c;
}
.cmp-row--highlight {
    background: #fefce8;
    margin: 4px -16px;
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
}
.cmp-row--highlight span:last-child {
    font-size: 1rem;
    font-weight: 700;
    color: #d4a84b;
}
.cmp-row--total {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 2px solid #e2e8f0;
    border-bottom: none;
    font-weight: 700;
}
.cmp-row--total span:last-child {
    font-size: 1.05rem;
}
.cmp-yes {
    color: #2d7a4f !important;
    font-weight: 600;
}
.cmp-no {
    color: #dc2626 !important;
    font-weight: 600;
}

/* Compare summary */
.cmp-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}
.cmp-summary-card {
    text-align: center;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}
.cmp-summary-card--best {
    border-color: #d4a84b;
    background: linear-gradient(135deg, rgba(212,168,75,0.05), rgba(245,230,184,0.1));
    box-shadow: 0 2px 12px rgba(212,168,75,0.15);
}
.cmp-summary-card__title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}
.cmp-summary-card__value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a3a5c;
}
.cmp-summary-card__own {
    font-size: 0.78rem;
    margin-top: 6px;
}

/* ========================================
   GUIDE — Accordion
   ======================================== */
.guide-accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.guide-step {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.25s;
}
.guide-step.open {
    border-color: #d4a84b;
}
.guide-step__header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 20px;
    background: #fff;
    border: none;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}
.guide-step__header:hover {
    background: #f8fafc;
}
.guide-step__num {
    font-size: 0.75rem;
    font-weight: 700;
    color: #d4a84b;
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(212,168,75,0.1);
}
.guide-step__icon-wrap {
    color: #64748b;
}
.guide-step__info {
    flex: 1;
}
.guide-step__title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1a3a5c;
}
.guide-step__meta {
    display: flex;
    gap: 12px;
    margin-top: 3px;
}
.guide-step__duration,
.guide-step__cost {
    font-size: 0.72rem;
    color: #94a3b8;
}
.guide-step__chevron {
    color: #94a3b8;
    transition: transform 0.25s;
    flex-shrink: 0;
}
.guide-step.open .guide-step__chevron {
    transform: rotate(180deg);
    color: #d4a84b;
}
.guide-step__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    padding: 0 20px;
    background: #fafbfc;
}
.guide-step.open .guide-step__body {
    padding-bottom: 20px;
}
.guide-step__desc {
    padding-top: 12px;
    font-size: 0.86rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 16px;
}
.guide-step__docs-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}
.guide-step__checklist {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.guide-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.84rem;
    color: #475569;
    cursor: pointer;
}
.guide-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #d4a84b;
    flex-shrink: 0;
}

/* ========================================
   PROFILE
   ======================================== */
.profile-card {
    text-align: center;
}
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a5c, #2c5282);
    color: #f5e6b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
}
.profile-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a3a5c;
}
.profile-email {
    font-size: 0.85rem;
    color: #94a3b8;
}
.profile-actions {
    margin-top: 16px;
}
.profile-empty {
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
    padding: 32px 0;
}

/* ========================================
   SAVE BUTTON
   ======================================== */
.btn-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #2d7a4f;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-save:hover {
    background: #236b42;
}
.btn-save--done {
    background: #16a34a;
    pointer-events: none;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .dash-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .dash-stat-card {
        display: flex;
        align-items: center;
        gap: 14px;
        text-align: left;
        padding: 14px 16px;
    }
    .dash-stat__icon {
        margin: 0;
    }
    .dash-tiles {
        grid-template-columns: 1fr;
    }
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .tools-card {
        flex-direction: row;
        text-align: left;
        padding: 20px;
        gap: 16px;
    }
    .tools-card__icon {
        margin-bottom: 0;
        min-width: 56px;
    }
    .cmp-columns {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .cmp-summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .dash-welcome {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .dash-welcome__date {
        text-align: left;
    }
    .dash-saved-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .section-header-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .btn-save {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
}

/* Tablet adjustments */
@media (min-width: 481px) and (max-width: 768px) {
    .dash-tiles {
        grid-template-columns: repeat(2, 1fr);
    }
    .dash-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    .dash-stat-card {
        flex-direction: column;
        text-align: center;
    }
    .dash-stat__icon {
        margin: 0 auto 8px;
    }
}
