/* CM Citizen Portal — modern theme */
:root {
    --portal-primary: #0d9488;
    --portal-primary-dark: #0f766e;
    --portal-primary-light: #ccfbf1;
    --portal-accent: #6366f1;
    --portal-bg: #f8fafc;
    --portal-surface: #ffffff;
    --portal-border: #e2e8f0;
    --portal-text: #0f172a;
    --portal-text-muted: #64748b;
    --portal-success: #059669;
    --portal-warning: #d97706;
    --portal-danger: #dc2626;
    --portal-info: #0284c7;
    --portal-radius: 12px;
    --portal-radius-lg: 16px;
    --portal-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 16px rgba(15, 23, 42, 0.06);
    --portal-shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.12);
    --portal-font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body.portal-body {
    margin: 0;
    font-family: var(--portal-font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--portal-text);
    background: var(--portal-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Bootstrap overrides */
.text-primary { color: var(--portal-primary) !important; }
.bg-primary { background-color: var(--portal-primary) !important; }
.btn-primary {
    --bs-btn-bg: var(--portal-primary);
    --bs-btn-border-color: var(--portal-primary);
    --bs-btn-hover-bg: var(--portal-primary-dark);
    --bs-btn-hover-border-color: var(--portal-primary-dark);
    --bs-btn-active-bg: var(--portal-primary-dark);
    --bs-btn-active-border-color: var(--portal-primary-dark);
    --bs-btn-focus-shadow-rgb: 13, 148, 136;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.625rem 1.25rem;
}
.btn-outline-primary {
    --bs-btn-color: var(--portal-primary);
    --bs-btn-border-color: var(--portal-primary);
    --bs-btn-hover-bg: var(--portal-primary);
    --bs-btn-hover-border-color: var(--portal-primary);
    --bs-btn-active-bg: var(--portal-primary-dark);
    font-weight: 600;
    border-radius: 10px;
}
.form-control, .form-select {
    border-radius: 10px;
    border-color: var(--portal-border);
    padding: 0.625rem 0.875rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.form-control.is-invalid,
.form-select.is-invalid,
.portal-cnic-input.is-invalid,
.portal-phone-input.is-invalid {
    border-color: var(--portal-danger) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}
.form-control.is-invalid:focus,
.form-select.is-invalid:focus,
.portal-cnic-input.is-invalid:focus,
.portal-phone-input.is-invalid:focus {
    border-color: var(--portal-danger) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2) !important;
}
.select2-container--bootstrap-5 .select2-selection.is-invalid {
    border-color: var(--portal-danger) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}
.tox-tinymce.is-invalid {
    border-color: var(--portal-danger) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}
.portal-rich-editor-field .tox-tinymce {
    border-radius: 10px;
    border-color: var(--portal-border);
}
.portal-rich-editor-field .tox-tinymce:focus-within {
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.invalid-feedback {
    display: none;
    color: var(--portal-danger);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.35rem;
}
.is-invalid ~ .invalid-feedback,
.portal-field .invalid-feedback.d-block,
.col-md-6 .invalid-feedback.d-block,
.col-12 .invalid-feedback.d-block,
.portal-cnic-verify .invalid-feedback.d-block {
    display: block;
}
.form-label { font-weight: 600; font-size: 0.875rem; color: var(--portal-text); margin-bottom: 0.375rem; }
.portal-required-mark {
    color: var(--portal-danger);
    font-weight: 700;
    margin-left: 0.125rem;
}
.portal-optional-mark {
    color: var(--portal-text-muted);
    font-weight: 400;
    font-size: 0.8125rem;
    margin-left: 0.25rem;
}
.portal-form-legend {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    color: var(--portal-text-muted);
}

/* Layout */
.portal-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}
.portal-main { flex: 1; }

/* Header */
.portal-header {
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.95);
}
.portal-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}
.portal-brand__logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--portal-primary-dark), #115e59);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    overflow: hidden;
    padding: 6px;
    flex-shrink: 0;
}
.portal-brand__logo img { width: 100%; height: 100%; object-fit: contain; }
.portal-brand__title { margin: 0; font-weight: 700; font-size: 1rem; line-height: 1.3; }
.portal-brand__subtitle { margin: 0; font-size: 0.75rem; color: var(--portal-text-muted); }

