/* PNS Client Portal — global design system */
:root {
    --pns-ui-scale: 1.015;
    --pns-primary: #0d9488;
    --pns-primary-dark: #0f766e;
    --pns-primary-light: #14b8a6;
    --pns-accent: #0891b2;
    --pns-bg: #f4f7f6;
    --pns-surface: #ffffff;
    --pns-text: #1c1917;
    --pns-muted: #57534e;
    --pns-border: #d6e4e2;
    --pns-success: #15803d;
    --pns-success-bg: #dcfce7;
    --pns-error: #b91c1c;
    --pns-error-bg: #fee2e2;
    --pns-radius: calc(14px * var(--pns-ui-scale));
    --pns-radius-sm: calc(10px * var(--pns-ui-scale));
    --pns-shadow: 0 10px 30px rgba(15, 118, 110, 0.08);
    --pns-shadow-sm: 0 4px 14px rgba(15, 118, 110, 0.06);
    --pns-nav-h: calc(56px * var(--pns-ui-scale));
}

* { box-sizing: border-box; }

html {
    font-size: calc(100% * var(--pns-ui-scale));
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--pns-text);
    background: var(--pns-bg);
}

a { color: var(--pns-primary); }

/* ── Auth pages (login / register) ── */
.page-auth {
    background:
        radial-gradient(ellipse at 20% 0%, rgba(20, 184, 166, 0.16), transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(15, 118, 110, 0.12), transparent 50%),
        var(--pns-bg);
}

.shell {
    max-width: 440px;
    margin: 0 auto;
    padding: 32px 16px 48px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand {
    text-align: center;
    margin-bottom: 28px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--pns-primary-dark), var(--pns-primary-light));
    color: #fff;
    font-size: 26px;
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.28);
}

.brand h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: var(--pns-primary-dark);
    letter-spacing: -0.02em;
}

.brand p {
    margin: 8px 0 0;
    color: var(--pns-muted);
    font-size: 14px;
    font-weight: 500;
}

.card {
    background: var(--pns-surface);
    border: 1px solid var(--pns-border);
    border-radius: var(--pns-radius);
    padding: 28px 24px;
    box-shadow: var(--pns-shadow);
}

.card h2,
.card h3 {
    margin: 0 0 18px;
    font-size: 20px;
    font-weight: 800;
    color: var(--pns-text);
}

label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: var(--pns-text);
    margin-bottom: 6px;
}

input,
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    margin-bottom: 16px;
    border: 1.5px solid var(--pns-border);
    border-radius: var(--pns-radius-sm);
    font-size: 16px;
    font-family: inherit;
    color: var(--pns-text);
    background: #f8fafc;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--pns-primary-light);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

textarea {
    resize: vertical;
    min-height: 88px;
}

.btn {
    display: block;
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-radius: var(--pns-radius-sm);
    background: linear-gradient(135deg, var(--pns-primary-dark), var(--pns-primary));
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(15, 118, 110, 0.28);
    transition: transform 0.12s, box-shadow 0.12s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(15, 118, 110, 0.34);
}

.btn-secondary {
    background: #e7eceb;
    color: #44403c;
    box-shadow: none;
}

.alert {
    padding: 12px 14px;
    border-radius: var(--pns-radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.alert-error {
    background: var(--pns-error-bg);
    color: var(--pns-error);
    border: 1px solid #fca5a5;
}

.alert-success {
    background: var(--pns-success-bg);
    color: var(--pns-success);
    border: 1px solid #86efac;
}

.links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--pns-muted);
    line-height: 1.8;
}

.links a {
    font-weight: 700;
    text-decoration: none;
}

.links a:hover {
    text-decoration: underline;
}

/* ── Portal nav + layout ── */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(90deg, var(--pns-primary-dark), var(--pns-primary));
    color: #fff;
    padding: 0 18px;
    height: var(--pns-nav-h);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(15, 118, 110, 0.22);
}

.nav-brand {
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
}

.nav-id {
    opacity: 0.85;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.12s;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.main {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.page-hero {
    margin-bottom: 24px;
}

.page-hero h1 {
    margin: 0 0 6px;
    font-size: clamp(22px, 5vw, 30px);
    font-weight: 800;
    color: var(--pns-text);
    letter-spacing: -0.02em;
}

.page-hero .subtitle {
    margin: 0;
    color: var(--pns-muted);
    font-size: 14px;
    font-weight: 600;
}

/* ── Action cards (dashboard) ── */
.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.action-grid-4 {
    grid-template-columns: repeat(2, 1fr);
}

.action-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--pns-surface);
    border: 1.5px solid var(--pns-border);
    border-radius: var(--pns-radius);
    padding: 22px 18px;
    text-decoration: none;
    color: var(--pns-text);
    box-shadow: var(--pns-shadow-sm);
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.action-card:hover {
    border-color: #5eead4;
    transform: translateY(-3px);
    box-shadow: var(--pns-shadow);
}

.action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ecfdf5, #ccfbf1);
    font-size: 24px;
    line-height: 1;
}

.action-card strong {
    font-size: 16px;
    font-weight: 800;
    color: var(--pns-primary-dark);
}

.action-card > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.action-desc {
    font-size: 13px;
    color: var(--pns-muted);
    line-height: 1.45;
    font-weight: 500;
}

/* ── Detail card ── */
.detail-grid {
    display: grid;
    gap: 0;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 0;
    border-bottom: 1px solid var(--pns-border);
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row:first-child {
    padding-top: 0;
}

.detail-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--pns-muted);
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--pns-text);
    line-height: 1.45;
    word-break: break-word;
}

/* ── Stats (staff dashboard) ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat {
    background: var(--pns-surface);
    border: 1px solid var(--pns-border);
    border-radius: var(--pns-radius);
    padding: 18px;
    box-shadow: var(--pns-shadow-sm);
}

.stat span {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pns-muted);
}

.stat strong {
    display: block;
    font-size: 28px;
    font-weight: 800;
    margin-top: 6px;
    color: var(--pns-primary-dark);
}

/* ── Placeholder / inner pages ── */
.page-placeholder {
    color: var(--pns-muted);
    line-height: 1.65;
    margin: 0;
    font-size: 15px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: var(--pns-primary);
}

.back-link:hover {
    text-decoration: underline;
}

/* ── Utilities ── */
.code-inline {
    display: inline-block;
    background: #f1f5f9;
    border: 1px solid var(--pns-border);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 12px;
    word-break: break-all;
}

.text-muted { color: var(--pns-muted); }

/* ── Responsive ── */
@media (max-width: 720px) {
    .action-grid,
    .action-grid-4 {
        grid-template-columns: 1fr;
    }

    .action-card {
        flex-direction: row;
        align-items: center;
        padding: 16px;
    }

    .action-icon {
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        font-size: 22px;
    }

    .action-card strong {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .shell {
        padding: 24px 14px 40px;
        justify-content: flex-start;
        padding-top: 40px;
    }

    .card {
        padding: 22px 18px;
    }

    .nav {
        padding: 0 14px;
    }

    .main {
        padding: 18px 14px 40px;
    }
}
