:root {
    --app-header-height: 75px;
    --portal-text: #1f2937;
    --portal-text-muted: #64748b;
    --portal-text-subtle: #94a3b8;
    --portal-border: #dbe3ef;
    --portal-border-light: #e2e8f0;
    --portal-surface: #ffffff;
    --portal-surface-muted: #f8fafc;
    --portal-bg: #f1f3f6;
    --portal-primary: #2563eb;
    --portal-primary-soft: #eff6ff;
    --portal-primary-border: #93c5fd;
    --portal-heading: #2c3e50;
    --portal-radius: 8px;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin: 0;
    background-color: var(--portal-bg);
    color: var(--portal-text);
    min-height: 100vh;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.btn-portal-primary {
    background: var(--portal-primary);
    border-color: var(--portal-primary);
    color: #fff;
    font-weight: 600;
    border-radius: var(--portal-radius);
    padding: 0.65rem 1rem;
}

.btn-portal-primary:hover,
.btn-portal-primary:focus {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.form-control {
    border-color: var(--portal-border);
    border-radius: var(--portal-radius);
    padding: 0.65rem 0.85rem;
}

.form-control:focus {
    border-color: var(--portal-primary-border);
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--portal-heading);
    margin-bottom: 0.35rem;
}

/* App shell (matches PMS header feel) */
.portal-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-header {
    background: #fff;
    color: var(--portal-heading);
    padding: 10px 28px;
    min-height: 90px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid #e8ecf1;
}

.portal-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.portal-brand-logo {
    height: 68px;
    width: auto;
    max-width: 229px;
    object-fit: contain;
    display: block;
}

.portal-brand-sub {
    font-size: 0.72rem;
    color: var(--portal-text-muted);
    border-left: 1px solid #e0e0e0;
    padding-left: 12px;
    line-height: 1.2;
}

.portal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-nav-link {
    color: var(--portal-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.portal-nav-link:hover {
    background: var(--portal-surface-muted);
    color: var(--portal-primary);
}

.portal-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 0.75rem;
    border-left: 1px solid #e0e0e0;
}

.portal-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    overflow: hidden;
    flex-shrink: 0;
}

.portal-user-avatar--photo {
    background: #e5e7eb;
    padding: 0;
}

.portal-user-avatar--photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portal-user-details {
    text-align: right;
}

.portal-user-details p {
    margin: 0;
    font-weight: 500;
    font-size: 14px;
    color: #2c3e50;
}

.portal-user-details small {
    color: rgba(44, 62, 80, 0.65);
    font-size: 12px;
    display: block;
}

.portal-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 2.5rem;
}

.portal-footer {
    border-top: 1px solid var(--portal-border-light);
    background: #fff;
    color: var(--portal-text-muted);
    font-size: 0.8rem;
    padding: 0.85rem 1.5rem;
}

.portal-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

@media (max-width: 640px) {
    .portal-header {
        padding: 12px 16px;
    }

    .portal-user-details {
        display: none;
    }

    .portal-brand-logo {
        height: 57px;
        max-width: 172px;
    }

    .portal-brand-sub {
        display: none;
    }

    .portal-footer-inner {
        flex-direction: column;
        text-align: center;
    }
}
