/* ==========================================================================
   Module 6 – Accept Invitation (front-end)
   ========================================================================== */

.phgear-accept-invite-wrap {
    display: flex;
    justify-content: center;
    padding: 40px 16px;
    min-height: 60vh;
    align-items: center;
}

.phgear-invite-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 40px 36px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    text-align: center;
}

.phgear-invite-icon {
    font-size: 48px;
    margin-bottom: 12px;
    line-height: 1;
}

.phgear-invite-box h2 {
    font-size: 22px;
    margin: 0 0 8px;
    color: #1a202c;
}

.phgear-invite-sub {
    font-size: 14px;
    color: #555;
    margin-bottom: 24px;
}

.phgear-field-group {
    text-align: left;
    margin-bottom: 16px;
}

.phgear-field-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.phgear-field-group input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

.phgear-field-group input[type="password"]:focus {
    border-color: #027491;
    box-shadow: 0 0 0 3px rgba(2,116,145,.12);
}

#phgear-strength-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

#phgear-strength-bar .phgear-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width .3s ease, background .3s ease;
}

.phgear-invite-notice {
    margin: 12px 0;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    text-align: left;
    display: none;
}

.phgear-notice--success {
    background: #f0fff4;
    border: 1px solid #68d391;
    color: #276128;
}

.phgear-notice--error {
    background: #fff5f5;
    border: 1px solid #fc8181;
    color: #9b2c2c;
}

.phgear-btn-primary {
    display: block;
    width: 100%;
    padding: 12px;
    background: #027491;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background .2s, transform .1s;
}

.phgear-btn-primary:hover  { background: #025f78; }
.phgear-btn-primary:active { transform: scale(.98); }
.phgear-btn-primary:disabled { background: #93c5d8; cursor: not-allowed; }

.phgear-invite-success p {
    color: #374151;
    font-size: 14px;
    margin: 8px 0 16px;
}

.phgear-spinner-inline {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.phgear-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #027491;
    animation: phgearBounce 1.2s infinite ease-in-out;
}

.phgear-dot:nth-child(2) { animation-delay: .2s; }
.phgear-dot:nth-child(3) { animation-delay: .4s; }

@keyframes phgearBounce {
    0%, 80%, 100% { transform: scale(.6); opacity: .5; }
    40%           { transform: scale(1);  opacity: 1;  }
}

.phgear-error {
    color: #9b2c2c;
    background: #fff5f5;
    border: 1px solid #fc8181;
    border-radius: 8px;
    padding: 16px 20px;
    max-width: 440px;
    margin: 40px auto;
    text-align: center;
}

/* ==========================================================================
   Module 1 – Customer Dashboard
   ========================================================================== */

.phgear-dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    font-family: inherit;
}

/* Header */
.phgear-db-header {
    margin-bottom: 24px;
}

.phgear-db-welcome {
    display: flex;
    align-items: center;
    gap: 16px;
}

.phgear-db-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #027491;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.phgear-db-welcome h2 {
    margin: 0 0 4px;
    font-size: 20px;
    color: #1a202c;
}

.phgear-db-welcome p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* Panel card */
.phgear-db-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
    margin-bottom: 24px;
}

.phgear-db-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.phgear-db-panel-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

/* Search */
.phgear-db-search-wrap input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    width: 220px;
    outline: none;
    transition: border-color .2s;
}

.phgear-db-search-wrap input:focus {
    border-color: #027491;
    box-shadow: 0 0 0 2px rgba(2,116,145,.1);
}

/* Loading */
.phgear-db-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6b7280;
    font-size: 14px;
    padding: 20px 0;
}

.phgear-spinner-ring {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #027491;
    border-radius: 50%;
    animation: phgearSpin .7s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

@keyframes phgearSpin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.phgear-db-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.phgear-db-empty-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

/* Orders table */
.phgear-db-table-wrap {
    overflow-x: auto;
}

.phgear-db-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.phgear-db-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #6b7280;
    border-bottom: 2px solid #f3f4f6;
    white-space: nowrap;
}

.phgear-db-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    vertical-align: middle;
}

.phgear-db-table tr:last-child td {
    border-bottom: none;
}

.phgear-db-table tbody tr:hover td {
    background: #f9fafb;
}