.portal-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}
.portal-nav a {
    text-decoration: none;
    color: var(--portal-text-muted);
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}
.portal-nav a:hover { color: var(--portal-primary); background: var(--portal-primary-light); }
.portal-nav a.active { color: var(--portal-primary); background: var(--portal-primary-light); font-weight: 600; }
.portal-nav__cta {
    background: var(--portal-primary) !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 0.5rem 1rem !important;
    margin-left: 0.5rem;
}
.portal-nav__cta:hover { background: var(--portal-primary-dark) !important; color: #fff !important; }

.portal-menu-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--portal-text);
}

/* Footer */
.portal-footer {
    background: var(--portal-surface);
    border-top: 1px solid var(--portal-border);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--portal-text-muted);
}

/* Loader */
.portal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 9998;
}
.portal-loader {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: var(--portal-surface);
    padding: 2rem 2.5rem;
    border-radius: var(--portal-radius-lg);
    box-shadow: var(--portal-shadow-lg);
    text-align: center;
}
.portal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--portal-border);
    border-top-color: var(--portal-primary);
    border-radius: 50%;
    animation: portal-spin 0.7s linear infinite;
    margin: 0 auto 0.75rem;
}
@keyframes portal-spin { to { transform: rotate(360deg); } }

/* Hero */
.portal-hero {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 40%, #14b8a6 100%);
    color: #fff;
    padding: 3.5rem 0 4rem;
    position: relative;
    overflow: hidden;
}
.portal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}
.portal-hero__inner {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.portal-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.portal-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}
.portal-hero p {
    font-size: 1.0625rem;
    opacity: 0.92;
    margin: 0 0 1.75rem;
    max-width: 520px;
    line-height: 1.7;
}
.portal-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.portal-hero__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.portal-hero__btn--primary {
    background: #fff;
    color: var(--portal-primary-dark);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.portal-hero__btn--primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); color: var(--portal-primary-dark); }
.portal-hero__btn--ghost {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}
.portal-hero__btn--ghost:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.portal-hero__visual {
    border-radius: var(--portal-radius-lg);
    overflow: hidden;
    box-shadow: var(--portal-shadow-lg);
    aspect-ratio: 4/3;
    background: rgba(255, 255, 255, 0.1);
}
.portal-hero__visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portal-hero__visual-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
    opacity: 0.9;
}
.portal-hero__visual-placeholder i { font-size: 4rem; margin-bottom: 1rem; opacity: 0.8; }

/* Stats */
.portal-stats {
    max-width: 1200px;
    margin: -2.5rem auto 0;
    padding: 0 1.25rem 3rem;
    position: relative;
    z-index: 2;
}
.portal-stats__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}
.portal-stat {
    background: var(--portal-surface);
    border-radius: var(--portal-radius);
    padding: 1.25rem;
    box-shadow: var(--portal-shadow);
    border: 1px solid var(--portal-border);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform 0.15s, box-shadow 0.15s;
}
.portal-stat:hover { transform: translateY(-2px); box-shadow: var(--portal-shadow-lg); }
.portal-stat__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.portal-stat__icon--total { background: #ecfdf5; color: var(--portal-primary); }
.portal-stat__icon--pending { background: #fffbeb; color: var(--portal-warning); }
.portal-stat__icon--forwarded { background: #eff6ff; color: var(--portal-info); }
.portal-stat__icon--closed { background: #f0fdf4; color: var(--portal-success); }
.portal-stat__icon--rejected { background: #fef2f2; color: var(--portal-danger); }
.portal-stat__value { font-size: 1.5rem; font-weight: 800; line-height: 1.2; margin: 0; }
.portal-stats--page {
    margin: 0 0 1.5rem;
    padding: 0;
    max-width: none;
}
.portal-stat--active {
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 1px var(--portal-primary);
}

/* Features strip */
.portal-features {
    padding: 2rem 0 4rem;
    background: var(--portal-bg);
}
.portal-features__grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}
.portal-feature {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    padding: 1.5rem;
}
.portal-feature__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--portal-primary-light);
    color: var(--portal-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    margin-bottom: 1rem;
}
.portal-feature h3 { font-size: 1.0625rem; font-weight: 700; margin: 0 0 0.5rem; }
.portal-feature p { font-size: 0.9375rem; color: var(--portal-text-muted); margin: 0; }

/* Page shell */
.portal-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}
.portal-page--wide { max-width: 1200px; }
.portal-page-header { margin-bottom: 1.75rem; }
.portal-page-header h1 {
    font-size: 1.625rem;
    font-weight: 800;
    margin: 0 0 0.375rem;
    letter-spacing: -0.02em;
}
.portal-page-header p { color: var(--portal-text-muted); margin: 0; font-size: 0.9375rem; }

/* Cards */
.portal-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg);
    box-shadow: var(--portal-shadow);
    overflow: hidden;
}
.portal-card__body { padding: 1.75rem; }
.portal-card__header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--portal-border);
    background: linear-gradient(to bottom, #fafbfc, var(--portal-surface));
}
.portal-card__header h2 { font-size: 1.125rem; font-weight: 700; margin: 0; }

