/* ═══════════════════════════════════════════════════════════════
   admin-marketing.css — Marketing ROI Dashboard styles
   BoxRetreat · Luquillo, Puerto Rico
═══════════════════════════════════════════════════════════════ */

/* ── KPI Cards row ── */
.mkt-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.mkt-kpi-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mkt-kpi-card .kpi-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #717171;
}
.mkt-kpi-card .kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: #0A0A0A;
    font-family: var(--font-heading);
    line-height: 1.1;
}
.mkt-kpi-card .kpi-sub {
    font-size: 12px;
    color: #717171;
}
.kpi-positive { color: #16a34a !important; }
.kpi-negative { color: #dc2626 !important; }
.kpi-neutral  { color: #f59e0b !important; }

/* ── Two-column layout ── */
.mkt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}
@media (max-width: 860px) {
    .mkt-grid { grid-template-columns: 1fr; }
}

/* ── Panel cards ── */
.mkt-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 22px 24px;
}
.mkt-panel h3 {
    font-size: 14px;
    font-weight: 700;
    color: #0A0A0A;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mkt-panel h3 .fa { color: #000000; font-size: 13px; }

/* ── Ad Spend Input Form ── */
.spend-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.spend-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.spend-row label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.spend-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color .15s;
}
.spend-input-wrap:focus-within { border-color: #000000; }
.spend-prefix {
    padding: 0 10px;
    font-size: 15px;
    color: #717171;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    line-height: 40px;
    user-select: none;
}
.spend-input-wrap input {
    border: none;
    outline: none;
    padding: 0 12px;
    font-size: 15px;
    height: 40px;
    width: 100%;
    font-family: var(--font-body);
    background: transparent;
}
.spend-period {
    display: flex;
    gap: 8px;
}
.spend-period input[type="month"] {
    flex: 1;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 0 12px;
    height: 40px;
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color .15s;
}
.spend-period input[type="month"]:focus { border-color: #000000; }

.btn-save-spend {
    background: #0A0A0A;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 22px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background .15s;
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}
.btn-save-spend:hover { background: #222; }

/* ── ROI Result Panel ── */
.roi-result-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.roi-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}
.roi-result-row:last-child { border-bottom: none; }
.roi-result-row .rr-label { color: #555; }
.roi-result-row .rr-value { font-weight: 700; color: #0A0A0A; }
.roi-result-row.roi-total {
    padding-top: 14px;
    margin-top: 4px;
    border-top: 2px solid #0A0A0A;
    border-bottom: none;
}
.roi-result-row.roi-total .rr-label { font-weight: 700; font-size: 15px; color: #0A0A0A; }
.roi-result-row.roi-total .rr-value { font-size: 18px; }

/* ── Bar chart (pure CSS) ── */
.mkt-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mkt-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mkt-bar-label {
    font-size: 12px;
    color: #555;
    width: 70px;
    flex-shrink: 0;
    text-align: right;
}
.mkt-bar-track {
    flex: 1;
    background: #f3f4f6;
    border-radius: 4px;
    height: 18px;
    overflow: hidden;
    position: relative;
}
.mkt-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
}
.mkt-bar-fill.revenue-bar { background: #000000; }
.mkt-bar-fill.spend-bar   { background: #f59e0b; }
.mkt-bar-num {
    font-size: 11px;
    font-weight: 700;
    width: 60px;
    text-align: right;
    flex-shrink: 0;
    color: #0A0A0A;
}
.mkt-bar-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.mkt-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #555;
}
.mkt-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── History Table ── */
.mkt-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.mkt-history-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #717171;
    border-bottom: 1px solid #e5e7eb;
}
.mkt-history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #0A0A0A;
    vertical-align: middle;
}
.mkt-history-table tr:last-child td { border-bottom: none; }
.mkt-history-table tr:hover td { background: #f9fafb; }
.badge-roi-pos {
    background: #dcfce7;
    color: #16a34a;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
}
.badge-roi-neg {
    background: #fee2e2;
    color: #dc2626;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
}
.mkt-empty {
    text-align: center;
    padding: 28px;
    color: #717171;
    font-size: 14px;
}
.btn-delete-spend {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .12s;
}
.btn-delete-spend:hover { background: #fee2e2; }

/* ── Occupation Bar ── */
.occupancy-bar-wrap {
    margin-top: 8px;
}
.occupancy-bar-track {
    height: 10px;
    background: #f3f4f6;
    border-radius: 10px;
    overflow: hidden;
    margin: 8px 0 4px;
}
.occupancy-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #000000, #0077b6);
    border-radius: 10px;
    transition: width .6s ease;
}
.occupancy-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #717171;
}

/* ── Mobile ── */
@media (max-width: 640px) {
    .mkt-kpi-row { grid-template-columns: 1fr 1fr; }
    .mkt-kpi-card .kpi-value { font-size: 20px; }
    .mkt-panel { padding: 16px; }
}
