﻿:root {
    --ph-brand: #c9a227;
    --ph-brand-dark: #193f6c;
    --ph-brand-light: #f7edc3;
    --ph-brand-soft: #f1f8ff;
    --ph-text: #0f172a;
    --ph-text-soft: #475569;
    --ph-muted: #94a3b8;
    --ph-border: #e2e8f0;
    --ph-surface: #ffffff;
    --ph-surface-soft: #f8fafc;
    --ph-hover: #f1f5f9;
    --ph-danger: #ef4444;
    --ph-warning: #f59e0b;
    --ph-info: #0ea5e9;
    --ph-radius-sm: 12px;
    --ph-radius-md: 16px;
    --ph-radius-lg: 20px;
    --ph-shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
    --ph-shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* =========================================================
   Base
========================================================= */

body {
    background: linear-gradient(180deg, #f8fbf9 0%, #f3f7f5 100%) !important;
    color: var(--ph-text);
}

.section.dashboard {
    padding-top: 6px;
}

.form-label {
    font-size: 0.86rem;
    color: var(--ph-muted);
    font-weight: 700;
}

.form-control,
.form-select {
    border-radius: 12px !important;
    border: 1px solid #e5ebe7 !important;
    background: #fcfdfc !important;
    color: #334155 !important;
    min-height: 42px;
    font-weight: 600;
}

    .form-control::placeholder,
    .form-select::placeholder {
        color: #9aa3b2;
    }

    .form-control:focus,
    .form-select:focus {
        background: #ffffff !important;
        border-color: rgba(22, 163, 74, 0.30) !important;
        box-shadow: 0 0 0 0.2rem rgba(22, 163, 74, 0.12) !important;
    }

.btn {
    font-size: 13px !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
}

.btn-primary {
    background-color: var(--ph-brand) !important;
    border-color: var(--ph-brand) !important;
}

    .btn-primary:hover,
    .btn-primary:focus {
        background-color: var(--ph-brand-dark) !important;
        border-color: var(--ph-brand-dark) !important;
    }

.btn-dark {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 10px 20px rgba(17, 24, 39, 0.18);
}

    .btn-dark:hover,
    .btn-dark:focus {
        transform: translateY(-1px);
        color: #fff !important;
    }

.btn-light {
    background: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

    .btn-light:hover,
    .btn-light:focus {
        background: #f8fafc !important;
        color: #334155 !important;
    }

.card {
    border-radius: var(--ph-radius-md) !important;
    border: 1px solid rgba(17, 24, 39, 0.08) !important;
    box-shadow: var(--ph-shadow-sm) !important;
    background: var(--ph-surface) !important;
}

    .card .card-body {
        padding: 18px !important;
    }

.pagetitle h4 {
    font-weight: 800;
    margin-bottom: 4px;
}

.breadcrumb a {
    color: #bdbdbd;
    text-decoration: none;
}

/* =========================================================
   Tables
========================================================= */

table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.10);
    border-radius: var(--ph-radius-md);
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(17, 24, 39, 0.06);
}

    table thead {
        background: #dfeaf7;
    }

        table thead th {
            color: #1e293b !important;
            font-weight: 700;
        }

    table tbody span {
        font-size: 15px;
    }

.ph-table thead tr th {
    font-size: 15px;
    background-color: #d4d9f0;
    color: #262626;
    text-align: center !important;
    padding: 10px;
}

.ph-table tbody tr td {
    text-align: center;
    font-weight: 500;
}

.namefamily {
    font-size: 14px;
    font-weight: bold;
}

/* Modern readable tables */
.ph-modern-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid #e9eef5;
    border-radius: 14px;
    box-shadow: none;
}

    .ph-modern-table thead th {
        background: linear-gradient(180deg, #faf9f3 0%, #f7f6ed 100%) !important;
        color: #475569 !important;
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: .05em;
        font-weight: 800;
        padding: 13px 12px;
        border-bottom: 1px solid #e3eee6;
        white-space: nowrap;
    }

    .ph-modern-table tbody td {
        padding: 12px;
        border-bottom: 1px solid #f0f3f7;
        color: #334155;
        font-size: 15px;
        vertical-align: middle;
    }

    .ph-modern-table tbody tr:last-child td {
        border-bottom: none;
    }

    .ph-modern-table tbody tr:nth-child(even) {
        background: #fcfefd;
    }

    .ph-modern-table tbody tr:hover {
        background: #f7fbf8;
    }

/* =========================================================
   Badges / Pills
========================================================= */

.ph-badget-sucess {
    background-color: #30b430;
    padding: 2px 4px;
    border-radius: 7px;
    color: #fff;
    font-size: 14px;
    display: block;
}

.ph-badget-warning {
    background-color: #e8964f;
    padding: 3px 10px;
    border-radius: 7px;
    color: #fff;
    font-size: 14px;
}

.ph-badget-danger {
    background-color: #e84f4f;
    padding: 3px 10px;
    border-radius: 7px;
    color: #fff;
    font-size: 14px;
}

.ph-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: .02em;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.04);
}