/* Wizard */
.portal-wizard { margin-bottom: 2rem; }
.portal-wizard__track {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0 0.5rem;
}
.portal-wizard__track::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: var(--portal-border);
    border-radius: 2px;
    z-index: 0;
}
.portal-wizard__progress {
    position: absolute;
    top: 20px;
    left: 10%;
    height: 3px;
    background: linear-gradient(90deg, var(--portal-primary), #14b8a6);
    border-radius: 2px;
    z-index: 1;
    transition: width 0.4s ease;
}
.portal-wizard__step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
    max-width: 180px;
}
.portal-wizard__circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--portal-surface);
    border: 3px solid var(--portal-border);
    color: var(--portal-text-muted);
    font-weight: 700;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.625rem;
    transition: all 0.3s ease;
}
.portal-wizard__title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--portal-text-muted);
    margin-bottom: 0.125rem;
}
.portal-wizard__desc {
    font-size: 0.75rem;
    color: var(--portal-text-muted);
    opacity: 0.85;
    line-height: 1.4;
    padding: 0 0.25rem;
}
.portal-wizard__step.is-active .portal-wizard__circle {
    border-color: var(--portal-primary);
    background: var(--portal-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.2);
    transform: scale(1.08);
}
.portal-wizard__step.is-active .portal-wizard__title { color: var(--portal-primary); font-weight: 700; }
.portal-wizard__step.is-active .portal-wizard__desc { color: var(--portal-text); opacity: 1; }
.portal-wizard__step.is-complete .portal-wizard__circle {
    border-color: var(--portal-success);
    background: var(--portal-success);
    color: #fff;
}
.portal-wizard__step.is-complete .portal-wizard__title { color: var(--portal-success); }

/* Form sections */
.portal-form-section { margin-bottom: 1.5rem; }
.portal-form-section__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.portal-form-section__title i { color: var(--portal-primary); }
.portal-form-section__hint {
    font-size: 0.875rem;
    color: var(--portal-text-muted);
    margin: 0 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--portal-border);
}
.portal-field { margin-bottom: 1rem; }
.portal-field small {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--portal-text-muted);
}
.portal-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}
.portal-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--portal-border);
}

.portal-otp-resend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--portal-border);
}

.portal-otp-resend__text {
    font-size: 0.875rem;
    color: var(--portal-text-muted);
}

.portal-otp-resend__form {
    display: inline;
    margin: 0;
}

.portal-otp-resend__btn {
    border: none;
    background: none;
    padding: 0;
    color: var(--portal-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.portal-otp-resend__btn:hover {
    color: var(--portal-primary-dark);
    text-decoration: underline;
}

.portal-cnic-verify {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--portal-border);
}

.portal-cnic-verify__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
}

.portal-cnic-verify__row .form-control {
    flex: 1 1 220px;
    min-width: 0;
}

.portal-cnic-verify__row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.portal-cnic-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    letter-spacing: 0.04em;
}

.portal-phone-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    letter-spacing: 0.04em;
}

.portal-cnic-status {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.875rem;
    padding: 0.75rem 0.875rem;
    border-radius: 10px;
    font-size: 0.875rem;
}

.portal-cnic-status--pending {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.portal-cnic-status--success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.portal-cnic-status--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.portal-cnic-verified-banner {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-size: 0.9375rem;
}

.portal-cnic-verified-banner i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.portal-cnic-verified-banner code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    letter-spacing: 0.04em;
    color: inherit;
    background: transparent;
    padding: 0;
}