/* Tracking */
.phgear-tracking {
    font-family: monospace;
    font-size: 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 2px 7px;
    border-radius: 4px;
}

.phgear-tracking-none {
    color: #9ca3af;
}

/* View button */
.phgear-db-view-btn {
    background: #027491;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}

.phgear-db-view-btn:hover {
    background: #025f78;
}

/* Status badges – extend base .phgear-badge from Module 6 */
.phgear-badge--completed  { background: #d1fae5; color: #065f46 !important; }
.phgear-badge--processing { background: #dbeafe; color: #1e40af !important; }
.phgear-badge--sent       { background: #e0f2fe; color: #0369a1 !important; }
.phgear-badge--pending    { background: #fef9c3; color: #854d0e !important; }
.phgear-badge--on-hold    { background: #fce7f3; color: #9d174d !important; }
.phgear-badge--cancelled  { background: #fee2e2; color: #991b1b !important; }
.phgear-badge--refunded   { background: #f3f4f6; color: #4b5563 !important; }
.phgear-badge--failed     { background: #fef2f2; color: #b91c1c !important; }

/* ── Detail panel ───────────────────────────────────────────────────────── */

.phgear-db-back-btn {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #374151;
    transition: background .15s;
}

.phgear-db-back-btn:hover {
    background: #f3f4f6;
}

/* Meta summary grid */
.phgear-detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 24px;
}

.phgear-detail-meta-grid > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.phgear-detail-meta-grid > div > span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #9ca3af;
}

.phgear-detail-meta-grid .phgear-badge{
    width: fit-content;
}

/* Two-column detail layout */
.phgear-db-detail-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 640px) {
    .phgear-db-detail-cols {
        grid-template-columns: 1fr;
    }
}

.phgear-db-detail-col h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #6b7280;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

/* Items list */
.phgear-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.phgear-item-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid #f3f4f6;
    border-radius: 7px;
}

.phgear-item-img img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

.phgear-item-no-img {
    width: 52px;
    height: 52px;
    background: #f3f4f6;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.phgear-item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;
}

.phgear-item-info strong {
    color: #111827;
}

.phgear-item-info span {
    color: #6b7280;
}

/* Shipping info */
.phgear-shipping-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.phgear-shipping-info > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.phgear-shipping-info span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #9ca3af;
}

.phgear-shipping-info strong {
    font-size: 14px;
    color: #111827;
}

/* ==========================================================================
   Module 3 – Customer Accounting
   ========================================================================== */

/* Tab bar */
.phgear-db-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0;
}

.phgear-db-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    border-radius: 0;
}

.phgear-db-tab:hover {
    color: #027491;
}

.phgear-db-tab--active {
    color: #027491;
    border-bottom-color: #027491;
}

/* Accounting section headers */
.phgear-ac-section {
    margin-top: 28px;
}

.phgear-ac-section h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #6b7280;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

/* Summary boxes */
.phgear-ac-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}

.phgear-ac-box {
    border-radius: 10px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid #e5e7eb;
}

.phgear-ac-box span {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #9ca3af;
}

.phgear-ac-box strong, .phgear-ac-box strong span {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.phgear-ac-box--total  { background: #f9fafb; }
.phgear-ac-box--credit { background: #f0fdf4; border-color: #bbf7d0; }
.phgear-ac-box--credit strong { color: #166534; }

.phgear-ac-box--owed { background: #f9fafb; }
.phgear-ac-box--owed-active {
    background: #fff7ed;
    border-color: #fed7aa;
}
.phgear-ac-box--owed-active strong { color: #c2410c; }

/* Credit amount in log */
.phgear-ac-credit-amount {
    display: inline-block;
    padding: 2px 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
}

/* ==========================================================================
   Module 5 – Employee Panel
   ========================================================================== */

.phgear-emp-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    font-family: inherit;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.phgear-emp-header {
    margin-bottom: 24px;
}

.phgear-emp-welcome {
    display: flex;
    align-items: center;
    gap: 16px;
}

.phgear-emp-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #7c3aed;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.phgear-emp-welcome h2 {
    margin: 0 0 4px;
    font-size: 20px;
    color: #1a202c;
}

.phgear-emp-welcome p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* ── Panel card ──────────────────────────────────────────────────────────── */

.phgear-emp-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
    margin-bottom: 24px;
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */

.phgear-emp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.phgear-emp-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.phgear-emp-filters input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    width: 220px;
    outline: none;
    transition: border-color .2s;
}

.phgear-emp-filters input[type="text"]:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124,58,237,.1);
}

.phgear-emp-filters select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    outline: none;
    cursor: pointer;
    transition: border-color .2s;
}

.phgear-emp-filters select:focus {
    border-color: #7c3aed;
}

.phgear-emp-refresh-btn {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #374151;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}

.phgear-emp-refresh-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */

.phgear-emp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
}

.phgear-emp-page-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #374151;
    transition: background .15s;
}

.phgear-emp-page-btn:hover:not(:disabled) {
    background: #f3f4f6;
}

.phgear-emp-page-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ── Edit form ───────────────────────────────────────────────────────────── */

.phgear-emp-order-summary {
    margin-bottom: 24px;
}

.phgear-emp-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.phgear-emp-summary-grid > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.phgear-emp-summary-grid > div > span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #9ca3af;
}

