/* ============================================================
   Selpho — Physician Portal Design System
   Distinct from patient dashboard: blue accent vs teal
   ============================================================ */

:root {
    --p-accent:    #3b82f6;
    --p-accent-d:  #2563eb;
    --p-glow:      rgba(59,130,246,0.14);
    --p-success:   #10b981;
    --p-warning:   #f59e0b;
    --p-danger:    #ef4444;

    --p-sidebar:   #0f172a;
    --p-sidebar-w: 216px;
    --p-nav-h:     54px;

    --p-bg:        #f5f7fa;
    --p-surface:   #ffffff;
    --p-border:    rgba(0,0,0,0.07);
    --p-border-2:  rgba(0,0,0,0.11);

    --p-text-1:    #0f172a;
    --p-text-2:    #64748b;
    --p-text-3:    #94a3b8;

    --p-s-dim:     rgba(255,255,255,0.38);
    --p-s-mid:     rgba(255,255,255,0.62);
    --p-s-full:    #ffffff;

    --p-shadow:    0 1px 3px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.04);
    --p-shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --p-shadow-lg: 0 16px 48px rgba(0,0,0,0.18);

    --p-font:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --p-head:      'Poppins', sans-serif;
    --p-ease:      cubic-bezier(0.4, 0, 0.2, 1);
}

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

body.physician-page {
    font-family: var(--p-font);
    background: var(--p-bg);
    color: var(--p-text-1);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.physician-page h1, body.physician-page h2,
body.physician-page h3, body.physician-page h4 {
    font-family: var(--p-head);
    margin-bottom: 0;
    line-height: 1.25;
}
body.physician-page p { margin-bottom: 0; }
body.physician-page a { text-decoration: none; }

/* ── TOP NAV ──────────────────────────────────────────── */
.ph-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--p-nav-h);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--p-border);
    display: flex;
    align-items: center;
    padding: 0 1.25rem 0 0;
    z-index: 200;
}

.ph-nav-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: var(--p-sidebar-w);
    padding: 0 1.1rem;
    height: 100%;
    flex-shrink: 0;
    text-decoration: none;
}

.ph-brand-icon {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--p-accent), var(--p-accent-d));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 0.8rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px var(--p-glow);
}

.ph-brand-name {
    font-family: var(--p-head);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--p-text-1);
    letter-spacing: -0.025em;
}
.ph-brand-name span { color: var(--p-accent); }

.ph-portal-badge {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--p-accent);
    background: rgba(59,130,246,0.09);
    border: 1px solid rgba(59,130,246,0.2);
    padding: 0.18rem 0.5rem;
    border-radius: 99px;
    white-space: nowrap;
}

.ph-nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.ph-nav-doc {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--p-text-2);
    font-weight: 500;
}
.ph-nav-doc strong { color: var(--p-text-1); font-weight: 600; }

.ph-nav-signout {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--p-text-2);
    padding: 0.38rem 0.85rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ph-nav-signout:hover {
    background: #fff1f2;
    color: #dc2626;
    border-color: #fecdd3;
}

.ph-mobile-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    color: var(--p-text-2);
    font-size: 0.95rem;
    border-radius: 8px;
    margin-left: 0.25rem;
    line-height: 1;
    transition: background 0.15s;
}
.ph-mobile-toggle:hover { background: var(--p-bg); }

/* ── SIDEBAR ──────────────────────────────────────────── */
.ph-sidebar {
    position: fixed;
    top: var(--p-nav-h);
    left: 0;
    width: var(--p-sidebar-w);
    height: calc(100vh - var(--p-nav-h));
    background: var(--p-sidebar);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 150;
    transition: transform 0.28s var(--p-ease);
    scrollbar-width: none;
}
.ph-sidebar::-webkit-scrollbar { display: none; }

