* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    padding: 0;
}


body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: #f5f7fb;

    color: #1f2937;
}


a {
    color: inherit;
}


/* =========================================================
   APP
   ========================================================= */

.app {
    display: flex;

    min-height: 100vh;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    width: 250px;

    min-height: 100vh;

    background: #111827;

    color: white;

    padding: 24px 16px;

    flex-shrink: 0;
}


.logo {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 0 10px 30px;
}


.logo-icon {
    width: 42px;
    height: 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: #6366f1;

    color: white;

    font-weight: 700;

    font-size: 20px;
}


.logo strong {
    display: block;

    font-size: 16px;
}


.logo span {
    display: block;

    margin-top: 3px;

    color: #9ca3af;

    font-size: 11px;
}


.nav-item {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 12px 14px;

    margin-bottom: 4px;

    border-radius: 8px;

    color: #d1d5db;

    text-decoration: none;

    transition:
        background .15s,
        color .15s;
}


.nav-item:hover {
    background: #1f2937;

    color: white;
}


.nav-item.active {
    background: #6366f1;

    color: white;
}


.nav-item span {
    width: 20px;

    text-align: center;

    font-size: 16px;
}


.nav-divider {
    height: 1px;

    background: #374151;

    margin: 20px 10px;
}


.nav-item.logout {
    color: #fca5a5;
}


.nav-item.logout:hover {
    background: #3f1d1d;
}


/* =========================================================
   MAIN
   ========================================================= */

.main {
    flex: 1;

    min-width: 0;

    padding: 32px;
}


.topbar {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 30px;
}


.topbar h1 {
    margin: 0 0 5px;

    font-size: 28px;
}


.topbar p {
    margin: 0;

    color: #6b7280;
}


.user-menu {
    display: flex;

    align-items: center;

    gap: 10px;

    font-size: 14px;
}


.avatar {
    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #6366f1;

    color: white;

    font-weight: 700;
}


/* =========================================================
   STATISTICS
   ========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 18px;

    margin-bottom: 24px;
}


.stat-card {
    display: flex;

    align-items: center;

    gap: 15px;

    padding: 20px;

    background: white;

    border: 1px solid #e5e7eb;

    border-radius: 12px;
}


.stat-icon {
    width: 48px;
    height: 48px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: #eef2ff;

    color: #4f46e5;

    font-size: 20px;
}


.stat-label {
    display: block;

    color: #6b7280;

    font-size: 13px;

    margin-bottom: 5px;
}


.stat-card strong {
    display: block;

    font-size: 25px;

    line-height: 1;
}


/* =========================================================
   DASHBOARD GRID
   ========================================================= */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        2fr 1fr;

    gap: 24px;

    margin-bottom: 24px;
}


/* =========================================================
   CARDS
   ========================================================= */

.card {
    background: white;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

    overflow: hidden;
}


.card-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    padding: 20px;

    border-bottom: 1px solid #e5e7eb;
}


.card-header h2 {
    margin: 0 0 4px;

    font-size: 17px;
}