.phgear-emp-summary-grid .phgear-badge{
    width: fit-content;
}

.phgear-emp-edit-form {
    max-width: 560px;
    width: 50%;
}

.phgear-emp-field-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.phgear-emp-field-row label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.phgear-optional {
    font-weight: 400;
    color: #9ca3af;
}

.phgear-emp-field-row select,
.phgear-emp-field-row input[type="text"],
.phgear-emp-field-row textarea {
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
}

.phgear-emp-field-row select:focus,
.phgear-emp-field-row input[type="text"]:focus,
.phgear-emp-field-row textarea:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}

.phgear-emp-field-row textarea {
    resize: vertical;
    min-height: 68px;
}

.phgear-emp-form-actions {
    margin-top: 8px;
    margin-bottom: 14px;
}

.phgear-emp-save-btn {
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 11px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s;
}

.phgear-emp-save-btn:hover  { background: #6d28d9; }
.phgear-emp-save-btn:active { transform: scale(.98); }
.phgear-emp-save-btn:disabled {
    background: #c4b5fd;
    cursor: not-allowed;
}

/* Customer email in orders table */
#phgear-emp-table td small {
    color: #9ca3af;
    font-size: 11px;
}

/* Sent date badge (used in customer dashboard + employee panel) */
.phgear-sent-date {
    font-family: inherit;
    font-size: 12px !important;
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    color: #0369a1 !important;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    width: fit-content;
}

/* Employee panel summary customer email */
.phgear-emp-summary-grid small {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

/* Pagination bar – customer dashboard */
.phgear-pg-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 0 4px;
    font-size: 13px;
    color: #6b7280;
}

.phgear-pg-bar .phgear-pg-info {
    min-width: 120px;
    text-align: center;
}

/* ==========================================================================
   PhGear Portal – Single Page Template Shell
   ========================================================================== */

/* ── Reset body for portal pages ────────────────────────────────────────── */
body.phgear-portal-body {
    margin: 0;
    padding: 0;
    background: #f1f5f9;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /*overflow-x: hidden;*/
}

/* ── Portal shell ────────────────────────────────────────────────────────── */
.phgear-portal {
    display: flex;
    min-height: 100vh;
    overflow-x: clip;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.phgear-portal-sidebar {
    width: 72px;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: width 0.22s ease;
    overflow: hidden;
}

/* Sidebar expands on hover (desktop) */
@media (min-width: 769px) {
    .phgear-portal-sidebar:hover {
        width: 200px;
    }
    .phgear-portal-sidebar:hover .phgear-portal-nav-label,
    .phgear-portal-sidebar:hover .phgear-portal-user-name,
    .phgear-portal-sidebar:hover .phgear-portal-brand-name {
        opacity: 1;
        max-width: 140px;
    }
}

/* ── Brand ───────────────────────────────────────────────────────────────── */
.phgear-portal-brand {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 0 16px;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
    min-height: 60px;
    box-sizing: border-box;
}

.phgear-portal-brand-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}

