/* ==========================================================
   S'GELAHUB PRINCIPAL COMMAND CENTRE
========================================================== */

.sgh-principal-dashboard {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, .12), transparent 34%),
        radial-gradient(circle at bottom right, rgba(168, 85, 247, .10), transparent 34%),
        #0f172a;
    border-radius: 20px;
}

.sgh-principal-dashboard .sgh-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    color: #f8fafc;
}

.sgh-principal-dashboard .sgh-card > .sgh-card,
.sgh-principal-dashboard .sgh-card .sgh-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    margin-left: auto !important;
    margin-right: auto !important;
}

.sgh-principal-dashboard .sgh-grid,
.sgh-principal-dashboard [class*='grid'] {
    min-width: 0;
}

.sgh-principal-dashboard .sgh-grid > *,
.sgh-principal-dashboard [class*='grid'] > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.sgh-principal-dashboard .sgh-card h1,
.sgh-principal-dashboard .sgh-card h2,
.sgh-principal-dashboard .sgh-card h3,
.sgh-principal-dashboard .sgh-card h4,
.sgh-principal-dashboard .sgh-card strong {
    color: #fff;
}

.sgh-principal-dashboard .sgh-card p,
.sgh-principal-dashboard .sgh-card label,
.sgh-principal-dashboard .sgh-card small,
.sgh-principal-dashboard .sgh-muted {
    color: rgba(255, 255, 255, .72);
}

.sgh-principal-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.sgh-eyebrow {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #93c5fd;
    font-weight: 700;
}

.sgh-principal-hero h1,
.sgh-principal-quick-actions h2,
.sgh-principal-section h2 {
    margin-top: 0;
}

.sgh-principal-health-hero {
    min-width: 190px;
    padding: 18px 22px;
    border-radius: 18px;
    text-decoration: none;
    background: rgba(34, 197, 94, .10);
    border: 1px solid rgba(34, 197, 94, .26);
    color: #fff;
    text-align: center;
}

.sgh-principal-health-hero span,
.sgh-principal-health-hero small {
    display: block;
    color: #bbf7d0;
}

.sgh-principal-health-hero strong {
    display: block;
    margin: 2px 0;
    font-size: 34px;
    line-height: 1;
}

.sgh-principal-health-hero:hover {
    transform: translateY(-1px);
}

.sgh-principal-quick-actions {
    margin-bottom: 18px;
}

.sgh-principal-action-row {
    display: grid;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.sgh-principal-action {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 700;
    text-align: center;
}

.sgh-principal-action:hover,
.sgh-principal-action.is-active {
    background: rgba(59,130,246,.18);
    border-color: rgba(96,165,250,.42);
    color: #fff;
}

.sgh-principal-overview-grid {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.sgh-principal-dashboard .stat h2 {
    margin: 2px 0 0;
    font-size: 30px;
}

.sgh-principal-dashboard .stat.danger h2 {
    color: #fca5a5;
}

.sgh-principal-section {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    gap: 16px;
}

.sgh-principal-two-column {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.sgh-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.sgh-section-heading h2 {
    margin-bottom: 0;
}

.sgh-principal-attention-list,
.sgh-health-actions,
.sgh-principal-timetable-grid,
.sgh-health-component-grid {
    display: grid;
    gap: 10px;
}

.sgh-principal-attention-item,
.sgh-health-action,
.sgh-overdue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
}

.sgh-principal-attention-item span,
.sgh-overdue-item span {
    display: block;
    margin-top: 3px;
    color: rgba(255,255,255,.65);
    font-size: 12px;
}

.sgh-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(59,130,246,.16);
    color: #bfdbfe;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.sgh-badge-danger {
    background: rgba(239,68,68,.14);
    color: #fecaca;
}

.sgh-principal-notice {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 600;
}

.sgh-notice-success {
    background: rgba(34,197,94,.11);
    border: 1px solid rgba(34,197,94,.22);
    color: #bbf7d0;
}

.sgh-notice-error {
    background: rgba(239,68,68,.11);
    border: 1px solid rgba(239,68,68,.22);
    color: #fecaca;
}

.sgh-health-summary {
    display: grid;
    gap: 16px;
}

.sgh-health-summary h2 {
    margin: 0;
    font-size: 44px;
}

.sgh-health-progress {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,.08);
}