.ph-status-completed {
    background: #dcfce7;
    color: #15803d;
}

.ph-status-started {
    background: #dbeafe;
    color: #2563eb;
}

.ph-status-new {
    background: #ede9fe;
    color: #7c3aed;
}

.ph-status-cancelled {
    background: #fee2e2;
    color: #dc2626;
}

.ph-status-noshow {
    background: #ffedd5;
    color: #ea580c;
}

.ph-status-neutral {
    background: #e5e7eb;
    color: #374151;
}

/* =========================================================
   Timers / Results
========================================================= */

#timer,
#timer-lead-type {
    font-size: 15px;
    color: #2c3e50;
}

#result,
#result-lead-type {
    font-size: 18px;
    padding: 15px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
}

    #result-lead-type td {
        font-size: 14px;
        font-weight: 600;
    }

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ccc;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   Sidebar
========================================================= */

.modern-sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #fcfdfc 100%);
    border-right: 1px solid var(--ph-border);
    box-shadow: 10px 0 24px rgba(15, 23, 42, 0.04);
}

    .modern-sidebar .sidebar-nav {
        padding: 10px 10px 18px;
    }

    .modern-sidebar .nav-heading,
    .sidebar-nav .nav-heading {
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .08em;
        color: #94a3b8 !important;
        margin: 14px 14px 8px;
    }

    .modern-sidebar .nav-item {
        margin-bottom: 4px;
    }

    .modern-sidebar .nav-link,
    .sidebar-nav .nav-link {
        display: flex;
        align-items: center;
        gap: 10px;
        border-radius: 12px !important;
        padding: 11px 14px !important;
        min-height: 44px;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.2;
        color: var(--ph-text) !important;
        background: transparent;
        transition: all 0.18s ease;
    }

        .modern-sidebar .nav-link span {
            color: inherit;
        }

        .modern-sidebar .nav-link i,
        .sidebar-nav .nav-link i {
            font-size: 17px;
            width: 18px;
            min-width: 18px;
            color: #64748b !important;
            transition: all 0.18s ease;
        }

        .modern-sidebar .nav-link:hover,
        .sidebar-nav .nav-link:hover {
            background: var(--ph-hover) !important;
            color: var(--ph-text) !important;
        }

            .modern-sidebar .nav-link:hover i,
            .sidebar-nav .nav-link:hover i {
                color: var(--ph-brand) !important;
            }

        .modern-sidebar .nav-link:not(.collapsed),
        .sidebar-nav .nav-link:not(.collapsed) {
            background: var(--ph-brand-soft) !important;
            color: var(--ph-brand-dark) !important;
            box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.10);
        }

            .modern-sidebar .nav-link:not(.collapsed) i,
            .sidebar-nav .nav-link:not(.collapsed) i {
                color: var(--ph-brand) !important;
            }

    .modern-sidebar .nav-content {
        padding: 4px 0 2px 6px;
        margin-top: 2px;
        margin-bottom: 4px;
    }

        .modern-sidebar .nav-content li {
            margin-bottom: 2px;
        }

            .modern-sidebar .nav-content li a,
            .sidebar-nav .nav-content a {
                display: flex;
                align-items: center;
                gap: 10px;
                border-radius: 10px;
                padding: 9px 12px 9px 14px;
                font-size: 14px;
                font-weight: 600;
                line-height: 1.2;
                color: var(--ph-text-soft) !important;
                transition: all 0.18s ease;
                position: relative;
            }

                .modern-sidebar .nav-content li a i,
                .sidebar-nav .nav-content a i {
                    font-size: 5px;
                    width: 8px;
                    min-width: 8px;
                    color: #cfd8e3 !important;
                    transition: all 0.18s ease;
                    opacity: .9;
                }

                .modern-sidebar .nav-content li a:hover,
                .sidebar-nav .nav-content a:hover {
                    background: var(--ph-surface-soft);
                    color: var(--ph-text) !important;
                }

                    .modern-sidebar .nav-content li a:hover i,
                    .sidebar-nav .nav-content a:hover i {
                        color: var(--ph-brand) !important;
                    }

                .modern-sidebar .nav-content li a.active,
                .sidebar-nav .nav-content a.active {
                    background: transparent !important;
                    color: #111827 !important;
                    font-weight: 800;
                    box-shadow: none !important;
                    padding-left: 14px !important;
                }

                    .modern-sidebar .nav-content li a.active i,
                    .sidebar-nav .nav-content a.active i {
                        color: var(--ph-brand) !important;
                    }

    .modern-sidebar .bi-chevron-down {
        margin-left: auto;
        font-size: 13px !important;
    }

    .modern-sidebar .nav-link.collapsed .bi-chevron-down {
        transform: rotate(-90deg);
        transition: transform .2s ease;
    }

    .modern-sidebar .nav-link:not(.collapsed) .bi-chevron-down {
        transform: rotate(0deg);
        transition: transform .2s ease;
    }