.phgear-portal-brand-name {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.18s, max-width 0.18s;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.phgear-portal-nav {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 0;
    flex: 1;
    gap: 2px;
}

.phgear-portal-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    text-decoration: none;
    color: #94a3b8;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    justify-content: flex-start;
    padding-left: 22px;
    box-sizing: border-box;
    position: relative;
}

.phgear-portal-nav-item:hover {
    background: rgba(255,255,255,0.07);
    color: #f8fafc;
    text-decoration: none;
}

.phgear-portal-nav-item--active {
    background: rgba(2, 116, 145, 0.25);
    color: #38bdf8;
    border-left: 3px solid #38bdf8;
    padding-left: 19px;
}

.phgear-portal-nav-item--active:hover {
    background: rgba(2, 116, 145, 0.35);
    color: #38bdf8;
}

.phgear-portal-nav-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 26px;
    text-align: center;
    line-height: 1;
}

.phgear-portal-nav-label {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.18s, max-width 0.18s;
}

/* Spacer pushes auth to bottom */
.phgear-portal-sidebar-spacer {
    flex: 1;
}

/* ── User strip ──────────────────────────────────────────────────────────── */
.phgear-portal-user {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 8px 18px;
    box-sizing: border-box;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.phgear-portal-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #027491;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.phgear-portal-user-name {
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
    white-space: nowrap;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.18s, max-width 0.18s;
}

/* ── Auth (logout/login) ─────────────────────────────────────────────────── */
.phgear-portal-auth {
    width: 100%;
    padding-bottom: 8px;
}

.phgear-portal-nav-item--logout,
.phgear-portal-nav-item--login {
    color: #64748b;
}

.phgear-portal-nav-item--logout:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

.phgear-portal-nav-item--login:hover {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
}

/* ── Content area ────────────────────────────────────────────────────────── */
.phgear-portal-content {
    margin-left: 72px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top bar (mobile only) ───────────────────────────────────────────────── */
.phgear-portal-topbar {
    display: none; /* hidden on desktop */
    align-items: center;
    justify-content: space-between;
    background: #0f172a;
    color: #f8fafc;
    padding: 0 14px;
    height: 54px;
    position: sticky;
    top: 0;
    z-index: 500;
    flex-shrink: 0;
    gap: 10px;
}

.phgear-portal-topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: #f8fafc;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phgear-portal-topbar-spacer {
    width: 44px;
}

/* ── Hamburger button ────────────────────────────────────────────────────── */
.phgear-portal-hamburger {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 4px;
    flex-shrink: 0;
}

.phgear-portal-hamburger span {
    display: block;
    height: 2px;
    background: #f8fafc;
    border-radius: 2px;
    transition: all 0.2s;
}

/* Animated X when open */
.phgear-portal-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.phgear-portal-hamburger.is-open span:nth-child(2) { opacity: 0; }
.phgear-portal-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile cart toggle ──────────────────────────────────────────────────── */
.phgear-portal-cart-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: #f8fafc;
    padding: 4px 6px;
    border-radius: 6px;
    flex-shrink: 0;
    position: relative;
    transition: background 0.15s;
}

.phgear-portal-cart-toggle:hover { background: rgba(255,255,255,0.1); }
.phgear-portal-cart-icon { font-size: 22px; line-height: 1; }

.phgear-portal-cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-sizing: border-box;
}