.card-header p {
    margin: 0;

    color: #6b7280;

    font-size: 13px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.button {
    display: inline-block;

    padding: 8px 14px;

    border: 0;

    border-radius: 7px;

    text-decoration: none;

    font-family: inherit;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;
}


.button-primary {
    background: #6366f1;

    color: white;
}


.button-primary:hover {
    background: #4f46e5;
}


.button-secondary {
    background: #f3f4f6;

    color: #374151;
}


.button-secondary:hover {
    background: #e5e7eb;
}


.button-full {
    width: 100%;

    text-align: center;
}


/* =========================================================
   TABLE
   ========================================================= */

.table-wrapper {
    overflow-x: auto;
}


table {
    width: 100%;

    border-collapse: collapse;
}


th {
    padding: 12px 20px;

    background: #f9fafb;

    color: #6b7280;

    text-align: left;

    font-size: 11px;

    text-transform: uppercase;

    letter-spacing: .04em;
}


td {
    padding: 14px 20px;

    border-top: 1px solid #f0f0f0;

    font-size: 13px;
}


td small {
    display: block;

    margin-top: 3px;

    color: #9ca3af;
}


tbody tr:hover {
    background: #fafafa;
}


/* =========================================================
   STATUS
   ========================================================= */

.status {
    display: inline-block;

    padding: 4px 9px;

    border-radius: 20px;

    background: #f3f4f6;

    color: #4b5563;

    font-size: 11px;

    white-space: nowrap;
}


.status-confirmed,
.status-active,
.status-on_sale {
    background: #dcfce7;

    color: #166534;
}


.status-proposed,
.status-draft {
    background: #fef3c7;

    color: #92400e;
}


.status-sold_out {
    background: #fee2e2;

    color: #991b1b;
}


/* =========================================================
   EMPTY
   ========================================================= */

.empty {
    padding: 35px 20px;

    text-align: center;

    color: #9ca3af;
}


/* =========================================================
   VENUE LIST
   ========================================================= */

.venue-list {
    padding: 8px 0;
}


.venue-item {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 12px 20px;

    text-decoration: none;

    border-bottom: 1px solid #f0f0f0;
}


.venue-item:last-child {
    border-bottom: 0;
}


.venue-item:hover {
    background: #fafafa;
}


.venue-avatar {
    width: 40px;
    height: 40px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: #eef2ff;

    color: #4f46e5;

    font-weight: 700;
}


.venue-info {
    min-width: 0;

    flex: 1;
}


.venue-info strong {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    font-size: 13px;
}


.venue-info span {
    display: block;

    margin-top: 3px;

    color: #9ca3af;

    font-size: 12px;
}


/* =========================================================
   ACTIVITY
   ========================================================= */

.activity-list {
    padding: 10px 20px;
}


.activity-item {
    display: flex;

    align-items: center;

    gap: 14px;

    padding: 15px 0;

    border-bottom: 1px solid #f0f0f0;
}


.activity-item:last-child {
    border-bottom: 0;
}


.activity-icon {
    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #eef2ff;

    color: #4f46e5;

    font-weight: 700;
}


.activity-item strong {
    display: block;

    font-size: 18px;
}


.activity-item span {
    display: block;

    margin-top: 2px;

    color: #6b7280;

    font-size: 12px;
}


/* =========================================================
   CAMPAIGNS
   ========================================================= */

.campaign-summary {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 1px;

    background: #e5e7eb;

    margin: 20px;
}


.campaign-stat {
    padding: 18px;

    background: white;

    text-align: center;
}


.campaign-stat span {
    display: block;

    color: #6b7280;

    font-size: 12px;
}


.campaign-stat strong {
    display: block;

    margin-top: 5px;

    font-size: 24px;
}


.campaign-action {
    padding: 0 20px 20px;
}


/* =========================================================
   QUICK ACTIONS
   ========================================================= */

.quick-actions {
    margin-top: 10px;
}


.section-title {
    margin-bottom: 15px;
}


.section-title h2 {
    margin: 0 0 4px;

    font-size: 18px;
}


.section-title p {
    margin: 0;

    color: #6b7280;

    font-size: 13px;
}


.quick-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 15px;
}


.quick-action {
    display: block;

    padding: 20px;

    background: white;

    border: 1px solid #e5e7eb;

    border-radius: 10px;

    text-decoration: none;

    transition:
        transform .15s,
        box-shadow .15s;
}


.quick-action:hover {
    transform: translateY(-2px);

    box-shadow:
        0 5px 15px
        rgba(0, 0, 0, .06);
}


.quick-icon {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 50px;
    height: 38px;

    margin-bottom: 12px;

    border-radius: 8px;

    background: #eef2ff;

    color: #4f46e5;

    font-size: 20px;
}


.quick-action strong {
    display: block;

    font-size: 14px;
}


.quick-action small {
    display: block;

    margin-top: 4px;

    color: #9ca3af;

    font-size: 12px;
}