/* =========================================================
   Shared Dashboard Components
========================================================= */

.ph-page-header {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 18px;
    margin-bottom: 18px;
}

.ph-page-header-left h4 {
    font-size: 32px;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.ph-page-header-left p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

.ph-page-header-right {
    min-width: 220px;
}

.ph-range-card {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border: 1px solid rgba(22, 163, 74, 0.10);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 10px 24px #dfeaf7;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ph-range-card-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #9aa3b2;
    font-weight: 800;
}

.ph-range-card strong {
    font-size: 16px;
    color: var(--ph-brand-dark);
    font-weight: 800;
}

.ph-range-card small {
    color: #a0a8b7;
    font-size: 11px;
    line-height: 1.4;
}

.ph-filter-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfb 100%) !important;
    border: 1px solid #dfeaf7 !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05) !important;
    border-radius: 18px !important;
    overflow: hidden;
}

.ph-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
    gap: 14px;
    align-items: end;
}

.ph-filter-item label {
    margin-bottom: 6px;
}

.ph-filter-actions {
    display: flex;
    align-items: end;
    gap: 10px;
    height: 100%;
}

.ph-btn-dark {
    border-radius: 10px !important;
    padding: 10px 18px !important;
    font-weight: 700 !important;
}

.ph-btn-light {
    border-radius: 10px !important;
    padding: 10px 18px !important;
    font-weight: 700 !important;
    background: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

    .ph-btn-light:hover {
        background: #f8fafc !important;
    }

.ph-dashboard-card {
    background: linear-gradient(180deg, #ffffff 0%, #fcfdfc 100%) !important;
    border: 1px solid rgba(22, 163, 74, 0.07) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05) !important;
    border-radius: 18px !important;
}

.ph-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 18px;
    border-bottom: 1px solid #dfeaf7;
}

    .ph-section-head .card-title {
        font-size: 20px !important;
        font-weight: 800 !important;
        color: #22304a !important;
        margin-bottom: 2px !important;
    }

.ph-section-subtitle {
    display: inline-block;
    color: #8a94a6;
    font-size: 12px;
    margin-top: -4px;
}

.ph-section-loading {
    color: #6b7280;
    font-size: 15px;
    padding: 10px 0;
}

.ph-summary-grid .col-xl-3,
.ph-summary-grid .col-md-6 {
    margin-bottom: 14px;
}

.ph-kpi-card {
    border-radius: 18px;
    padding: 18px 18px 16px;
    min-height: 112px;
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    transition: transform .18s ease, box-shadow .18s ease;
}

    .ph-kpi-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    }

