:root {
    --hi-bg: #f5f7fb;
    --hi-sidebar: #ffffff;
    --hi-ink: #0f172a;
    --hi-muted: #64748b;
    --hi-line: #e6ebf2;
    --hi-blue: #2563eb;
    --hi-blue-soft: #eff4ff;
    --hi-green: #16a34a;
    --hi-green-soft: #e8f8ef;
    --hi-red: #ef4444;
    --hi-red-soft: #fef2f2;
    --hi-orange: #f59e0b;
    --hi-orange-soft: #fff7e8;
    --hi-purple: #7c3aed;
    --hi-purple-soft: #f3eeff;
    --hi-card-radius: 16px;
    --hi-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

* { box-sizing: border-box; }

body.homly {
    margin: 0;
    background: var(--hi-bg);
    color: var(--hi-ink);
    font-family: Inter, system-ui, -apple-system, sans-serif;
}

.hi-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    max-width: none;
    display: block;
    flex-shrink: 0;
    overflow: visible;
}
.brand-mark .hi-icon {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
}
.side-link .hi-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
}
.kpi-icon .hi-icon {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
}
.btn-hi .hi-icon,
.btn-hi-ghost .hi-icon,
.btn-hi-outline .hi-icon,
.status-running .hi-icon,
.pill .hi-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
}
.icon-btn .hi-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
}
.search-wrap .icon .hi-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
}
.import-badge .hi-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
}

a { color: var(--hi-blue); text-decoration: none; }
a:hover { color: #1d4ed8; }

.homly-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.homly-sidebar {
    background: var(--hi-sidebar);
    border-right: 1px solid var(--hi-line);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    padding: .35rem .5rem 1.25rem;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--hi-blue);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.brand-title { font-weight: 700; font-size: 1rem; line-height: 1.2; color: var(--hi-ink); }
.brand-sub { font-size: .72rem; color: var(--hi-muted); margin-top: .15rem; }

.side-nav { display: grid; gap: .25rem; }
.side-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .7rem .85rem;
    border-radius: 12px;
    color: #334155;
    font-weight: 500;
    font-size: .92rem;
    line-height: 1.2;
}
.side-link .hi-icon { opacity: .9; }
.side-link:hover { background: #f8fafc; color: var(--hi-ink); }
.side-link.active {
    background: var(--hi-blue-soft);
    color: var(--hi-blue);
}
.side-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--hi-line); }

.homly-main { min-width: 0; display: flex; flex-direction: column; }

.homly-top {
    background: #fff;
    border-bottom: 1px solid var(--hi-line);
    padding: .85rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.search-wrap {
    flex: 1;
    max-width: 560px;
    margin: 0 auto;
    position: relative;
}
.host-finder {
    flex: 0 1 280px;
    max-width: 320px;
    margin: 0;
}
.host-finder input { background: #fff; }
.search-wrap input {
    width: 100%;
    border: 1px solid var(--hi-line);
    background: #f8fafc;
    border-radius: 999px;
    padding: .7rem 3.5rem .7rem 2.6rem;
    font-size: .92rem;
}
.search-wrap .icon {
    position: absolute;
    left: .95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hi-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    pointer-events: none;
}
.search-kbd {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .72rem;
    line-height: 1;
    color: var(--hi-muted);
    border: 1px solid var(--hi-line);
    border-radius: 6px;
    padding: .2rem .4rem;
    background: #fff;
}

.top-actions { display: flex; align-items: center; gap: .85rem; margin-left: auto; }
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--hi-line);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #334155;
    line-height: 0;
    padding: 0;
}
.icon-btn .dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--hi-red);
    border: 2px solid #fff;
}
.user-chip {
    display: flex;
    align-items: center;
    gap: .55rem;
    border: 1px solid var(--hi-line);
    border-radius: 999px;
    padding: .25rem .7rem .25rem .25rem;
    background: #fff;
}
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--hi-blue-soft);
    color: var(--hi-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .78rem;
    line-height: 1;
    flex-shrink: 0;
}
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar.sm { width: 28px; height: 28px; font-size: .7rem; }

.homly-content { padding: 1.5rem; }

.hi-card {
    background: #fff;
    border: 1px solid var(--hi-line);
    border-radius: var(--hi-card-radius);
    box-shadow: var(--hi-shadow);
}
.hi-card-pad { padding: 1.25rem; }