.sgh-health-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #4ade80;
}

.sgh-health-component-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sgh-health-component {
    padding: 14px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    background: rgba(255,255,255,.035);
}

.sgh-health-component-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.sgh-health-component p {
    margin-bottom: 0;
}

.sgh-health-action p {
    margin: 4px 0 0;
    font-size: 13px;
}

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

.sgh-principal-table {
    width: 100%;
    border-collapse: collapse;
}

.sgh-principal-table th,
.sgh-principal-table td {
    padding: 11px 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-align: left;
}

.sgh-principal-table th {
    color: #fff;
    background: rgba(255,255,255,.04);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sgh-principal-table td {
    color: rgba(255,255,255,.82);
}

.sgh-positive { color: #86efac !important; }
.sgh-negative { color: #fca5a5 !important; }
.sgh-success-text { color: #bbf7d0 !important; font-weight: 600; }

.sgh-principal-note {
    color: rgba(255,255,255,.72);
}

.sgh-principal-timetable-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sgh-day-card {
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}

.sgh-day-header {
    padding: 12px 14px;
    font-weight: 700;
    color: #fff;
    background: rgba(255,255,255,.045);
}

.sgh-day-body {
    padding: 12px;
}

.sgh-period {
    display: flex;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,.035);
}

.sgh-period:last-child { margin-bottom: 0; }

.sgh-period-time {
    min-width: 72px;
    color: #93c5fd;
    font-size: 12px;
    font-weight: 700;
}

.sgh-period-content {
    display: grid;
    gap: 3px;
}

.sgh-period-content span {
    color: rgba(255,255,255,.65);
    font-size: 12px;
}

.sgh-finance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.sgh-finance-grid > div {
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.035);
}

.sgh-finance-grid span,
.sgh-finance-grid strong {
    display: block;
}

.sgh-finance-grid span {
    font-size: 11px;
    color: rgba(255,255,255,.62);
}

.sgh-finance-grid strong {
    margin-top: 4px;
    font-size: 18px;
}

.sgh-principal-link-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.sgh-principal-dashboard input,
.sgh-principal-dashboard select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 9px;
    background: rgba(255,255,255,.05);
    color: #fff;
}

.sgh-principal-dashboard select option {
    background: #0f172a;
    color: #fff;
}

.sgh-principal-bank-form {
    display: grid;
    gap: 10px;
}

.sgh-principal-payout-form {
    display: grid;
    gap: 10px;
}

.sgh-inline-form {
    margin: 0;
}

.sgh-btn-secondary {
    opacity: .9;
}

@media (max-width: 1000px) {
    .sgh-principal-action-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sgh-principal-two-column,
    .sgh-principal-timetable-grid,
    .sgh-health-component-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .sgh-principal-dashboard {
        width: min(100%, 100vw);
        max-width: 100vw;
        margin-left: auto;
        margin-right: auto;
        overflow-x: hidden;

        padding: 12px;
        border-radius: 14px;
    }

    .sgh-principal-action-row,
    .sgh-principal-overview-grid,
    .sgh-finance-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sgh-principal-overview-grid,
    .sgh-principal-action-row,
    .sgh-principal-section,
    .sgh-principal-two-column,
    .sgh-finance-grid {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }

    .sgh-principal-dashboard .sgh-card {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .sgh-principal-link-row {
        grid-template-columns: 1fr;
    }

    .sgh-principal-attention-item,
    .sgh-health-action,
    .sgh-overdue-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .sgh-period {
        flex-direction: column;
    }
}
