/* ============================================
   Analytics Dashboard — Full Redesign
   Dark navy theme with glass-morphism cards
   ============================================ */

.analytics-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
}

/* --- Dashboard Header --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dashboard-title h1 {
    color: #CEBA4C;
    font-size: 1.6rem;
    margin-bottom: 0.2rem;
}

.dashboard-subtitle {
    color: #888;
    font-size: 0.85rem;
}

.period-selector {
    display: flex;
    background: rgba(13, 40, 73, 0.6);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(206, 186, 76, 0.2);
}

.period-btn {
    padding: 0.5rem 1.2rem;
    border: none;
    background: transparent;
    color: #aaa;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.period-btn:hover {
    color: #CEBA4C;
    background: rgba(206, 186, 76, 0.08);
}

.period-btn.active {
    background: rgba(206, 186, 76, 0.2);
    color: #CEBA4C;
}

/* --- KPI Row --- */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.kpi-card {
    background: rgba(13, 40, 73, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(206, 186, 76, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #f2f2f2;
    margin-bottom: 0.15rem;
}

.kpi-sub {
    font-size: 0.75rem;
    color: #9945FF;
    font-weight: 500;
    min-height: 1rem;
}

.kpi-label {
    font-size: 0.78rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.kpi-trend {
    font-size: 0.75rem;
    font-weight: 500;
    min-height: 1rem;
}

.kpi-trend.trend-up {
    color: #4CAF50;
}

.kpi-trend.trend-down {
    color: #ff6b6b;
}

/* --- Today Strip --- */
.today-strip {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(206, 186, 76, 0.08);
    border: 1px solid rgba(206, 186, 76, 0.2);
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
}

.today-label {
    color: #CEBA4C;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.today-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.today-stat {
    text-align: center;
}

.today-stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #f2f2f2;
}

.today-stat-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.today-divider {
    width: 1px;
    height: 30px;
    background: rgba(206, 186, 76, 0.3);
}

/* --- Charts --- */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-card {
    background: rgba(13, 40, 73, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(206, 186, 76, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
}

.chart-card h3 {
    color: #CEBA4C;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.chart-wrap {
    position: relative;
    height: 280px;
}

.chart-wrap-sm {
    height: 240px;
}

/* --- Tier Tracking --- */
.tier-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
}

.tier-card {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(206, 186, 76, 0.1);
}

.tier-card-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 0.4rem;
}

.tier-card-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #f2f2f2;
}

.tier-card.tier-whale { border-color: rgba(153, 69, 255, 0.4); }
.tier-card.tier-whale .tier-card-value { color: #9945FF; }

.tier-card.tier-shark,
.tier-card.tier-unlimited { border-color: rgba(39, 117, 202, 0.4); }
.tier-card.tier-shark .tier-card-value,
.tier-card.tier-unlimited .tier-card-value { color: #2775CA; }

.tier-card.tier-fish,
.tier-card.tier-annual { border-color: rgba(40, 199, 111, 0.4); }
.tier-card.tier-fish .tier-card-value,
.tier-card.tier-annual .tier-card-value { color: #28c76f; }

.tier-card.tier-paid { border-color: rgba(206, 186, 76, 0.3); }
.tier-card.tier-paid .tier-card-value { color: #CEBA4C; }

.tier-total {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.8rem;
    color: #888;
}

.tier-total strong {
    color: #CEBA4C;
}

.tier-loading {
    color: #666;
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

.tier-table-wrap {
    overflow-x: auto;
}

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

.tier-table th {
    background: rgba(206, 186, 76, 0.12);
    color: #CEBA4C;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.tier-table td {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #ccc;
}

.tier-table tr:hover td {
    background: rgba(206, 186, 76, 0.05);
}

.tier-table .tier-name {
    font-weight: 600;
    text-transform: capitalize;
}

/* --- Partner Card --- */
.partner-card {
    background: rgba(13, 40, 73, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(206, 186, 76, 0.15);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.partner-card-featured {
    border-color: rgba(206, 186, 76, 0.3);
}

.partner-header {
    margin-bottom: 1rem;
}

.partner-label {
    color: #888;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.partner-body {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.partner-logo-link {
    flex-shrink: 0;
}

.partner-logo {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    border: 1px solid rgba(206, 186, 76, 0.2);
}

.partner-info {
    flex: 1;
}

.partner-title {
    color: #CEBA4C;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    display: block;
    margin-bottom: 0.4rem;
}

.partner-title:hover {
    text-decoration: underline;
}

.partner-desc {
    color: #bbb;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.partner-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.partner-btn {
    color: #CEBA4C;
    font-size: 0.8rem;
    text-decoration: none;
    padding: 0.3rem 0.75rem;
    border: 1px solid rgba(206, 186, 76, 0.3);
    border-radius: 6px;
    transition: all 0.2s;
}

.partner-btn:hover {
    background: rgba(206, 186, 76, 0.1);
    border-color: #CEBA4C;
}

.partner-footnote {
    margin-top: 0.75rem;
    font-size: 0.72rem;
    color: #666;
    font-style: italic;
}

.partner-name {
    color: #CEBA4C;
    font-weight: 600;
    font-size: 1rem;
}

@media (max-width: 600px) {
    .partner-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .partner-actions {
        justify-content: center;
    }
}

/* --- Feedback Card --- */
.feedback-card {
    background: rgba(13, 40, 73, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(206, 186, 76, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.feedback-card h3 {
    color: #CEBA4C;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.feedback-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    align-items: flex-end;
}

.feedback-inputs {
    flex: 1;
    display: flex;
    gap: 0.75rem;
}

.feedback-form input,
.feedback-form textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(206, 186, 76, 0.2);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    color: #f2f2f2;
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.2s ease;
}

.feedback-form input {
    width: 150px;
    flex-shrink: 0;
}

.feedback-form textarea {
    flex: 1;
    resize: none;
    min-height: 38px;
    height: 38px;
}

.feedback-form input:focus,
.feedback-form textarea:focus {
    outline: none;
    border-color: #CEBA4C;
}

.feedback-form input::placeholder,
.feedback-form textarea::placeholder {
    color: #666;
}

.feedback-submit {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #CEBA4C 0%, #e6d472 100%);
    border: none;
    border-radius: 8px;
    color: #0D2849;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease;
}

.feedback-submit:hover {
    transform: translateY(-1px);
}

/* Feedback Thread */
.feedback-thread {
    max-height: 400px;
    overflow-y: auto;
}

.feedback-day {
    margin-bottom: 1.25rem;
    border-left: 3px solid #CEBA4C;
    padding-left: 1rem;
}

.feedback-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.feedback-day-date {
    font-weight: 600;
    color: #f2f2f2;
    font-size: 0.9rem;
}

.feedback-day-stats {
    font-size: 0.75rem;
    color: #888;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
}

.feedback-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.feedback-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
}

.feedback-name {
    font-weight: 600;
    color: #CEBA4C;
    font-size: 0.85rem;
}

.feedback-time {
    font-size: 0.75rem;
    color: #666;
}

.feedback-comment {
    color: #ccc;
    font-size: 0.85rem;
    line-height: 1.5;
}

.no-feedback {
    color: #666;
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* --- Table Section --- */
.table-section {
    margin-bottom: 1rem;
}

.table-toggle {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: rgba(13, 40, 73, 0.6);
    border: 1px solid rgba(206, 186, 76, 0.15);
    border-radius: 10px;
    color: #aaa;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-toggle:hover {
    color: #CEBA4C;
    border-color: rgba(206, 186, 76, 0.3);
}

.table-wrapper {
    margin-top: 0.75rem;
    overflow-x: auto;
    background: rgba(13, 40, 73, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(206, 186, 76, 0.1);
}

.table-wrapper.hidden {
    display: none;
}

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

.data-table th {
    background: rgba(206, 186, 76, 0.15);
    color: #CEBA4C;
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #ccc;
    white-space: nowrap;
}

.data-table tr:hover td {
    background: rgba(206, 186, 76, 0.05);
}

.data-table .ad-cell {
    color: #CEBA4C;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .today-stats {
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .analytics-container {
        padding: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .kpi-row {
        grid-template-columns: 1fr 1fr;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    .today-strip {
        flex-direction: column;
        gap: 0.75rem;
    }

    .feedback-form {
        flex-direction: column;
    }

    .feedback-inputs {
        flex-direction: column;
    }

    .feedback-form input {
        width: 100%;
    }

    .chart-wrap {
        height: 220px;
    }

    .chart-wrap-sm {
        height: 200px;
    }
}