.page-title { font-size: 1.75rem; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.page-sub { color: var(--hi-muted); margin: .35rem 0 0; }

.btn-hi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    background: var(--hi-blue);
    color: #fff !important;
    border: 0;
    border-radius: 12px;
    padding: .7rem 1.05rem;
    font-weight: 600;
    font-size: .92rem;
    line-height: 1.2;
}
.btn-hi:hover { background: #1d4ed8; color: #fff !important; }
.btn-hi-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    background: #fff;
    color: var(--hi-blue) !important;
    border: 1px solid #c7d7fe;
    border-radius: 10px;
    padding: .45rem .85rem;
    font-weight: 600;
    font-size: .85rem;
    line-height: 1.2;
}
.btn-hi-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    background: #fff;
    border: 1px solid var(--hi-line);
    border-radius: 10px;
    padding: .5rem .8rem;
    color: #334155;
    font-weight: 500;
    line-height: 1.2;
}

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.kpi {
    background: #fff;
    border: 1px solid var(--hi-line);
    border-radius: var(--hi-card-radius);
    padding: 1.1rem 1.15rem;
    box-shadow: var(--hi-shadow);
    display: flex;
    gap: .9rem;
    align-items: flex-start;
}
.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}
.kpi-icon.blue { background: var(--hi-blue-soft); color: var(--hi-blue); }
.kpi-icon.purple { background: var(--hi-purple-soft); color: var(--hi-purple); }
.kpi-icon.green { background: var(--hi-green-soft); color: var(--hi-green); }
.kpi-icon.red { background: var(--hi-red-soft); color: var(--hi-red); }
.kpi-label { font-size: .82rem; color: var(--hi-muted); }
.kpi-value { font-size: 1.55rem; font-weight: 700; line-height: 1.15; margin-top: .15rem; }
.kpi-trend { font-size: .78rem; color: var(--hi-green); margin-top: .25rem; }

.muted { color: var(--hi-muted); }
.crumb { color: var(--hi-muted); font-size: .88rem; }
.crumb a { color: var(--hi-muted); }
.crumb strong { color: var(--hi-ink); font-weight: 600; }