/* =========================================================
   LOGIN
   ========================================================= */

.login-page {
    min-height: 100vh;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background: #111827;
}


.login-container {
    width: 100%;

    max-width: 420px;
}


.login-card {
    padding: 40px;

    background: white;

    border-radius: 14px;

    box-shadow:
        0 20px 50px
        rgba(0, 0, 0, .25);
}


.login-logo {
    text-align: center;

    margin-bottom: 30px;
}


.login-logo .logo-icon {
    margin: 0 auto 15px;
}


.login-logo h1 {
    margin: 0;

    font-size: 24px;
}


.login-logo p {
    margin: 5px 0 0;

    color: #6b7280;

    font-size: 13px;
}


/* =========================================================
   ALERT
   ========================================================= */

.alert {
    padding: 12px 14px;

    margin-bottom: 20px;

    border-radius: 8px;

    font-size: 13px;
}


.alert-error {
    background: #fee2e2;

    color: #991b1b;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {

    .stats-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }


    .quick-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

}


@media (max-width: 850px) {

    .sidebar {
        width: 210px;
    }


    .main {
        padding: 24px;
    }


    .dashboard-grid {
        grid-template-columns:
            1fr;
    }

}


@media (max-width: 650px) {

    .app {
        display: block;
    }


    .sidebar {
        width: 100%;

        min-height: auto;

        padding: 12px;
    }


    .logo {
        padding-bottom: 15px;
    }


    .sidebar nav {
        display: flex;

        gap: 5px;

        overflow-x: auto;
    }


    .nav-item {
        flex-shrink: 0;

        margin: 0;
    }


    .nav-divider {
        display: none;
    }


    .main {
        padding: 20px 15px;
    }


    .topbar {
        align-items: flex-start;
    }


    .user-menu span {
        display: none;
    }


    .stats-grid {
        grid-template-columns:
            1fr;
    }


    .quick-grid {
        grid-template-columns:
            1fr;
    }


    .card-header {
        align-items: flex-start;
    }

}

/* =========================================================
   RICH PERFORMANCE POPUP
========================================================= */

.performance-modal-heading {
    min-width: 0;
}


.performance-modal-heading h2 {
    margin: 0;
    padding-right: 20px;

    font-size: 25px;
    line-height: 1.25;

    color: #111827;
}


.popup-status-badge {

    display: inline-flex;

    align-items: center;

    margin-top: 10px;

    padding: 5px 10px;

    border-radius: 999px;

    background: #eff6ff;

    color: #2563eb;

    font-size: 11px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: .5px;
}


.popup-status-badge.confirmed {

    background: #ecfdf5;

    color: #047857;
}


.popup-status-badge.on_sale {

    background: #eff6ff;

    color: #2563eb;
}


.popup-status-badge.sold_out {

    background: #fff7ed;

    color: #c2410c;
}


.popup-status-badge.cancelled {

    background: #fef2f2;

    color: #b91c1c;
}


.performance-detail-wide {

    grid-column: 1 / -1;
}


.detail-subvalue {

    margin-top: 4px;

    color: #64748b;

    font-size: 13px;

    line-height: 1.45;
}


.detail-value a {

    display: inline-flex;

    align-items: center;

    gap: 5px;
}


.external-arrow {

    font-size: 15px;
}


.performance-notes {

    border-top: 1px solid #f1f5f9;
}


.notes-content.empty {

    color: #94a3b8;

    font-style: italic;
}


.performance-modal-footer {

    justify-content: flex-end;

    gap: 8px;
}


.performance-modal-footer .btn {

    min-height: 40px;

    padding: 0 15px;
}


@media (max-width: 650px) {

    .performance-detail-wide {

        grid-column: auto;
    }

    .performance-modal-heading h2 {

        font-size: 21px;

    }

    .performance-modal-footer {

        flex-direction: column;

        align-items: stretch;

    }

    .performance-modal-footer .btn {

        width: 100%;

    }

}