.ph-sidebar-inner {
    padding: 0.75rem 0.625rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ph-nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.575rem 0.8rem;
    border-radius: 9px;
    color: var(--p-s-dim);
    text-decoration: none;
    font-size: 0.845rem;
    font-weight: 400;
    transition: background 0.14s var(--p-ease), color 0.14s var(--p-ease);
    white-space: nowrap;
    letter-spacing: -0.005em;
    margin-bottom: 1px;
}
.ph-nav-item i {
    width: 16px;
    text-align: center;
    font-size: 0.835rem;
    flex-shrink: 0;
}
.ph-nav-item:hover {
    color: var(--p-s-mid);
    background: rgba(255,255,255,0.065);
}
.ph-nav-item.active {
    background: rgba(59,130,246,0.14);
    color: var(--p-s-full);
    font-weight: 550;
}
.ph-nav-item.active i { color: #93c5fd; }

.ph-nav-item.ph-danger { color: rgba(248,113,113,0.55); }
.ph-nav-item.ph-danger:hover {
    background: rgba(239,68,68,0.1);
    color: #f87171;
}

.ph-sidebar-spacer {
    height: 1px;
    background: rgba(255,255,255,0.055);
    margin: 0.5rem 0.35rem;
    flex-shrink: 0;
}
.ph-sidebar-gap { flex: 1; min-height: 1rem; }

.ph-sidebar-user {
    padding: 0.75rem 0.8rem;
    border-radius: 9px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    margin-top: 0.25rem;
}
.ph-sidebar-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ph-sidebar-user-meta {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── MAIN CONTENT ─────────────────────────────────────── */
.ph-content {
    margin-left: var(--p-sidebar-w);
    margin-top: var(--p-nav-h);
    min-height: calc(100vh - var(--p-nav-h));
    padding: 1.75rem;
    background: var(--p-bg);
}

/* ── OVERLAY ──────────────────────────────────────────── */
.ph-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 149;
    backdrop-filter: blur(3px);
}
.ph-overlay.visible { display: block; }

/* ── PAGE HEADER ──────────────────────────────────────── */
.ph-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.ph-page-head h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--p-text-1);
    letter-spacing: -0.03em;
}
.ph-page-head p {
    font-size: 0.83rem;
    color: var(--p-text-3);
    margin-top: 0.2rem;
}

/* ── TOAST ────────────────────────────────────────────── */
.ph-toast-wrap {
    position: fixed;
    top: calc(var(--p-nav-h) + 1rem);
    right: 1.25rem;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.ph-toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--p-shadow-md);
    animation: toast-in 0.2s var(--p-ease);
    pointer-events: all;
    max-width: 320px;
}
.ph-toast.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.ph-toast.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.ph-toast.info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ── ALERTS (flash messages) ──────────────────────────── */
.ph-alert {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    border: 1px solid;
}
.ph-alert.success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.ph-alert.error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ── STAT CARDS ───────────────────────────────────────── */
.ph-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.ph-stat {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: 14px;
    padding: 1.2rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.ph-stat:hover { box-shadow: var(--p-shadow-md); border-color: var(--p-border-2); }
.ph-stat-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.ph-stat-val {
    font-family: var(--p-head);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--p-text-1);
    line-height: 1;
    letter-spacing: -0.03em;
}
.ph-stat-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--p-text-3); margin-bottom: 0.3rem; }
.ph-stat-sub { font-size: 0.75rem; color: var(--p-text-3); margin-top: 0.15rem; }

/* ── CARDS ────────────────────────────────────────────── */
.ph-card {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}
.ph-card:hover { box-shadow: var(--p-shadow-md); }
.ph-card-head {
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.ph-card-head h2, .ph-card-head h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--p-text-1);
    letter-spacing: -0.01em;
}
.ph-card-body { padding: 1.25rem; }
.ph-card-body-flush { padding: 0; }