.phgear-portal-cart-amount {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

/* ── Page content wrapper ────────────────────────────────────────────────── */
.phgear-portal-page {
    flex: 1;
    padding: 24px;
    box-sizing: border-box;
    max-width: 100%;
    /*overflow-x: hidden;*/
}

/* Remove inner headers that duplicate the sidebar identity on portal pages */
body.phgear-portal-body .phgear-db-header,
body.phgear-portal-body .phgear-emp-header {
    display: none;
}

/* ── Sidebar overlay (mobile) ────────────────────────────────────────────── */
.phgear-portal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.phgear-portal-overlay.is-visible { display: block; }

/* ── Mobile cart drawer ──────────────────────────────────────────────────── */
.phgear-portal-cart-drawer {
    position: fixed;
    top: 0;
    right: -340px;
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    z-index: 1100;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    transition: right 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.phgear-portal-cart-drawer.is-open {
    right: 0;
}

.phgear-portal-cart-drawer-header {
    background: #027491;
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.phgear-portal-cart-drawer-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.phgear-portal-cart-drawer-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.15s;
    line-height: 1;
    position: absolute;
    right: 15px;
    top: 17px;
}

.phgear-portal-cart-drawer-close:hover { opacity: 1; }

.phgear-portal-cart-drawer-body {
    flex: 1;
    overflow-y: auto;
}

.phgear-portal-cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1099;
}

.phgear-portal-cart-overlay.is-visible { display: block; }

/* ── Responsive: tablet / mobile ────────────────────────────────────────── */
@media (max-width: 768px) {

    /* Hide desktop sidebar, show topbar instead */
    .phgear-portal-sidebar {
        transform: translateX(-100%);
        width: 220px;
        transition: transform 0.22s ease;
    }

    .phgear-portal-sidebar.is-open {
        transform: translateX(0);
        /* Show labels in mobile drawer */
    }

    .phgear-portal-sidebar.is-open .phgear-portal-nav-label,
    .phgear-portal-sidebar.is-open .phgear-portal-user-name,
    .phgear-portal-sidebar.is-open .phgear-portal-brand-name {
        opacity: 1;
        max-width: 160px;
    }

    .phgear-portal-content {
        margin-left: 0;
    }

    .phgear-portal-topbar {
        display: flex;
    }

    .phgear-portal-content {
        /*overflow-x: hidden;*/
        max-width: 100vw;
    }

    .phgear-portal-page {
        padding: 16px 12px;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .phgear-portal-body .phgear-portal-page:has(#phgear-quick-order) {
        padding: 12px 8px;
    }

    /* On mobile the Quick Order layout stacks; hide the sticky sidebar cart */
    .phgear-qo-sidebar {
        display: none;
    }
}

/* On desktop keep the sidebar always visible, never transformed */
@media (min-width: 769px) {
    .phgear-portal-sidebar {
        transform: none !important;
    }
    .phgear-portal-cart-drawer,
    .phgear-portal-cart-overlay {
        display: none !important;
    }
}

/* ==========================================================================
   PhGear Login Page
   ========================================================================== */

.phgear-login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 48px);
    padding: 32px 16px;
    box-sizing: border-box;
}

.phgear-login-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.10);
    padding: 40px 36px 36px;
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
}

/* ── Brand ───────────────────────────────────────────────────────────────── */
.phgear-login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.phgear-login-brand-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
    line-height: 1;
}

.phgear-login-brand-name {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.phgear-login-brand-sub {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* ── Notice ──────────────────────────────────────────────────────────────── */
.phgear-login-notice {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
    line-height: 1.5;
}

.phgear-login-notice--error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.phgear-login-notice--success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* ── Fields ──────────────────────────────────────────────────────────────── */
.phgear-login-field {
    margin-bottom: 16px;
}

.phgear-login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.phgear-login-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1f2937;
    background: #f9fafb;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.phgear-login-input:focus {
    border-color: #027491;
    box-shadow: 0 0 0 3px rgba(2,116,145,0.12);
    background: #fff;
}

/* ── Password toggle ─────────────────────────────────────────────────────── */
.phgear-login-pw-wrap {
    position: relative;
}

.phgear-login-pw-wrap .phgear-login-input {
    padding-right: 44px;
}

.phgear-login-pw-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 16px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.phgear-login-pw-toggle:hover { opacity: 1; }

/* ── Options row ─────────────────────────────────────────────────────────── */
.phgear-login-row-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 8px;
}

.phgear-login-remember {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
}