.table-hi { width: 100%; border-collapse: collapse; }
.table-hi th {
    text-align: left;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--hi-muted);
    font-weight: 600;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--hi-line);
}
.table-hi td {
    padding: 1rem;
    border-bottom: 1px solid var(--hi-line);
    vertical-align: middle;
}
.table-hi tr:last-child td { border-bottom: 0; }

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    border-radius: 999px;
    padding: .25rem .65rem;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.2;
}
.pill-green { background: var(--hi-green-soft); color: var(--hi-green); }
.pill-red { background: var(--hi-red-soft); color: #b91c1c; }
.pill-blue { background: var(--hi-blue-soft); color: var(--hi-blue); }
.pill-orange { background: var(--hi-orange-soft); color: #b45309; }
.pill-gray { background: #f1f5f9; color: #475569; }

.progress-pill {
    display: inline-flex;
    align-items: center;
    min-width: 110px;
    height: 28px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
    position: relative;
    font-size: .78rem;
    font-weight: 600;
}
.progress-pill span.fill {
    position: absolute;
    inset: 0 auto 0 0;
    background: #bbf7d0;
}
.progress-pill.low span.fill { background: #fed7aa; }
.progress-pill span.text {
    position: relative;
    z-index: 1;
    width: 100%;
    text-align: center;
    color: #14532d;
}
.progress-pill.low span.text { color: #9a3412; }

.tabs {
    display: inline-flex;
    gap: .25rem;
    background: #eef2f7;
    padding: .3rem;
    border-radius: 999px;
}
.tab {
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: .55rem 1rem;
    font-weight: 600;
    font-size: .88rem;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}
a.tab { color: #64748b; text-decoration: none; }
a.tab:hover { color: var(--hi-ink); }
.tab.active, a.tab.active { background: #fff; color: var(--hi-blue); box-shadow: 0 1px 3px rgba(15,23,42,.08); }

.hi-modal {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
}
.hi-modal .modal-header,
.hi-modal .modal-footer { border-color: var(--hi-line); }
.hi-modal .modal-header { padding: 1.1rem 1.25rem; }
.hi-modal .modal-body { padding: 1.15rem 1.25rem; }
.hi-modal .modal-footer { padding: .9rem 1.25rem; }
.hi-modal .modal-title { font-weight: 700; }

.form-hi .form-label { font-weight: 600; font-size: .9rem; }
.form-hi .form-control {
    border-radius: 12px;
    border-color: var(--hi-line);
    padding: .75rem 1rem;
}
.form-hi .form-control:focus {
    border-color: var(--hi-blue);
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15);
}

.stat-mini {
    background: #f8fafc;
    border: 1px solid var(--hi-line);
    border-radius: 14px;
    padding: .9rem 1rem;
}
.host-hero-side .stat-mini {
    min-width: 92px;
    min-height: 72px;
    padding: .7rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.stat-mini.green { background: var(--hi-green-soft); border-color: #bbf7d0; }
.stat-mini.red { background: var(--hi-red-soft); border-color: #fecaca; }

.cal-shell { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; }
.cal-month-title { font-weight: 700; font-size: 1.05rem; }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .5rem;
}
.cal-wd {
    text-align: center;
    font-size: .75rem;
    font-weight: 600;
    color: var(--hi-muted);
    padding: .25rem 0;
}
.cal-cell {
    min-height: 78px;
    border-radius: 12px;
    border: 1px solid var(--hi-line);
    background: #fff;
    padding: .45rem .5rem;
    text-align: left;
}
.cal-cell .d { font-size: .78rem; color: var(--hi-muted); font-weight: 600; }
.cal-cell .p { font-size: .95rem; font-weight: 700; margin-top: .35rem; color: var(--hi-ink); }
.cal-cell.open {
    background: #eef4ff;
    border-color: #c7d7fe;
}
.cal-cell.open .p { color: #1d4ed8; }
.cal-cell.blocked {
    background: repeating-linear-gradient(
        -45deg,
        #f8fafc,
        #f8fafc 6px,
        #eef2f7 6px,
        #eef2f7 12px
    );
}
.cal-cell.blocked .p { color: #94a3b8; font-size: .8rem; font-weight: 600; }
.cal-cell.muted-day { opacity: .45; }
.cal-cell.checkout { box-shadow: inset 0 0 0 2px #93c5fd; }
.cal-legend { display: flex; gap: .85rem; align-items: center; flex-wrap: wrap; }
.cal-legend i {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    margin-right: .35rem;
    vertical-align: -2px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: .55rem 0;
    border-bottom: 1px solid var(--hi-line);
    font-size: .9rem;
}
.summary-row:last-child { border-bottom: 0; }
.info-box {
    background: var(--hi-blue-soft);
    border-radius: 12px;
    padding: .9rem 1rem;
    color: #1e3a8a;
    font-size: .85rem;
}

.import-hero { text-align: center; max-width: 640px; margin: 0 auto 1.5rem; }
.import-icons { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.import-badge {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    border: 1px solid var(--hi-line);
    background: #fff;
}
.feature-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    background: var(--hi-blue-soft);
    border-radius: 14px;
    padding: 1rem;
    margin-top: 1rem;
}
.feature-bar .t { font-weight: 700; font-size: .88rem; }
.feature-bar .s { color: #475569; font-size: .78rem; }

.host-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem 1.25rem;
    align-items: center;
}
.host-hero-copy { min-width: 0; }
.host-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .65rem;
}
.host-loc {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}
.host-loc .hi-icon,
.host-meta .hi-icon {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
}
.host-hero-side {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.host-hero-side form { margin: 0; display: flex; align-items: center; }
.host-hero-side .btn-hi { min-height: 72px; }
.row-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.row-actions form { margin: 0; }
.room-thumb {
    width: 56px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    background-size: cover;
    background-position: center;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}
.room-thumb.lg {
    width: 120px;
    height: 90px;
    border-radius: 14px;
}
.room-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    align-items: center;
    justify-content: space-between;
}
.room-hero-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex: 1 1 320px;
}
.room-hero-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.room-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .55rem;
}
.room-hero-loc {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}
.room-hero-host {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}
.room-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
    margin-left: auto;
}

.report-scroll { overflow-x: auto; }
.report-scroll .table-hi th,
.report-scroll .table-hi td { white-space: nowrap; }
.report-scroll .table-hi th:first-child,
.report-scroll .table-hi td:first-child,
.report-scroll .table-hi th:nth-child(2),
.report-scroll .table-hi td:nth-child(2) {
    position: sticky;
    background: #fff;
    z-index: 1;
}
.report-scroll .table-hi thead th { position: sticky; top: 0; z-index: 2; background: #fff; }
.report-scroll .table-hi th:first-child,
.report-scroll .table-hi td:first-child { left: 0; min-width: 140px; }
.report-scroll .table-hi th:nth-child(2),
.report-scroll .table-hi td:nth-child(2) { left: 140px; min-width: 140px; }
.report-scroll .table-hi thead th:first-child,
.report-scroll .table-hi thead th:nth-child(2) { z-index: 3; }
.report-scroll .table-hi td.price { color: #1d4ed8; font-weight: 700; }
.report-scroll .table-hi td.blocked { color: #94a3b8; font-weight: 600; }

.chart-box { height: 260px; position: relative; }
.donut-wrap { display: grid; place-items: center; height: 220px; position: relative; }
.donut-center {
    position: absolute;
    text-align: center;
}
.donut-center .big { font-size: 1.6rem; font-weight: 700; }
.donut-center .small { font-size: .8rem; color: var(--hi-muted); }

.status-running {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid var(--hi-line);
    border-radius: 999px;
    padding: .35rem .7rem;
    background: #fff;
    font-size: .82rem;
    font-weight: 600;
}
.status-running .live {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--hi-green);
}

@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cal-shell { grid-template-columns: 1fr; }
}
@media (max-width: 992px) {
    .homly-shell { grid-template-columns: 1fr; }
    .homly-sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--hi-line);
    }
    .side-foot { display: none; }
    .search-wrap { max-width: none; }
    .feature-bar { grid-template-columns: 1fr; }
    .host-hero { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .homly-content { padding: 1rem; }
}