/* ── TABLES ───────────────────────────────────────────── */
.ph-table {
    width: 100%;
    border-collapse: collapse;
}
.ph-table th {
    padding: 0.65rem 1.25rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--p-text-3);
    background: #f8fafc;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.ph-table td {
    padding: 0.85rem 1.25rem;
    font-size: 0.855rem;
    color: var(--p-text-1);
    border-bottom: 1px solid rgba(0,0,0,0.04);
    vertical-align: middle;
}
.ph-table tbody tr:last-child td { border-bottom: none; }
.ph-table tbody tr { transition: background 0.12s; }
.ph-table tbody tr:hover { background: #f8fafb; }
.ph-table tbody tr.unreviewed { background: #fefce8; }
.ph-table tbody tr.unreviewed:hover { background: #fef9c3; }

/* ── BADGES ───────────────────────────────────────────── */
.ph-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.65rem;
    border-radius: 99px;
    font-size: 0.73rem;
    font-weight: 600;
    white-space: nowrap;
}
.ph-badge.success { background: rgba(16,185,129,0.1); color: #065f46; }
.ph-badge.warning { background: rgba(245,158,11,0.1); color: #92400e; }
.ph-badge.danger  { background: rgba(239,68,68,0.1);  color: #991b1b; }
.ph-badge.info    { background: rgba(59,130,246,0.1);  color: #1e40af; }
.ph-badge.muted   { background: rgba(0,0,0,0.05);      color: var(--p-text-3); }

/* ── BUTTONS ──────────────────────────────────────────── */
.ph-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.845rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.01em;
}
.ph-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ph-btn-primary {
    background: var(--p-accent);
    color: white;
}
.ph-btn-primary:hover:not(:disabled) {
    background: var(--p-accent-d);
    box-shadow: 0 2px 12px var(--p-glow);
    transform: translateY(-1px);
    color: white;
}

.ph-btn-ghost {
    background: var(--p-bg);
    color: var(--p-text-2);
    border: 1px solid var(--p-border-2);
}
.ph-btn-ghost:hover:not(:disabled) { background: #eef0f2; color: var(--p-text-1); }

.ph-btn-success { background: var(--p-success); color: white; }
.ph-btn-success:hover:not(:disabled) { background: #059669; transform: translateY(-1px); color: white; }

.ph-btn-danger { background: var(--p-danger); color: white; }
.ph-btn-danger:hover:not(:disabled) { background: #dc2626; transform: translateY(-1px); color: white; }

.ph-btn-sm { padding: 0.35rem 0.7rem; font-size: 0.775rem; }

/* ── FORM FIELDS ──────────────────────────────────────── */
.ph-field { margin-bottom: 1.1rem; }
.ph-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--p-text-2);
    margin-bottom: 0.45rem;
    letter-spacing: -0.005em;
}
.ph-label-note { font-size: 0.75rem; color: var(--p-text-3); font-weight: 400; }

.ph-input, .ph-select, .ph-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 9px;
    font-family: var(--p-font);
    font-size: 0.875rem;
    color: var(--p-text-1);
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.ph-input:focus, .ph-select:focus, .ph-textarea:focus {
    border-color: var(--p-accent);
    box-shadow: 0 0 0 3px var(--p-glow);
}
.ph-input::placeholder, .ph-textarea::placeholder { color: var(--p-text-3); }
.ph-textarea { resize: vertical; min-height: 100px; }
.ph-hint { font-size: 0.75rem; color: var(--p-text-3); margin-top: 0.35rem; }

.ph-form-grid { display: grid; gap: 1rem; }
.ph-form-grid-2 { grid-template-columns: 1fr 1fr; }

.ph-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--p-text-3);
    margin-bottom: 0.875rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--p-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── PERMISSION TOGGLE ────────────────────────────────── */
.ph-perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.ph-perm-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.875rem;
    background: var(--p-bg);
    border: 1px solid var(--p-border);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.14s, border-color 0.14s;
    user-select: none;
}
.ph-perm-item:hover { background: #eef4ff; border-color: rgba(59,130,246,0.2); }
.ph-perm-item input[type="checkbox"] { display: none; }
.ph-perm-check {
    width: 18px; height: 18px;
    border-radius: 5px;
    border: 1.5px solid rgba(0,0,0,0.18);
    background: white;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 0.65rem;
    color: white;
    transition: background 0.14s, border-color 0.14s;
}
.ph-perm-item:has(input:checked) .ph-perm-check {
    background: var(--p-accent);
    border-color: var(--p-accent);
}
.ph-perm-item:has(input:checked) .ph-perm-check::after { content: '✓'; }
.ph-perm-item:has(input:checked) { background: #eff6ff; border-color: rgba(59,130,246,0.25); }

.ph-perm-label { font-size: 0.835rem; font-weight: 500; color: var(--p-text-1); }
.ph-perm-item.highlight { background: #fefce8; border-color: rgba(245,158,11,0.25); }
.ph-perm-item.highlight:hover { background: #fef9c3; }
.ph-perm-item.highlight:has(input:checked) { background: #fef9c3; border-color: rgba(245,158,11,0.4); }

/* ── NOTE ITEMS ───────────────────────────────────────── */
.ph-note-list { display: flex; flex-direction: column; gap: 0.75rem; }
.ph-note-item {
    background: var(--p-bg);
    border: 1px solid var(--p-border);
    border-radius: 10px;
    padding: 0.875rem 1rem;
}
.ph-note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
}
.ph-note-type {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--p-accent);
}
.ph-note-date { font-size: 0.75rem; color: var(--p-text-3); }
.ph-note-text { font-size: 0.855rem; color: var(--p-text-2); line-height: 1.55; }

/* ── EMPTY STATE ──────────────────────────────────────── */
.ph-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--p-text-3);
}
.ph-empty i { font-size: 2rem; display: block; margin-bottom: 0.75rem; }
.ph-empty p { font-size: 0.875rem; }
.ph-empty a { color: var(--p-accent); }

/* ── ONBOARD CARD (new physician welcome) ─────────────── */
.ph-welcome {
    background: linear-gradient(135deg, var(--p-accent) 0%, var(--p-accent-d) 100%);
    border-radius: 14px;
    padding: 1.75rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}
.ph-welcome::after {
    content: '';
    position: absolute;
    right: -40px; top: -40px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    pointer-events: none;
}
.ph-welcome-icon {
    font-size: 2rem;
    flex-shrink: 0;
    opacity: 0.9;
}
.ph-welcome-text { flex: 1; position: relative; }
.ph-welcome-text h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.35rem; }
.ph-welcome-text p { font-size: 0.855rem; opacity: 0.85; line-height: 1.55; margin-bottom: 0.875rem; }
.ph-welcome-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: white;
    color: var(--p-accent-d);
    font-size: 0.845rem;
    font-weight: 700;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    transition: opacity 0.15s;
    text-decoration: none;
}
.ph-welcome-btn:hover { opacity: 0.9; color: var(--p-accent-d); }

/* ── INVITE LINK INPUT ────────────────────────────────── */
.ph-invite-link {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.ph-invite-link input {
    flex: 1;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--p-border-2);
    border-radius: 7px;
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--p-text-2);
    background: var(--p-bg);
    min-width: 0;
}
.ph-copy-btn {
    flex-shrink: 0;
    padding: 0.38rem 0.75rem;
    border-radius: 7px;
    border: 1px solid var(--p-border-2);
    background: white;
    color: var(--p-text-2);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.ph-copy-btn:hover { background: var(--p-accent); color: white; border-color: var(--p-accent); }
.ph-copy-btn.copied { background: var(--p-success); color: white; border-color: var(--p-success); }

/* ── AUTH PAGES ───────────────────────────────────────── */
body.ph-auth {
    font-family: var(--p-font);
    background: var(--p-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    display: flex;
    align-items: stretch;
    color: var(--p-text-1);
}

.ph-auth-split {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.ph-auth-panel {
    width: 400px;
    flex-shrink: 0;
    background: var(--p-sidebar);
    padding: 2.5rem 2.25rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.ph-auth-panel::before {
    content: '';
    position: absolute;
    bottom: -80px; right: -80px;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(59,130,246,0.18) 0%, transparent 70%);
    pointer-events: none;
}

.ph-auth-panel-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 2.5rem;
}
.ph-auth-panel-brand-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--p-accent), var(--p-accent-d));
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.85rem;
    box-shadow: 0 2px 10px var(--p-glow);
}
.ph-auth-panel-brand-name {
    font-family: var(--p-head);
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.025em;
}
.ph-auth-panel-brand-name span { color: #60a5fa; }

.ph-auth-panel h2 {
    font-family: var(--p-head);
    font-size: 1.45rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.035em;
    margin-bottom: 0.65rem;
}
.ph-auth-panel p {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.ph-auth-features { list-style: none; display: flex; flex-direction: column; gap: 0.875rem; }
.ph-auth-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.845rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
}
.ph-auth-features li i {
    width: 28px; height: 28px;
    border-radius: 7px;
    background: rgba(59,130,246,0.18);
    color: #93c5fd;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.ph-auth-panel-footer {
    margin-top: auto;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.22);
}

.ph-auth-form-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    background: white;
}