.portal-complaint-fields {
    border: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.portal-complaint-fields--locked {
    opacity: 0.55;
    pointer-events: none;
}

/* Alerts */
.portal-alert {
    border-radius: 10px;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.9375rem;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
}
.portal-alert--success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.portal-alert--danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Table */
.portal-table-wrap { overflow-x: auto; }
.portal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}
.portal-table th {
    text-align: left;
    padding: 0.875rem 1rem;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--portal-text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--portal-border);
}
.portal-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--portal-border);
    vertical-align: middle;
}
.portal-table tbody tr:hover { background: #f8fafc; }
.portal-table a { color: var(--portal-primary); font-weight: 600; text-decoration: none; }
.portal-table a:hover { text-decoration: underline; }

/* Badges */
.portal-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.portal-badge--warning { background: #fef3c7; color: #92400e; }
.portal-badge--success { background: #d1fae5; color: #065f46; }
.portal-badge--danger { background: #fee2e2; color: #991b1b; }
.portal-badge--info { background: #dbeafe; color: #1e40af; }
.portal-badge--secondary { background: #f1f5f9; color: #475569; }

/* Detail page */
.portal-detail-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}
.portal-dl { display: grid; grid-template-columns: 140px 1fr; gap: 0.625rem 1rem; font-size: 0.9375rem; }
.portal-dl dt { font-weight: 600; color: var(--portal-text-muted); }
.portal-dl dd { margin: 0; }

.portal-timeline { list-style: none; padding: 0; margin: 0; }
.portal-timeline li {
    position: relative;
    padding-left: 1.5rem;
    padding-bottom: 1.25rem;
    border-left: 2px solid var(--portal-border);
    margin-left: 0.375rem;
}
.portal-timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.portal-timeline li::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--portal-primary);
}
.portal-timeline__status { font-weight: 600; font-size: 0.9375rem; }
.portal-timeline__date { font-size: 0.8125rem; color: var(--portal-text-muted); }

/* Search bar */
.portal-search {
    display: grid;
    grid-template-columns: 1fr 200px auto;
    gap: 0.75rem;
    align-items: end;
}

/* Responsive */
@media (max-width: 991px) {
    .portal-hero__inner { grid-template-columns: 1fr; gap: 2rem; }
    .portal-hero__visual { max-height: 280px; }
    .portal-detail-grid { grid-template-columns: 1fr; }
    .portal-field-row { grid-template-columns: 1fr; }
    .portal-search { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .portal-menu-toggle { display: block; }
    .portal-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--portal-surface);
        border-bottom: 1px solid var(--portal-border);
        flex-direction: column;
        padding: 0.75rem;
        box-shadow: var(--portal-shadow);
    }
    .portal-nav.open { display: flex; }
    .portal-nav a { width: 100%; }
    .portal-header { position: relative; }
    .portal-header__inner { flex-wrap: wrap; position: relative; }
    .portal-wizard__desc { display: none; }
    .portal-wizard__step { max-width: none; }
    .portal-stats__grid { grid-template-columns: repeat(2, 1fr); }
    .portal-dl { grid-template-columns: 1fr; gap: 0.25rem; }
    .portal-dl dt { margin-top: 0.5rem; }
}

@media (max-width: 480px) {
    .portal-stats__grid { grid-template-columns: 1fr; }
}

/* Select2 / Summernote / Dropzone / Captcha */
.portal-select2 + .select2-container--bootstrap-5 .select2-selection {
    min-height: 42px;
    border-radius: 10px;
    border-color: var(--portal-border);
    padding: 0.375rem 0.5rem;
}

.portal-select2 + .select2-container--bootstrap-5.select2-container--focus .select2-selection,
.portal-select2 + .select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.portal-dropzone.dropzone {
    border: 2px dashed var(--portal-border);
    border-radius: 12px;
    background: #f8fafc;
    min-height: 160px;
    padding: 1.25rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.portal-dropzone.dropzone.dz-drag-hover {
    border-color: var(--portal-primary);
    background: var(--portal-primary-light);
}

.portal-dropzone .dz-message {
    margin: 1.5rem 0;
    color: var(--portal-text-muted);
}

.portal-dropzone .dz-message i {
    font-size: 2rem;
    color: var(--portal-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.portal-dropzone .dz-message p {
    margin: 0 0 0.25rem;
    font-weight: 600;
    color: var(--portal-text);
}

.portal-dropzone .dz-preview {
    margin: 0.5rem;
}

.portal-dropzone .dz-preview .dz-progress {
    display: block;
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(13, 148, 136, 0.15);
    margin-top: 0.5rem;
}

.portal-dropzone .dz-preview .dz-upload {
    display: block;
    height: 100%;
    background: var(--portal-primary);
    transition: width 0.15s ease;
}

.portal-dropzone .dz-preview.dz-success .dz-progress {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portal-upload-status {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 0.9rem;
}

.portal-form-actions .btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.portal-captcha {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.portal-captcha__image-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.portal-captcha__image {
    display: block;
    height: 48px;
    border-radius: 8px;
    border: 1px solid var(--portal-border);
    background: #fff;
}

.portal-captcha input {
    flex: 1 1 180px;
    max-width: 220px;
}

.portal-rich-text :where(p, ul, ol) {
    margin-bottom: 0.75rem;
}

/* Complaint show page */
.portal-card--flush {
    overflow: visible;
}

.portal-show-success {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--portal-radius-lg);
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    box-shadow: 0 4px 24px rgba(16, 185, 129, 0.12);
}

.portal-show-success__icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--portal-success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.portal-show-success h2 {
    font-size: 1.125rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
    color: #065f46;
}

.portal-show-success p {
    margin: 0;
    color: #047857;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.portal-show-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    border-radius: var(--portal-radius-lg);
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 50%, #14b8a6 100%);
    color: #fff;
    box-shadow: 0 8px 32px rgba(13, 148, 136, 0.25);
}

.portal-show-hero__eyebrow {
    margin: 0 0 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
}

.portal-show-hero__ref {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    margin: 0 0 0.5rem;
    letter-spacing: 0.02em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.portal-show-hero__title {
    margin: 0 0 1rem;
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 500;
}

.portal-show-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.portal-show-hero__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

.portal-show-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    flex-shrink: 0;
}

.portal-show-hero__actions .btn-outline-primary {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}

.portal-show-hero__actions .btn-outline-primary:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: #fff;
    color: #fff;
}

.portal-show-hero__actions .btn-primary {
    background: #fff;
    border-color: #fff;
    color: var(--portal-primary);
}

.portal-show-hero__actions .btn-primary:hover {
    background: #f0fdfa;
    border-color: #f0fdfa;
    color: #0f766e;
}

.portal-show-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
}

.portal-show-section + .portal-show-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--portal-border);
}

.portal-show-section__label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.625rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--portal-text-muted);
}