.phgear-login-remember input[type="checkbox"] {
    accent-color: #027491;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.phgear-login-forgot-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #027491;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}

.phgear-login-forgot-link:hover { color: #015f78; }

/* ── Submit button ───────────────────────────────────────────────────────── */
.phgear-login-btn {
    width: 100%;
    padding: 12px;
    background: #027491;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, opacity 0.15s;
}

.phgear-login-btn:hover { background: #015f78; }
.phgear-login-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.phgear-login-btn-spinner,
.phgear-reset-btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: phgear-login-spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes phgear-login-spin { to { transform: rotate(360deg); } }

/* ── Password reset modal ────────────────────────────────────────────────── */
.phgear-login-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.phgear-login-modal {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px 32px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 8px 48px rgba(0,0,0,0.18);
    text-align: center;
    box-sizing: border-box;
}

.phgear-login-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.15s;
}

.phgear-login-modal-close:hover { color: #374151; }

.phgear-login-modal-icon {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 12px;
}

.phgear-login-modal h2 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.phgear-login-modal-sub {
    margin: 0 0 20px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.phgear-reset-notice {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
    text-align: left;
}

.phgear-reset-notice--error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.phgear-reset-notice--success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.phgear-reset-form .phgear-login-field {
    text-align: left;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .phgear-login-box {
        padding: 28px 20px 24px;
    }
    .phgear-login-modal {
        padding: 28px 20px 24px;
    }
}

/* ==========================================================================
   Employee Panel – Items to Ship
   ========================================================================== */
.phgear-emp-edit-items-wrap{
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.phgear-emp-items-wrap {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 20px;
    width: 50%;
}

.phgear-emp-items-title {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}

.phgear-emp-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.phgear-emp-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
}

.phgear-emp-item-img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #f3f4f6;
}

.phgear-emp-item-img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #d1d5db;
}

.phgear-emp-item-img--placeholder::after {
    content: '📦';
}

.phgear-emp-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.phgear-emp-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phgear-emp-item-sku {
    font-size: 11px;
    color: #9ca3af;
}

.phgear-emp-item-qty {
    flex-shrink: 0;
    background: #027491;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
}

.phgear-emp-item-subtotal {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-align: right;
    min-width: 64px;
}

.phgear-emp-items-empty {
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
    padding: 12px 0;
}

/* Ship-to address in summary grid */
.phgear-emp-summary-address {
    grid-column: 1 / -1;
}

.phgear-emp-summary-address address {
    font-style: normal;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    white-space: pre-line;
}

@media (max-width: 768px) {
    .phgear-emp-edit-items-wrap{
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .phgear-emp-items-wrap{
        width: 100%;
        order: 1;
    }
    
    .phgear-emp-edit-form{
        width: 100%;
        order: 2;
    }
}

/* ==========================================================================
   Module – News
   ========================================================================== */

/* Nav dot — new news indicator */
.phgear-news-has-dot {
    position: relative;
}
.phgear-news-has-dot::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--phgear-sidebar-bg, #1e293b);
    pointer-events: none;
}

/* Unread row — bold */
.phgear-news-row--unread td {
    font-weight: 700;
    color: #111827;
}

.phgear-news-row--unread .phgear-news-col-excerpt {
    color: #374151;
}

/* Column widths */
.phgear-news-col-sl     { width: 48px; text-align: center; }
.phgear-news-col-date   { width: 110px; white-space: nowrap; }
.phgear-news-col-excerpt{ color: #6b7280; font-size: 13px; }
.phgear-news-col-action { width: 90px; text-align: center; }
.phgear-news-col-title  { min-width: 160px; }

/* ==========================================================================
   News detail modal
   ========================================================================== */

.phgear-news-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.phgear-news-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 700px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 32px 36px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.phgear-news-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}
.phgear-news-modal-close:hover {
    color: #111827;
    background: #f3f4f6;
}

.phgear-news-modal-loading {
    display: flex;
    justify-content: center;
    padding: 48px 0;
}

.phgear-news-modal-img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

.phgear-news-modal-date {
    font-size: 12px;
    color: #9ca3af;
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.phgear-news-modal-title {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 20px;
    line-height: 1.3;
}

.phgear-news-modal-content {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
}

.phgear-news-modal-content p  { margin: 0 0 14px; }
.phgear-news-modal-content img { max-width: 100%; border-radius: 8px; }
.phgear-news-modal-content h1,
.phgear-news-modal-content h2,
.phgear-news-modal-content h3 { color: #111827; margin: 20px 0 10px; }

@media (max-width: 600px) {
    .phgear-news-modal {
        padding: 20px 18px;
    }
    .phgear-news-modal-title {
        font-size: 18px;
    }
    .phgear-news-col-excerpt {
        display: none;
    }
    .phgear-news-col-date {
        display: none;
    }
}


