﻿.portal-app {
    background: #eceff3;
    color: #1f2937;
}

.portal-shell {
    display: flex;
    min-height: 100vh;
}

.portal-sidebar {
    width: 250px;
    background: #eef1f5;
    border-right: 1px solid #d9dee7;
    padding: 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.portal-main {
    flex: 1;
    padding: 18px;
    max-width: calc(100vw - 250px);
}

.portal-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.portal-nav-head {
    background: #fff;
    border: 1px solid #d9dee7;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 4px;
}

.portal-nav-title { font-weight: 700; }
.portal-nav-build { font-size: 12px; color: #6b7280; }

.portal-link {
    border: 1px solid #d9dee7;
    background: #fff;
    color: #111827;
    text-decoration: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 14px;
}

.portal-link.active {
    background: #df1c28;
    border-color: #df1c28;
    color: #fff;
}

.portal-link-inline { color: #df1c28; text-decoration: none; font-weight: 600; }
.portal-logout-form { margin-top: 12px; }
.portal-logout { width: 100%; border: 1px solid #d9dee7; background: #fff; border-radius: 12px; padding: 10px 14px; font-weight: 600; }

.portal-page-header,
.portal-card {
    background: #fff;
    border: 1px solid #d9dee7;
    border-radius: 14px;
    padding: 16px;
}

.portal-settings-card { padding: 14px; }
.portal-page-header { margin-bottom: 14px; }

.portal-title {
    margin: 0;
    font-size: 42px;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.portal-subtitle { margin: 6px 0 0; color: #6b7280; }
.portal-subsection-title { font-size: 24px; font-weight: 700; margin: 0 0 8px; }
.portal-content { display: flex; flex-direction: column; gap: 14px; }

.portal-grid-4 { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.portal-grid-3 { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.portal-grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.portal-kpi { background: #fff; border: 1px solid #d9dee7; border-radius: 12px; padding: 12px; display: grid; gap: 4px; }
.portal-kpi span { color: #6b7280; font-size: 12px; font-weight: 600; }
.portal-kpi strong { font-size: 30px; line-height: 1; }

.portal-card-title { margin: 0 0 10px; font-size: 32px; font-weight: 700; }
.portal-section-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }

.portal-table-wrap { overflow-x: auto; }
.portal-table-wrap.dense .portal-table th,
.portal-table-wrap.dense .portal-table td { padding-top: 8px; padding-bottom: 8px; }

.portal-table { width: 100%; border-collapse: collapse; }
.portal-table th,
.portal-table td { text-align: left; padding: 11px 8px; border-bottom: 1px solid #e5e7eb; }
.portal-table th { font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: .02em; }

.portal-right { text-align: right !important; }
.portal-toolbar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.portal-toolbar-wrap { flex-wrap: wrap; }

.portal-btn {
    border-radius: 999px;
    padding: 7px 14px;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #df1c28;
    cursor: pointer;
    line-height: 1.2;
}

.portal-btn-primary { background: #df1c28; color: #fff; }
.portal-btn-outline { background: #fff; color: #df1c28; }
.portal-muted { color: #6b7280; }

.portal-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.portal-tabs a,
.portal-tabs span { border: 1px solid #d1d5db; border-radius: 999px; padding: 7px 12px; background: #fff; font-weight: 600; font-size: 13px; color: #111827; text-decoration: none; }
.portal-tabs a.active,
.portal-tabs span.active { border-color: #df1c28; background: #df1c28; color: #fff; }

.portal-panel { border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px; background: #fff; }
.portal-panel.compact { padding: 10px 12px; }
.portal-pagination nav { margin-top: 12px; }

.portal-badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.portal-badge { border: 1px solid #d1d5db; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 4px 10px; background: #f9fafb; }
.portal-warning-box { border: 1px solid #fca5a5; background: #fff1f2; border-radius: 12px; padding: 10px 12px; }
.portal-warning-box ul { margin: 8px 0 0 18px; padding: 0; }

.portal-topbar { height: 56px; padding: 0 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #e5e7eb; background: #fff; }
.portal-logo { height: 26px; width: auto; display: block; }
.portal-brand,
.portal-auth-brand { font-weight: 700; color: #111827; }
.portal-auth-brand { text-decoration: none; }

.portal-input,
.portal-input-small,
.portal-textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 10px; background: #fff; padding: 10px 12px; }
.portal-input-small { width: auto; }
.portal-label { display: block; margin-bottom: 6px; font-size: 12px; color: #6b7280; font-weight: 600; }
.portal-inline-form { display: flex; gap: 8px; align-items: center; }

.portal-calendar-head { font-size: 44px; font-weight: 800; margin: 12px 0; }
.portal-upcoming-box { border: 1px solid #d9dee7; background: #f8fafc; border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.portal-upcoming-box ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.portal-upcoming-box li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }

.portal-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid #d9dee7; border-radius: 12px; overflow: hidden; }
.portal-day-name { background: #f3f4f6; border-bottom: 1px solid #d9dee7; border-right: 1px solid #d9dee7; padding: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: #6b7280; }
.portal-day-name:nth-child(7) { border-right: none; }
.portal-day-cell { min-height: 120px; border-right: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; padding: 8px; background: #fff; }
.portal-day-cell.outside { background: #f8fafc; color: #9ca3af; }
.portal-day-cell.today { background: #fff2f2; }
.portal-day-number { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.portal-day-events { display: grid; gap: 4px; }
.portal-day-pill { display: block; border: 1px solid #dbeafe; background: #eff6ff; border-radius: 999px; padding: 3px 8px; font-size: 11px; color: #1f2937; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-more { font-size: 11px; color: #6b7280; }

.portal-event-list { display: grid; gap: 12px; }
.portal-event-card { background: #f8fafc; border: 1px solid #d9dee7; border-radius: 12px; padding: 12px; display: flex; justify-content: space-between; gap: 12px; }
.portal-event-main { flex: 1; }
.portal-event-date { color: #6b7280; font-size: 12px; font-weight: 700; }
.portal-event-title { margin: 4px 0 8px; font-size: 20px; font-weight: 700; }
.portal-event-meta { display: flex; flex-wrap: wrap; gap: 12px; color: #4b5563; font-size: 13px; }
.portal-event-side { display: grid; gap: 8px; align-content: start; justify-items: end; }
.portal-status { border: 1px solid #df1c28; color: #df1c28; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }

.portal-song { border: 1px solid #d1d5db; border-radius: 12px; padding: 12px; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 10px; }
.portal-song.must { background: #ebf8ef; border-color: #84cc9a; }
.portal-song.avoid { background: #fdecee; border-color: #fca5a5; }
.portal-song.maybe { background: #e8f0ff; border-color: #93c5fd; }

.portal-modal { border: none; background: transparent; padding: 0; }
.portal-modal::backdrop { background: rgba(0, 0, 0, 0.4); }
.portal-modal-card { width: min(980px, 92vw); max-height: 86vh; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; background: #fff; border-radius: 14px; border: 1px solid #d9dee7; padding: 16px; }
.portal-modal-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e5e7eb; padding-bottom: 8px; }
.portal-modal-head h3 { margin: 0; font-size: 38px; }
.portal-modal-close { border: 1px solid #df1c28; background: #df1c28; color: #fff; border-radius: 10px; width: 32px; height: 32px; font-weight: 700; }
.portal-modal-scroll { overflow: auto; display: grid; gap: 10px; padding-right: 4px; }
.portal-modal-actions { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid #e5e7eb; padding-top: 10px; }

@media (max-width: 1024px) {
    .portal-shell { flex-direction: column; }
    .portal-sidebar { width: 100%; height: auto; position: static; }
    .portal-main { max-width: 100%; }
    .portal-grid-4,
    .portal-grid-3,
    .portal-grid-2 { grid-template-columns: 1fr; }
    .portal-inline-form { flex-wrap: wrap; }
    .portal-title { font-size: 30px; }
    .portal-month-grid { grid-template-columns: 1fr; }
    .portal-day-name { display: none; }
    .portal-event-card { flex-direction: column; }
    .portal-event-side { justify-items: start; }
    .portal-modal-head h3 { font-size: 30px; }
}

.portal-mobile-toggle,
.portal-mobile-backdrop {
    display: none;
}

@media (max-width: 1024px) {
    .portal-shell {
        flex-direction: column;
    }

    .portal-sidebar {
        width: min(280px, 84vw);
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 60;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: 0 0 0 rgba(0,0,0,0);
        overflow-y: auto;
    }

    .portal-main {
        max-width: 100%;
        width: 100%;
        padding-top: 68px;
    }

    .portal-mobile-toggle {
        display: inline-flex;
        position: fixed;
        left: 12px;
        top: 10px;
        z-index: 70;
        background: #df1c28;
        color: #fff;
        border: 1px solid #df1c28;
        border-radius: 999px;
        padding: 8px 12px;
        font-size: 13px;
        font-weight: 700;
    }

    .portal-mobile-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 55;
        border: 0;
        background: rgba(0,0,0,.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    body.portal-menu-open .portal-sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,.18);
    }

    body.portal-menu-open .portal-mobile-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.portal-menu-open {
        overflow: hidden;
    }

    .portal-grid-4,
    .portal-grid-3,
    .portal-grid-2 {
        grid-template-columns: 1fr;
    }

    .portal-inline-form {
        flex-wrap: wrap;
    }

    .portal-title {
        font-size: 30px;
    }

    .portal-month-grid {
        grid-template-columns: 1fr;
    }

    .portal-day-name {
        display: none;
    }

    .portal-event-card {
        flex-direction: column;
    }

    .portal-event-side {
        justify-items: start;
    }

    .portal-modal-head h3 {
        font-size: 30px;
    }
}