.ph-auth-form-inner {
    width: 100%;
    max-width: 420px;
}

.ph-auth-form-inner h1 {
    font-family: var(--p-head);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--p-text-1);
    letter-spacing: -0.035em;
    margin-bottom: 0.4rem;
}
.ph-auth-form-inner .ph-auth-sub {
    font-size: 0.855rem;
    color: var(--p-text-3);
    margin-bottom: 2rem;
}

.ph-auth-alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.875rem;
    border-radius: 9px;
    font-size: 0.845rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    border: 1px solid;
}
.ph-auth-alert.error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.ph-auth-alert.success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }

.ph-auth-submit {
    width: 100%;
    padding: 0.75rem;
    background: var(--p-accent);
    color: white;
    border: none;
    border-radius: 9px;
    font-family: var(--p-font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    letter-spacing: -0.01em;
}
.ph-auth-submit:hover { background: var(--p-accent-d); box-shadow: 0 4px 16px var(--p-glow); }

.ph-auth-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--p-border);
    font-size: 0.835rem;
    color: var(--p-text-3);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.ph-auth-links a { color: var(--p-accent); font-weight: 500; }
.ph-auth-links a:hover { color: var(--p-accent-d); }

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 920px) {
    .ph-sidebar {
        top: 0; height: 100vh;
        transform: translateX(calc(-1 * var(--p-sidebar-w) - 20px));
        z-index: 300;
    }
    .ph-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--p-shadow-lg);
    }
    .ph-content { margin-left: 0; }
    .ph-mobile-toggle { display: flex; align-items: center; justify-content: center; }
    .ph-nav-brand { width: auto; }
    .ph-nav-doc { display: none; }

    .ph-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
    .ph-auth-panel { display: none; }
    .ph-auth-form-wrap { padding: 2rem 1.25rem; background: var(--p-bg); }
    .ph-auth-form-inner { max-width: 100%; }

    .ph-form-grid-2 { grid-template-columns: 1fr; }
    .ph-perm-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .ph-content { padding: 1.25rem 1rem; }
    .ph-stats { grid-template-columns: 1fr; }
    .ph-nav-signout span { display: none; }
}