.ph-summary-grid > div:nth-child(1) .ph-kpi-card {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}

.ph-summary-grid > div:nth-child(2) .ph-kpi-card {
    background: linear-gradient(135deg, #ecfdf3 0%, #ffffff 100%);
}

.ph-summary-grid > div:nth-child(3) .ph-kpi-card {
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
}

.ph-summary-grid > div:nth-child(4) .ph-kpi-card {
    background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 100%);
}

.ph-summary-grid > div:nth-child(5) .ph-kpi-card {
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.ph-summary-grid > div:nth-child(6) .ph-kpi-card {
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
}

.ph-summary-grid > div:nth-child(7) .ph-kpi-card {
    background: linear-gradient(135deg, #ecfdf3 0%, #f0fdf4 100%);
}

.ph-summary-grid > div:nth-child(8) .ph-kpi-card {
    background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%);
}

.ph-kpi-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #7c8aa0;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 12px;
}

.ph-kpi-card h3 {
    margin: 0;
    font-size: 38px;
    line-height: 1;
    font-weight: 900;
    color: #1f2a44;
}

.ph-pagination-wrap {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.ph-modern-pagination {
    gap: 8px;
    margin-bottom: 0;
}

    .ph-modern-pagination .page-item .page-link {
        border-radius: 12px !important;
        border: 1px solid #dbe5de !important;
        background: #ffffff !important;
        color: #334155 !important;
        min-width: 40px;
        height: 40px;
        font-weight: 800;
        transition: all .18s ease;
        box-shadow: none !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .ph-modern-pagination .page-item .page-link:hover {
            background: #f0fdf4 !important;
            color: var(--ph-brand-dark) !important;
            border-color: rgba(22, 163, 74, 0.25) !important;
        }

    .ph-modern-pagination .page-item.active .page-link {
        background: linear-gradient(135deg, var(--ph-brand) 0%, var(--ph-brand-dark) 100%) !important;
        color: #fff !important;
        border-color: var(--ph-brand) !important;
        box-shadow: 0 10px 20px rgba(22, 163, 74, 0.18);
    }

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 1200px) {
    .ph-filter-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .ph-filter-actions {
        grid-column: span 3;
    }
}

@media (max-width: 768px) {
    .ph-page-header {
        flex-direction: column;
    }

    .ph-filter-grid {
        grid-template-columns: 1fr;
    }

    .ph-filter-actions {
        grid-column: auto;
        justify-content: flex-start;
    }

    .ph-kpi-card h3 {
        font-size: 28px;
    }
}

/* =========================================
   Executive KPI Bar
========================================= */

.ph-executive-wrapper {
    background: linear-gradient(180deg, #ffffff 0%, #fffdf7 100%) !important;
    border: 1px solid rgba(201, 162, 39, 0.10) !important;
}

.ph-executive-grid .col-xl-3,
.ph-executive-grid .col-md-6 {
    margin-bottom: 14px;
}

.ph-executive-card {
    position: relative;
    border-radius: 18px;
    padding: 20px 20px 18px;
    min-height: 132px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.45);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    transition: transform .18s ease, box-shadow .18s ease;
}

    .ph-executive-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.09);
    }

    .ph-executive-card::after {
        content: "";
        position: absolute;
        right: -20px;
        top: -20px;
        width: 90px;
        height: 90px;
        border-radius: 999px;
        background: rgba(255,255,255,0.25);
    }

.ph-executive-card-customers {
    background: linear-gradient(135deg, #eef6ff 0%, #ffffff 100%);
}

.ph-executive-card-revenue {
    background: linear-gradient(135deg, #f6f0dd 0%, #fffdf7 100%);
}

.ph-executive-card-lost {
    background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%);
}

.ph-executive-card-conversion {
    background: linear-gradient(135deg, #ecfdf3 0%, #ffffff 100%);
}

.ph-executive-top {
    margin-bottom: 12px;
}

.ph-executive-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #7c8aa0;
}

.ph-executive-value {
    font-size: 40px;
    line-height: 1;
    font-weight: 900;
    color: #172033;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
}

.ph-executive-subtitle {
    color: #7b8798;
    font-size: 12px;
    font-weight: 600;
}