/* ═══════════════════════════════════════════════
   Partner Portal — Charcoal Theme v3
   Dark Sidebar + Cool Gray Palette
   ═══════════════════════════════════════════════ */

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

/* Override body background from styles.css for portal page */
body { background: #f4f5f7 !important; }

:root {
    /* Charcoal palette */
    --pp-deep: #16181d;
    --pp-primary: #24272e;
    --pp-mid: #363a44;
    --pp-accent: #636ee0;
    --pp-accent-soft: #818cf8;
    --pp-accent-bg: rgba(99,110,224,0.08);
    --pp-accent-border: rgba(99,110,224,0.25);
    /* Neutrals */
    --pp-text: #1a1d24;
    --pp-text-secondary: #4a5060;
    --pp-muted: #7b8394;
    --pp-border: #e0e2e7;
    --pp-divider: #eceef2;
    --pp-page-bg: #f4f5f7;
    --pp-card: #ffffff;
    --pp-card-hover: #fafbfc;
    --pp-light: #eef0f4;
    --pp-lightest: #f7f8fa;
    /* Shadows */
    --pp-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --pp-shadow-md: 0 4px 16px rgba(0,0,0,0.07);
    --pp-shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    /* Radius */
    --pp-r: 14px;
    --pp-rs: 10px;
    --pp-rx: 8px;
    /* Type */
    --pp-mono: 'SF Mono','Cascadia Code','Fira Code','Consolas',monospace;
    --pp-ease: 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ══════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════ */
.partner-login-screen {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #0d0e12 0%, #16181d 25%, #1e2028 55%, #2a2d36 100%);
    padding: 20px; position: relative; overflow: hidden;
}
.partner-login-screen::before {
    content: '';
    position: absolute; inset: -50%; width: 200%; height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(99,110,224,0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(129,140,248,0.04) 0%, transparent 50%);
    animation: loginFloat 25s ease-in-out infinite alternate;
}
@keyframes loginFloat {
    0% { transform: translate(0,0) rotate(0deg); }
    100% { transform: translate(-2%,-2%) rotate(1deg); }
}

.partner-login-card {
    background: rgba(255,255,255,0.98);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border-radius: 24px; padding: 48px 40px;
    max-width: 420px; width: 100%;
    box-shadow: 0 32px 80px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.5);
    position: relative; z-index: 1;
}
.partner-login-card .login-logo { text-align: center; margin-bottom: 10px; }
.partner-login-card .login-logo span {
    font-size: 2.4rem; display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 18px;
    background: linear-gradient(135deg, var(--pp-light), #e4e6ee);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.partner-login-card h2 {
    text-align: center; color: var(--pp-deep);
    margin: 0 0 4px; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.5px;
}
.partner-login-card .login-subtitle {
    text-align: center; color: var(--pp-muted);
    margin: 0 0 32px; font-size: 0.88rem;
}
.partner-login-card .form-group { margin-bottom: 18px; }
.partner-login-card .form-group label {
    display: block; margin-bottom: 6px;
    font-weight: 600; color: var(--pp-text); font-size: 0.84rem;
}
.partner-login-card .form-group input {
    width: 100%; padding: 13px 15px;
    border: 1.5px solid var(--pp-border); border-radius: var(--pp-rs);
    font-size: 0.95rem; background: var(--pp-lightest);
    transition: all var(--pp-ease);
}
.partner-login-card .form-group input:focus {
    outline: none; border-color: var(--pp-accent);
    box-shadow: 0 0 0 4px var(--pp-accent-bg); background: #fff;
}
.partner-login-card .login-error {
    color: #d32f2f; font-size: 0.85rem; margin-bottom: 12px; min-height: 20px;
}
.partner-login-card .btn-login {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, var(--pp-primary) 0%, var(--pp-mid) 100%);
    color: white; border: none; border-radius: var(--pp-rs);
    font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: all var(--pp-ease);
}
.partner-login-card .btn-login:hover {
    background: linear-gradient(135deg, var(--pp-deep) 0%, var(--pp-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.partner-login-card .btn-login:disabled {
    background: #b0b5c0; cursor: not-allowed; transform: none; box-shadow: none;
}
.partner-login-card .login-footer {
    text-align: center; margin-top: 26px; font-size: 0.85rem; color: var(--pp-muted);
}
.partner-login-card .login-footer a {
    color: var(--pp-accent); text-decoration: none; font-weight: 600;
}
.partner-login-card .login-footer a:hover { color: var(--pp-accent-soft); }

.password-requirements { font-size: 0.8rem; color: var(--pp-muted); margin-top: 6px; }
.password-match-error { color: #d32f2f; font-size: 0.8rem; margin-top: 4px; }

/* ══════════════════════════════════════
   HEADER
   ══════════════════════════════════════ */
.pp-header {
    background: var(--pp-deep);
    padding: 0 28px; display: flex; align-items: center;
    justify-content: space-between; height: 56px;
    position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pp-header-left {
    display: flex; align-items: center; gap: 0;
}
.pp-header-brand {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none; color: white; cursor: pointer;
}

/* Hamburger Toggle */
.sidebar-toggle {
    display: none; background: none; border: none; cursor: pointer;
    padding: 8px; margin-right: 8px; border-radius: 8px;
    flex-direction: column; gap: 5px; align-items: center; justify-content: center;
    width: 40px; height: 40px; transition: background 0.2s ease;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.08); }
.sidebar-toggle span {
    display: block; width: 20px; height: 2px;
    background: rgba(255,255,255,0.7); border-radius: 2px;
    transition: all 0.3s ease;
}
.sidebar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.sidebar-toggle.active span:nth-child(2) { opacity: 0; }
.sidebar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 149;
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }
.pp-header-icon {
    font-size: 1.3rem; display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,0.08);
}
.pp-header-title {
    font-weight: 700; font-size: 0.95rem; display: block; letter-spacing: -0.2px;
    color: #f0f1f4;
}
.pp-header-sub {
    font-size: 0.68rem; color: rgba(255,255,255,0.4); display: block;
    font-weight: 400; letter-spacing: 0.8px; text-transform: uppercase;
}
.pp-header-right { display: flex; align-items: center; gap: 12px; }
.pp-header-user {
    color: rgba(255,255,255,0.55); font-size: 0.82rem; font-weight: 500;
}

/* ══════════════════════════════════════
   PORTAL LAYOUT — FULL WIDTH
   ══════════════════════════════════════ */
.portal-container {
    margin: 0; padding: 0;
    background: var(--pp-page-bg);
    min-height: calc(100vh - 56px);
}
.portal-grid {
    display: grid; grid-template-columns: 240px 1fr;
    gap: 0; min-height: calc(100vh - 56px);
}


/* ══════════════════════════════════════
   DARK SIDEBAR
   ══════════════════════════════════════ */
.portal-sidebar.dark {
    background: var(--pp-primary);
    padding: 24px 14px; box-shadow: none;
    height: auto; min-height: calc(100vh - 56px);
    border: none; position: sticky; top: 56px;
    border-right: 1px solid rgba(255,255,255,0.05);
    border-radius: 0;
}
.portal-sidebar.dark .portal-avatar {
    text-align: center; padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06); margin-bottom: 12px;
}
.portal-sidebar.dark .portal-avatar span {
    font-size: 1.8rem; display: inline-flex; align-items: center; justify-content: center;
    width: 50px; height: 50px; border-radius: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
}
.portal-sidebar.dark .partner-name {
    text-align: center; font-weight: 700; font-size: 0.9rem;
    margin-bottom: 2px; color: #e8eaef;
}
.portal-sidebar.dark .partner-email {
    text-align: center; color: rgba(255,255,255,0.35);
    font-size: 0.75rem; margin-bottom: 22px;
}

/* Nav links */
.portal-nav { list-style: none; padding: 0; margin: 0; }
.portal-nav li { margin-bottom: 1px; }
.portal-nav a { display: flex; align-items: center; text-decoration: none; }
.portal-nav button.sign-out {
    display: flex; align-items: center; width: 100%;
    background: none; border: none; font-size: inherit; cursor: pointer;
}

.portal-sidebar.dark .portal-nav a,
.portal-sidebar.dark .portal-nav button {
    color: rgba(255,255,255,0.5); padding: 9px 12px;
    border-radius: var(--pp-rx); font-size: 0.85rem;
    font-weight: 500; transition: all var(--pp-ease);
}
.portal-sidebar.dark .portal-nav .nav-icon {
    display: inline-flex; width: 26px; justify-content: center;
    margin-right: 8px; font-size: 0.9rem;
}
.portal-sidebar.dark .portal-nav a:hover,
.portal-sidebar.dark .portal-nav button:hover {
    background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.85);
}
.portal-sidebar.dark .portal-nav a.active {
    background: var(--pp-accent-bg);
    color: var(--pp-accent-soft); font-weight: 600;
    border-left: 3px solid var(--pp-accent-soft);
    padding-left: 9px;
}
.portal-sidebar.dark .portal-nav .nav-divider {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.portal-sidebar.dark .portal-nav .sign-out {
    color: rgba(255,120,120,0.65); margin-top: 6px;
}
.portal-sidebar.dark .portal-nav .sign-out:hover {
    background: rgba(255,80,80,0.08); color: #ff7070;
}

/* ══════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════ */
.portal-content {
    background: var(--pp-page-bg);
    padding: 28px 32px; min-width: 0; overflow: hidden;
    border: none; border-radius: 0; box-shadow: none;
}
.portal-section { display: none; }
.portal-section.active { display: block; }

.section-header {
    display: flex; justify-content: center; align-items: center;
    margin-bottom: 24px; padding-bottom: 0; border-bottom: none;
    position: relative; width: 100%; max-width: none;
}
.section-header h2 {
    margin: 0; font-size: 1.45rem; color: var(--pp-text);
    font-weight: 800; letter-spacing: -0.3px;
}
.section-header .action-btn {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
}
.section-header .action-btn.primary:hover {
    transform: translateY(calc(-50% - 1px));
}

/* ══════════════════════════════════════
   STAT CARDS
   ══════════════════════════════════════ */
.stats-section { margin-bottom: 18px; }
.stats-section-title {
    font-size: 0.72rem; color: var(--pp-muted); margin: 0 0 10px;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
}
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px; margin-bottom: 14px;
}
.stats-grid.three-cols { grid-template-columns: repeat(3, 1fr); margin-bottom: 0; }
@media (max-width: 900px) {
    .stats-grid.three-cols { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

.stat-card {
    background: var(--pp-card); border-radius: var(--pp-rs);
    padding: 18px 20px; text-align: center;
    border: 1px solid var(--pp-border);
    transition: all var(--pp-ease); position: relative;
    box-shadow: var(--pp-shadow); overflow: hidden;
}
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover {
    transform: translateY(-2px); box-shadow: var(--pp-shadow-md);
}

/* Top accent bars */
.stat-card.pending         { border-top: 3px solid #ef6c00; }
.stat-card.today           { border-top: 3px solid #1976d2; }
.stat-card.progress        { border-top: 3px solid #7b1fa2; }
.stat-card.completed       { border-top: 3px solid #2e7d32; }
.stat-card.incoming-transit { border-top: 3px solid #5c6bc0; }
.stat-card.incoming-ready  { border-top: 3px solid #c2185b; }
.stat-card.incoming-released { border-top: 3px solid #00897b; }
.stat-card.waiting-dropoff { border-top: 3px solid #f9a825; }

.stat-value {
    font-size: 2rem; font-weight: 800; margin-bottom: 4px;
    font-family: var(--pp-mono); line-height: 1.1;
    color: var(--pp-text);
}
.stat-card.pending .stat-value         { color: #ef6c00; }
.stat-card.today .stat-value           { color: #1976d2; }
.stat-card.progress .stat-value        { color: #7b1fa2; }
.stat-card.completed .stat-value       { color: #2e7d32; }
.stat-card.incoming-transit .stat-value { color: #5c6bc0; }
.stat-card.incoming-ready .stat-value  { color: #c2185b; }
.stat-card.incoming-released .stat-value { color: #00897b; }
.stat-card.waiting-dropoff .stat-value { color: #f9a825; }

.stat-label {
    font-size: 0.74rem; color: var(--pp-muted);
    font-weight: 600; letter-spacing: 0.2px;
}

/* ══════════════════════════════════════
   COMPLETED SUMMARY + BILLING CARD
   ══════════════════════════════════════ */
.dashboard-bottom-row {
    display: flex; gap: 14px; align-items: stretch;
    margin-bottom: 22px; flex-wrap: wrap;
}
.completed-summary {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; background: var(--pp-card);
    border-radius: var(--pp-rs); font-size: 0.86rem;
    border: 1px solid var(--pp-border); flex: 1; min-width: 200px;
    box-shadow: var(--pp-shadow); margin-bottom: 0;
}
.completed-summary .completed-label { color: var(--pp-muted); }
.completed-summary .completed-value {
    font-weight: 800; color: #2e7d32; font-size: 1.1rem;
    font-family: var(--pp-mono);
}

.billing-card-dash {
    background: linear-gradient(135deg, #fdf8f0 0%, #fef3e0 100%);
    border: 1px solid #f0d878; border-radius: var(--pp-rs);
    padding: 12px 16px; display: flex; justify-content: space-between;
    align-items: center; cursor: pointer; transition: all var(--pp-ease);
    width: 100%; box-shadow: var(--pp-shadow);
}
.billing-card-dash:hover { transform: translateY(-2px); box-shadow: var(--pp-shadow-md); }
.billing-card-left { display: flex; align-items: center; gap: 12px; }
.billing-card-icon { font-size: 18px; }
.billing-card-label { font-size: 11px; color: #8c6d1f; }
.billing-card-amount { font-size: 1.2rem; font-weight: 800; color: #b8860b; font-family: var(--pp-mono); }
.billing-card-right { text-align: right; }
.billing-card-date { font-size: 14px; font-weight: 700; color: #b8860b; }
.billing-card-status { font-size: 10px; color: #8c6d1f; }

/* ══════════════════════════════════════
   TABLES
   ══════════════════════════════════════ */
.data-table {
    width: 100%; border-collapse: collapse;
    background: var(--pp-card); border-radius: var(--pp-rs);
    overflow: hidden; box-shadow: var(--pp-shadow);
    border: 1px solid var(--pp-border);
}
.data-table th, .data-table td {
    padding: 12px 16px; text-align: left;
    border-bottom: 1px solid var(--pp-divider);
}
.data-table th {
    font-weight: 700; color: var(--pp-text-secondary); font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 0.6px; white-space: nowrap;
    background: var(--pp-lightest);
}
.data-table tbody tr { transition: background var(--pp-ease); }
.data-table tbody tr:nth-child(even) { background: rgba(244,245,247,0.4); }
.data-table tbody tr:hover { background: var(--pp-light); }

/* ══════════════════════════════════════
   BADGES
   ══════════════════════════════════════ */
.tag-badge {
    display: inline-block; padding: 3px 9px; border-radius: 5px;
    font-size: 0.74rem; font-weight: 700;
    font-family: var(--pp-mono); letter-spacing: 0.3px;
}
.tag-badge.gold {
    background: linear-gradient(135deg, #fff8e1, #fff3cc);
    color: #e65100; border: 1px solid #ffe082;
}
.tag-badge.white { background: #f5f5f5; color: #616161; border: 1px solid #e0e0e0; }

.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px; border-radius: 20px;
    font-size: 0.74rem; font-weight: 600;
}
.status-badge::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.status-badge.pending_pickup      { background: #fff3e0; color: #e65100; }
.status-badge.pending_pickup::before { background: #e65100; }
.status-badge.waiting_for_drop_off { background: #fffbe6; color: #ad6800; }
.status-badge.waiting_for_drop_off::before { background: #ad6800; }
.status-badge.picked_up           { background: #e3f2fd; color: #1565c0; }
.status-badge.picked_up::before   { background: #1565c0; }
.status-badge.cancelled           { background: #ffebee; color: #c62828; }
.status-badge.cancelled::before   { background: #c62828; }
.status-badge.skipped             { background: #ffebee; color: #c62828; }
.status-badge.skipped::before     { background: #c62828; }
.status-badge.pending             { background: #fff3e0; color: #e65100; }
.status-badge.pending::before     { background: #e65100; }
.status-badge.received            { background: #e3f2fd; color: #1565c0; }
.status-badge.received::before    { background: #1565c0; }
.status-badge.at_facility         { background: #e0f7fa; color: #00838f; }
.status-badge.at_facility::before { background: #00838f; }
.status-badge.awaiting_cremation  { background: #fce4ec; color: #c2185b; }
.status-badge.awaiting_cremation::before { background: #c2185b; }
.status-badge.cremation_in_progress { background: #fff8e1; color: #ffa000; }
.status-badge.cremation_in_progress::before { background: #ffa000; }
.status-badge.cremated            { background: #e8f5e9; color: #2e7d32; }
.status-badge.cremated::before    { background: #2e7d32; }
.status-badge.returning           { background: #e8eaf6; color: #3f51b5; }
.status-badge.returning::before   { background: #3f51b5; }
.status-badge.ready_for_pickup    { background: #ede7f6; color: #5e35b1; }
.status-badge.ready_for_pickup::before { background: #5e35b1; }
.status-badge.delivered           { background: #e8f5e9; color: #1b5e20; }
.status-badge.delivered::before   { background: #1b5e20; }
.status-badge.arrived             { background: #e0f7fa; color: #00838f; }
.status-badge.arrived::before     { background: #00838f; }
.status-badge.waiting             { background: #fce4ec; color: #c2185b; }
.status-badge.waiting::before     { background: #c2185b; }
.status-badge.in_progress         { background: #fff8e1; color: #ffa000; }
.status-badge.in_progress::before { background: #ffa000; }
.status-badge.completed           { background: #e8f5e9; color: #2e7d32; }
.status-badge.completed::before   { background: #2e7d32; }

.service-badge {
    display: inline-block; padding: 4px 11px; border-radius: 5px;
    font-size: 0.74rem; font-weight: 600;
}
.service-badge.individual { background: linear-gradient(135deg, #fff8e1, #fff3cc); color: #e65100; }
.service-badge.viewing    { background: linear-gradient(135deg, #f3e8ff, #ede0ff); color: #7c3aed; }
.service-badge.communal   { background: #f0f0f2; color: #555; }

/* ══════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════ */
.action-btn {
    padding: 8px 16px; border: 1.5px solid var(--pp-border);
    border-radius: var(--pp-rx); background: var(--pp-card); cursor: pointer;
    font-size: 0.84rem; margin-right: 4px; transition: all var(--pp-ease);
    font-weight: 500; color: var(--pp-text);
}
.action-btn:hover {
    background: var(--pp-lightest); border-color: var(--pp-mid); color: var(--pp-text);
}
.action-btn.primary {
    background: var(--pp-primary); color: white; border-color: transparent;
    font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.action-btn.primary:hover {
    background: var(--pp-deep); transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.action-btn.secondary {
    background: var(--pp-lightest); color: var(--pp-muted); border-color: var(--pp-border);
}
.action-btn.secondary:hover { background: var(--pp-light); color: var(--pp-text); }
.action-btn.small { padding: 5px 11px; font-size: 0.78rem; }
.action-btn.danger { color: #d32f2f; border-color: #ffcdd2; }
.action-btn.danger:hover { background: #fff5f5; border-color: #ef9a9a; }

/* ══════════════════════════════════════
   FORMS
   ══════════════════════════════════════ */
.form-section {
    background: transparent; border-radius: 0;
    padding: 0 0 28px 0; margin-bottom: 28px;
    border: none; box-shadow: none;
    border-bottom: 1px solid var(--pp-divider);
}
.form-section:last-of-type { border-bottom: none; }
.form-section h3 {
    margin: 0 0 20px; font-size: 0.75rem;
    color: var(--pp-accent); font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.2px;
}
.form-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 16px;
}
.form-group { margin-bottom: 0; }
.form-group label {
    display: block; margin-bottom: 7px; font-weight: 600;
    color: var(--pp-text-secondary); font-size: 0.82rem;
    letter-spacing: 0.01em;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--pp-border); border-radius: 10px;
    font-size: 0.92rem; background: var(--pp-card); transition: all 0.2s ease;
    color: var(--pp-text);
}
.form-group input::placeholder, .form-group textarea::placeholder {
    color: var(--pp-muted); opacity: 0.6;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--pp-accent);
    box-shadow: 0 0 0 3px var(--pp-accent-bg); background: #fff;
}

/* New Request form wrapper */
#newRequestForm form {
    background: var(--pp-card); border-radius: 16px;
    padding: 32px; border: 1px solid var(--pp-border);
    box-shadow: var(--pp-shadow);
}

.form-section.price-summary-section {
    background: transparent; border-color: transparent;
}

.form-select {
    padding: 11px 14px; border: 1.5px solid var(--pp-border);
    border-radius: 10px; font-size: 0.92rem;
    background: var(--pp-card); color: var(--pp-text); transition: all 0.2s ease;
}
.form-select:focus { outline: none; border-color: var(--pp-accent); box-shadow: 0 0 0 3px var(--pp-accent-bg); }

/* Service Options */
.service-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 768px) { .service-options { grid-template-columns: 1fr; } }
.service-option {
    border: 2px solid var(--pp-border); border-radius: 14px;
    padding: 22px 16px; cursor: pointer; transition: all 0.25s ease;
    text-align: center; background: var(--pp-card);
    position: relative; overflow: hidden;
}
.service-option::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--pp-accent-bg) 0%, transparent 60%);
    opacity: 0; transition: opacity 0.25s ease;
}
.service-option:hover {
    border-color: var(--pp-accent-soft); background: var(--pp-card);
    transform: translateY(-3px); box-shadow: 0 8px 24px rgba(99,110,224,0.1);
}
.service-option:hover::before { opacity: 1; }
.service-option.selected {
    border-color: var(--pp-accent);
    background: var(--pp-card);
    box-shadow: 0 0 0 3px var(--pp-accent-bg), 0 4px 16px rgba(99,110,224,0.12);
}
.service-option.selected::before { opacity: 1; }
.service-option.selected::after {
    content: '✓'; position: absolute; top: 10px; right: 12px;
    width: 22px; height: 22px; background: var(--pp-accent); color: white;
    border-radius: 50%; font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.service-option .icon { font-size: 2rem; margin-bottom: 10px; position: relative; }
.service-option .name { font-weight: 700; margin-bottom: 5px; color: var(--pp-text); font-size: 0.94rem; position: relative; }
.service-option .desc { font-size: 0.78rem; color: var(--pp-muted); line-height: 1.4; position: relative; }
.service-option .tag-type { margin-top: 10px; font-size: 0.72rem; font-weight: 700; position: relative; letter-spacing: 0.5px; }

/* Price Summary Card */
.price-summary-card {
    background: var(--pp-lightest); border-radius: 12px;
    padding: 20px 22px; border: 1px solid var(--pp-divider);
}
.price-line {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 0; font-size: 0.9rem; color: var(--pp-text-secondary);
    border-bottom: 1px solid var(--pp-divider);
}
.price-line:last-child { border-bottom: none; }
.price-line span:last-child { font-weight: 600; color: var(--pp-text); font-variant-numeric: tabular-nums; }
.price-line.price-total {
    border-top: 2px solid var(--pp-accent); border-bottom: none;
    margin-top: 6px; padding-top: 14px;
    font-size: 1.15rem; font-weight: 700; color: var(--pp-accent);
}
.price-line.price-total span:last-child { color: var(--pp-accent); font-size: 1.2rem; }

/* Submit Button */
.submit-request-btn {
    width: 100%; padding: 16px 32px; font-size: 1rem;
    font-weight: 700; color: white; border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--pp-accent) 0%, var(--pp-accent-soft) 100%);
    border-radius: 12px; transition: all 0.3s ease;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 4px 14px rgba(99,110,224,0.25);
    letter-spacing: 0.02em; margin-top: 8px;
}
.submit-request-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99,110,224,0.35);
}
.submit-request-btn:active { transform: translateY(0); }
.submit-request-btn .submit-arrow {
    transition: transform 0.2s ease; font-size: 1.15rem;
}
.submit-request-btn:hover .submit-arrow { transform: translateX(4px); }

/* ══════════════════════════════════════
   SUCCESS
   ══════════════════════════════════════ */
.success-result { text-align: center; padding: 56px 20px; }
.success-result .icon { font-size: 3.5rem; margin-bottom: 16px; }
.success-result h3 { color: var(--pp-accent); margin-bottom: 24px; font-size: 1.3rem; font-weight: 800; }
.success-result .tag-info {
    background: var(--pp-card); border-radius: 16px;
    padding: 28px 36px; display: inline-block; margin-bottom: 28px;
    border: 1px solid var(--pp-border); box-shadow: 0 4px 20px rgba(99,110,224,0.08);
}
.success-result .tag-number {
    font-size: 1.5rem; font-family: var(--pp-mono);
    font-weight: 800; margin-bottom: 8px; color: var(--pp-text);
}
.success-result .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ══════════════════════════════════════
   PROFILE
   ══════════════════════════════════════ */
.profile-card {
    background: var(--pp-card); border-radius: 16px;
    padding: 28px 32px; border: 1px solid var(--pp-border);
    box-shadow: var(--pp-shadow);
}
.profile-card-header {
    display: flex; align-items: center; gap: 18px;
    padding-bottom: 24px; margin-bottom: 24px;
    border-bottom: 1px solid var(--pp-divider);
}
.profile-avatar {
    width: 56px; height: 56px; border-radius: 14px;
    background: linear-gradient(135deg, var(--pp-accent) 0%, var(--pp-accent-soft) 100%);
    color: white; font-size: 1.4rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; box-shadow: 0 4px 12px rgba(99,110,224,0.2);
}
.profile-header-info { flex: 1; min-width: 0; }
.profile-header-info h3 {
    margin: 0 0 4px; font-size: 1.2rem; font-weight: 800;
    color: var(--pp-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-badge {
    display: inline-block; padding: 3px 10px; border-radius: 6px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px;
    background: var(--pp-accent-bg); color: var(--pp-accent);
    text-transform: uppercase;
}
.profile-edit-btn {
    padding: 8px 18px; border: 1.5px solid var(--pp-border);
    border-radius: 10px; background: var(--pp-card); cursor: pointer;
    font-size: 0.84rem; font-weight: 600; color: var(--pp-text);
    transition: all 0.2s ease; display: flex; align-items: center; gap: 6px;
    white-space: nowrap; flex-shrink: 0;
}
.profile-edit-btn:hover {
    border-color: var(--pp-accent); color: var(--pp-accent);
    background: var(--pp-accent-bg);
}
.profile-details-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 0;
}
.profile-detail-item {
    padding: 14px 0; border-bottom: 1px solid var(--pp-divider);
}
.profile-detail-item:nth-child(odd) { padding-right: 20px; }
.profile-detail-item:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--pp-divider); }
.profile-detail-item:nth-last-child(-n+2) { border-bottom: none; }
.profile-detail-label {
    font-size: 0.76rem; font-weight: 600; color: var(--pp-muted);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px;
}
.profile-detail-value {
    font-size: 0.95rem; font-weight: 600; color: var(--pp-text);
}
.profile-card-section-title {
    font-size: 0.75rem; font-weight: 700; color: var(--pp-accent);
    text-transform: uppercase; letter-spacing: 1.2px;
    margin-bottom: 22px;
}
.profile-msg {
    font-size: 0.85rem; min-height: 20px; margin: 4px 0;
}
.profile-msg.error { color: #d32f2f; }
.profile-msg.success { color: #2e7d32; }
.profile-edit-actions {
    display: flex; gap: 12px; margin-top: 20px;
}
.input-disabled {
    background: var(--pp-lightest) !important; color: var(--pp-muted) !important;
    cursor: not-allowed;
}
.field-hint {
    font-size: 0.78rem; color: var(--pp-muted); margin-top: 5px;
}
@media (max-width: 640px) {
    .profile-details-grid { grid-template-columns: 1fr; }
    .profile-detail-item:nth-child(even) { padding-left: 0; border-left: none; }
    .profile-detail-item:nth-child(odd) { padding-right: 0; }
    .profile-card-header { flex-wrap: wrap; }
}

/* ══════════════════════════════════════
   MODAL
   ══════════════════════════════════════ */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
    z-index: 1000; align-items: flex-start; justify-content: center;
    padding: 40px 20px; overflow-y: auto;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--pp-card); border-radius: 20px; padding: 28px;
    max-width: 600px; width: 90%; margin: auto;
    box-shadow: var(--pp-shadow-lg);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 22px; padding-bottom: 16px;
    border-bottom: 1px solid var(--pp-divider);
}
.modal-header h3 { margin: 0; font-weight: 700; color: var(--pp-text); font-size: 1.1rem; }
.modal-close {
    background: var(--pp-lightest); border: none; font-size: 1.2rem;
    cursor: pointer; color: var(--pp-muted);
    width: 36px; height: 36px; border-radius: var(--pp-rx);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--pp-ease);
}
.modal-close:hover { background: var(--pp-light); color: var(--pp-text); }

.detail-row { display: flex; padding: 10px 0; border-bottom: 1px solid var(--pp-divider); }
.detail-row .label { width: 130px; font-weight: 600; color: var(--pp-muted); font-size: 0.84rem; flex-shrink: 0; }
.detail-row .value { flex: 1; color: var(--pp-text); font-weight: 500; }

/* Invoice Detail Modal */
#invoiceDetailModal.modal {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
    z-index: 1000; align-items: center; justify-content: center;
    padding: 20px; overflow-y: auto;
}
#invoiceDetailModal .modal-content {
    background: var(--pp-card); border-radius: 20px; padding: 0;
    width: 94%; max-width: 1100px; margin: auto; box-shadow: var(--pp-shadow-lg); overflow: hidden;
    max-height: 92vh; display: flex; flex-direction: column;
}
#invoiceDetailModal .modal-header {
    padding: 18px 28px; flex-shrink: 0;
}
#invoiceDetailModal .modal-body {
    padding: 24px 28px; overflow-y: auto; flex: 1; min-height: 0;
}
#invoiceDetailModal .modal-footer {
    padding: 14px 28px; border-top: 1px solid var(--pp-divider); background: var(--pp-lightest);
    flex-shrink: 0;
}

/* ══════════════════════════════════════
   TIMELINE
   ══════════════════════════════════════ */
.timeline { padding: 14px 0; }
.timeline-item { display: flex; gap: 14px; padding-bottom: 22px; position: relative; }
.timeline-item:not(:last-child)::before {
    content: ''; position: absolute; left: 12px; top: 30px; bottom: 0;
    width: 2px; background: linear-gradient(to bottom, var(--pp-border), transparent);
}
.timeline-dot {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--pp-border); flex-shrink: 0;
    border: 3px solid var(--pp-card);
    box-shadow: 0 0 0 2px var(--pp-border);
}
.timeline-dot.active {
    background: var(--pp-accent);
    box-shadow: 0 0 0 2px var(--pp-accent), 0 0 0 5px var(--pp-accent-bg);
}
.timeline-content { flex: 1; }
.timeline-status { font-weight: 600; margin-bottom: 3px; color: var(--pp-text); }
.timeline-note { color: var(--pp-muted); font-size: 0.84rem; line-height: 1.4; }
.timeline-date { color: #b0b5c0; font-size: 0.74rem; margin-top: 3px; font-family: var(--pp-mono); }

/* ══════════════════════════════════════
   MISC
   ══════════════════════════════════════ */
.loading { text-align: center; padding: 48px; color: var(--pp-muted); }
.empty-state { text-align: center; padding: 56px 20px; color: var(--pp-muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 14px; opacity: 0.3; }
.error-state { text-align: center; padding: 40px 20px; color: var(--pp-muted); }
.error-state p { margin-bottom: 16px; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.filter-bar select {
    padding: 9px 13px; border: 1.5px solid var(--pp-border);
    border-radius: var(--pp-rx); font-size: 0.88rem; background: var(--pp-card);
    transition: all var(--pp-ease); color: var(--pp-text);
}
.filter-bar select:focus { outline: none; border-color: var(--pp-accent); box-shadow: 0 0 0 3px var(--pp-accent-bg); }
.filter-bar .search-input {
    flex: 1; min-width: 240px; padding: 9px 14px;
    border: 1.5px solid var(--pp-border); border-radius: var(--pp-rx);
    font-size: 0.88rem; background: var(--pp-card); transition: all var(--pp-ease);
}
.filter-bar .search-input:focus {
    outline: none; border-color: var(--pp-accent);
    box-shadow: 0 0 0 3px var(--pp-accent-bg);
}

.recent-title { margin: 0 0 14px; font-size: 1rem; color: var(--pp-text); font-weight: 700; }
.portal-section p { line-height: 1.5; }
.clickable { cursor: pointer; }

/* ══════════════════════════════════════
   PRODUCTS
   ══════════════════════════════════════ */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.product-item {
    display: flex; align-items: center; gap: 12px; padding: 13px;
    border: 2px solid var(--pp-border); border-radius: var(--pp-rs);
    cursor: pointer; transition: all var(--pp-ease); background: var(--pp-card);
}
.product-item:hover { border-color: var(--pp-accent); background: var(--pp-lightest); }
.product-item.selected {
    border-color: var(--pp-accent); background: var(--pp-accent-bg);
}
.product-item.out-of-stock { opacity: 0.45; cursor: not-allowed; }
.product-item.out-of-stock:hover { border-color: var(--pp-border); background: var(--pp-card); }
.product-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--pp-accent); }
.product-item .product-info { flex: 1; }
.product-item .product-name { font-weight: 600; margin-bottom: 2px; color: var(--pp-text); font-size: 0.9rem; }
.product-item .product-price { color: var(--pp-accent); font-weight: 700; font-family: var(--pp-mono); }
.product-item .stock-info { font-size: 0.73rem; margin-top: 2px; font-weight: 500; }
.product-item .stock-info.in-stock { color: #4caf50; }
.product-item .stock-info.low-stock { color: #ff9800; }
.product-item .stock-info.out-of-stock { color: #f44336; }
.product-item .product-qty {
    width: 58px; padding: 6px 8px; border: 1.5px solid var(--pp-border);
    border-radius: 6px; text-align: center; font-family: var(--pp-mono); font-weight: 600;
}

/* ══════════════════════════════════════
   INVOICE
   ══════════════════════════════════════ */
.invoice-company-header { display: none; text-align: center; padding-bottom: 20px; border-bottom: 2px solid #333; margin-bottom: 20px; }
.invoice-title-print { display: none; text-align: center; font-size: 1.5rem; font-weight: bold; margin-bottom: 20px; }
.invoice-section { margin-bottom: 22px; }
.invoice-section-title {
    font-weight: 700; font-size: 0.92rem; margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 2px solid var(--pp-light); color: var(--pp-text);
}
.invoice-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.invoice-info-item { display: flex; flex-direction: column; gap: 3px; }
.invoice-info-item .label {
    font-size: 0.7rem; color: var(--pp-muted); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.invoice-info-item .value { font-weight: 600; color: var(--pp-text); }
.invoice-items-table { width: 100%; border-collapse: collapse; }
.invoice-items-table th, .invoice-items-table td {
    padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--pp-divider);
}
.invoice-items-table th {
    background: var(--pp-lightest); font-weight: 700; font-size: 0.76rem;
    color: var(--pp-text-secondary); text-transform: uppercase; letter-spacing: 0.3px;
}
.invoice-total {
    margin-top: 14px; padding: 18px; background: var(--pp-lightest);
    border-radius: var(--pp-rs); border: 1px solid var(--pp-border);
}
.invoice-total-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.9rem; }
.invoice-total-row.grand-total {
    font-size: 1.2rem; font-weight: 800; color: var(--pp-text);
    border-top: 2px solid var(--pp-border); margin-top: 8px; padding-top: 12px;
    font-family: var(--pp-mono);
}

.invoice-for-pdf .invoice-company-header,
.invoice-for-pdf .invoice-title-print { display: block !important; }
@media print {
    body > *:not(.modal-overlay) { display: none !important; }
    #invoiceModal { display: block !important; position: static !important; background: white !important; }
    #invoiceModal .modal { position: static !important; max-width: 100% !important; box-shadow: none !important; }
    #invoiceModal .modal-header { display: none !important; }
    .invoice-company-header, .invoice-title-print { display: block !important; }
}

/* ══════════════════════════════════════
   NEXT SERVICE
   ══════════════════════════════════════ */
.next-service-card {
    background: var(--pp-card); border-left: 4px solid var(--pp-accent);
    border-radius: var(--pp-r); padding: 24px; margin-bottom: 22px;
    border-top: 1px solid var(--pp-border);
    border-right: 1px solid var(--pp-border);
    border-bottom: 1px solid var(--pp-border);
    box-shadow: var(--pp-shadow); position: relative; overflow: hidden;
}
.next-service-card::after {
    content: ''; position: absolute; top: -30px; right: -30px;
    width: 130px; height: 130px; border-radius: 50%;
    background: radial-gradient(circle, var(--pp-accent-bg), transparent 70%);
}
.next-service-card.no-schedule {
    background: var(--pp-card); border-left: 4px solid #ccc;
}
.next-service-card.no-schedule::after { display: none; }

.next-service-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.next-service-title h3 { margin: 0; font-size: 1.05rem; color: var(--pp-text); font-weight: 700; }
.next-service-card.no-schedule .next-service-title h3 { color: #999; }

.next-service-date {
    background: var(--pp-primary); color: white;
    padding: 10px 16px; border-radius: var(--pp-rs);
    font-weight: 600; text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.next-service-date .day { font-size: 1.6rem; line-height: 1; font-family: var(--pp-mono); font-weight: 800; }
.next-service-date .month { font-size: 0.76rem; opacity: 0.7; }

.next-service-details {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px; margin-bottom: 18px;
}
.next-service-detail { display: flex; align-items: center; gap: 8px; }
.next-service-detail .icon { font-size: 1.1rem; }
.next-service-detail .label { color: var(--pp-muted); font-size: 0.8rem; }
.next-service-detail .value { font-weight: 700; color: var(--pp-text); }

.next-service-items { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .next-service-items { grid-template-columns: 1fr; } }

.next-service-item-group {
    background: var(--pp-lightest);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-radius: var(--pp-rs); padding: 14px;
    border: 1px solid var(--pp-border);
}
.next-service-item-group h4 {
    margin: 0 0 10px; font-size: 0.88rem;
    display: flex; align-items: center; gap: 8px; font-weight: 700;
}
.next-service-item-group h4.pickup { color: #ef6c00; }
.next-service-item-group h4.dropoff { color: #1976d2; }

.next-service-item-list { list-style: none; padding: 0; margin: 0; max-height: 150px; overflow-y: auto; }
.next-service-item-list li { padding: 7px 0; border-bottom: 1px solid var(--pp-divider); font-size: 0.84rem; }
.next-service-item-list li:last-child { border-bottom: none; }
.next-service-item-list .tracking { font-family: var(--pp-mono); color: var(--pp-muted); font-size: 0.74rem; }
.next-service-empty { color: #b0b5c0; font-style: italic; font-size: 0.84rem; }
.next-service-no-schedule { text-align: center; padding: 22px; color: var(--pp-muted); }
.next-service-no-schedule .icon { font-size: 2.2rem; margin-bottom: 10px; }

.next-service-summary { display: flex; gap: 22px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--pp-divider); }
.next-service-summary-item { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--pp-muted); }
.next-service-summary-item .count { font-weight: 800; color: var(--pp-text); font-family: var(--pp-mono); }

/* ══════════════════════════════════════
   DROP-OFF PENDING MODAL
   ══════════════════════════════════════ */
#dropOffPendingModal .modal-header { border-radius: 20px 20px 0 0; }

/* ══════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5c8ce; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0a4ac; }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar-toggle { display: flex; }
    .portal-grid { grid-template-columns: 1fr; }
    .portal-sidebar.dark {
        position: fixed; top: 56px; left: 0; bottom: 0;
        width: 260px; min-height: 0; z-index: 150;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: none;
    }
    .portal-sidebar.dark.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.2);
    }
    .portal-content { padding: 18px 14px; }
    .pp-header { padding: 0 14px; }
    .pp-header-sub { display: none; }
}

/* Legacy */
.portal-logo { display: none; }