.portal-show-section__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.375rem;
    height: 1.375rem;
    padding: 0 0.375rem;
    border-radius: 999px;
    background: var(--portal-primary-light);
    color: var(--portal-primary);
    font-size: 0.6875rem;
    font-weight: 700;
}

.portal-show-section__value {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--portal-text);
}

.portal-show-prose {
    padding: 1.25rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--portal-border);
    font-size: 0.9375rem;
    line-height: 1.65;
}

.portal-info-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.portal-info-list__item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    min-width: 0;
}

.portal-info-list__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--portal-primary-light);
    color: var(--portal-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.portal-info-list__item > div {
    min-width: 0;
    flex: 1;
}

.portal-info-list__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--portal-text-muted);
    margin-bottom: 0.125rem;
}

.portal-info-list__value {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--portal-text);
    line-height: 1.45;
}

.portal-info-list__value--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.02em;
    font-weight: 500;
}

.portal-info-list__value--break {
    word-break: break-word;
    overflow-wrap: anywhere;
    font-weight: 500;
}

.portal-attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}

.portal-attachment-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--portal-border);
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    min-width: 0;
}

.portal-attachment-card:hover {
    border-color: var(--portal-primary);
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.12);
    transform: translateY(-1px);
    color: inherit;
}

.portal-attachment-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fef3c7;
    color: #b45309;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.portal-attachment-card__body {
    min-width: 0;
    flex: 1;
}

.portal-attachment-card__name {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--portal-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-attachment-card__action {
    display: block;
    font-size: 0.75rem;
    color: var(--portal-primary);
    margin-top: 0.125rem;
}

.portal-attachment-card__link {
    color: var(--portal-text-muted);
    flex-shrink: 0;
    font-size: 0.875rem;
}

.portal-timeline--modern .portal-timeline__remarks {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
    color: var(--portal-text-muted);
    line-height: 1.45;
}

.portal-timeline__empty {
    border-left: none !important;
    padding-left: 0 !important;
    color: var(--portal-text-muted);
    font-size: 0.875rem;
}

@media (max-width: 991px) {
    .portal-show-hero {
        padding: 1.25rem;
    }

    .portal-show-hero__actions {
        width: 100%;
    }

    .portal-show-hero__actions .btn {
        flex: 1 1 auto;
    }
}
