/* ==========================================================================
   EdgeCraft Client Portal Styles (Google Material Style)
   ========================================================================== */

:root {
    --ec-bg: var(--theme-palette-color-6);
    --ec-surface: var(--theme-palette-color-8);
    --ec-surface-hover: var(--theme-palette-color-7);
    --ec-text-main: var(--theme-palette-color-3);
    --ec-text-muted: var(--theme-palette-color-4);
    --ec-border: var(--theme-palette-color-5);
    --ec-primary: var(--theme-palette-color-1);
    --ec-primary-hover: #5a4133; /* Slightly darker brown */
    --ec-accent: var(--theme-palette-color-2);
    
    /* Status Colors (Material Soft Palette) */
    --ec-status-green-bg: #e6f4ea;
    --ec-status-green-txt: #137333;
    --ec-status-yellow-bg: #fef7e0;
    --ec-status-yellow-txt: #b06000;
    --ec-status-gray-bg: #f1f3f4;
    --ec-status-gray-txt: #5f6368;

    /* Metrics */
    --ec-radius-sm: 6px;
    --ec-radius-md: 12px;
    --ec-radius-lg: 16px;
    --ec-sidebar-width: 260px;
    --ec-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --ec-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ec-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* ── Typography & Resets ─────────────────────────────────────────────────── */
.ec-portal-layout {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    color: var(--ec-text-main);
    background-color: var(--ec-bg);
    min-height: 100vh;
    display: flex;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.ec-portal-layout *,
.ec-portal-layout *::before,
.ec-portal-layout *::after {
    box-sizing: inherit;
}

/* ── Base Layout Structure ───────────────────────────────────────────────── */
.ec-portal-sidebar {
    width: var(--ec-sidebar-width);
    background-color: var(--ec-surface);
    border-right: 1px solid var(--ec-border);
    flex-shrink: 0;
    z-index: 40;
    transition: transform var(--ec-transition);
    display: flex;
    flex-direction: column;
    padding: 40px 0;
}

/* Close button (Only visible on mobile) */
.ec-portal-sidebar__close {
    display: none; 
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--ec-text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color var(--ec-transition);
}

.ec-portal-sidebar__close:hover {
    background-color: var(--ec-surface-hover);
}

/* Brand / Logo Area */
.ec-portal-sidebar__brand {
    display: flex;
    padding: 24px;
    text-decoration: none;
    align-items: center;
}

.ec-portal-sidebar__logo {
    max-width: 140px;
    height: auto;
    display: block;
}

/* User Card Wrapper */
.ec-portal-sidebar__user {
    display: flex;
    align-items: center;
    padding: 0 24px 24px;
    gap: 12px;
    border-bottom: 1px solid var(--ec-border);
    margin-bottom: 16px;
}

/* Avatar / Initials */
.ec-portal-sidebar__avatar,
.ec-portal-sidebar__avatar img,
.ec-portal-sidebar__initial {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ec-portal-sidebar__avatar img {
    object-fit: cover;
}

.ec-portal-sidebar__initial {
    background-color: var(--theme-palette-color-7); /* Light gray */
    color: var(--ec-primary);
    font-weight: 600;
    font-size: 1.125rem;
    border: 1px solid var(--ec-border);
}

/* User Info Text */
.ec-portal-sidebar__user-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ec-portal-sidebar__username {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ec-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ec-portal-sidebar__useremail {
    font-size: 0.75rem;
    color: var(--ec-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Navigation Container */
.ec-portal-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
    flex: 1; /* Takes up remaining space, pushing footer down */
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Navigation Items (Google Material Pill Style) */
.ec-portal-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--ec-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 100px; /* Full rounded pill */
    transition: all var(--ec-transition);
}

.ec-portal-nav-item:hover {
    background-color: var(--ec-surface-hover);
    color: var(--ec-text-main);
}

/* Active State */
.ec-portal-nav-item--active {
    background-color: var(--ec-status-yellow-bg); /* Soft accent background */
    color: var(--ec-primary); /* Primary brown */
    font-weight: 600;
}

.ec-portal-nav-item--active .ec-portal-nav-item__icon {
    color: var(--ec-primary);
}

/* Icons */
.ec-portal-nav-item__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    opacity: 0.8;
}

.ec-portal-nav-item--active .ec-portal-nav-item__icon {
    opacity: 1;
}

.ec-portal-nav-item__icon--bell {
    position: relative;
    overflow: visible;
}

.ec-portal-nav-item__count {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--ec-surface);
    pointer-events: none;
}

/* Footer Nav (Logout Area) */
.ec-portal-sidebar__footer-nav {
    padding: 16px 12px;
    border-top: 1px solid var(--ec-border);
    margin-top: auto;
}

/* Special hover for logout to indicate a destructive/exit action */
.ec-portal-nav-item--logout:hover {
    background-color: #fee2e2; /* light red */
    color: #dc2626; /* dark red */
}

/* Mobile Sidebar Backdrop Overlay */
.ec-portal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 35;
    opacity: 0;
    visibility: hidden;
    transition: all var(--ec-transition);
}

.ec-portal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Display Close button only on mobile */
@media (max-width: 768px) {
    .ec-portal-sidebar__close {
        display: block;
    }
}

.ec-portal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents flex blowout */
}

/* Top Bar */
.ec-portal-topbar {
    height: 64px;
    background-color: var(--ec-surface);
    border-bottom: 1px solid var(--ec-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.ec-portal-topbar__hamburger {
    background: none;
    border: none;
    color: var(--ec-text-main);
    cursor: pointer;
    padding: 8px;
    margin-right: 16px;
    border-radius: 50%;
    display: none; /* Hidden on desktop */
    transition: background-color var(--ec-transition);
}

.ec-portal-topbar__hamburger:hover {
    background-color: var(--ec-surface-hover);
}

.ec-portal-topbar__title {
    font-size: 1.125rem;
    font-weight: 500;
}

.ec-portal-main {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

/* ── Typography & Headers ────────────────────────────────────────────────── */
.ec-portal-welcome,
.ec-portal-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.ec-portal-welcome__heading,
.ec-portal-page-head__title {
    margin: 0 0 8px 0;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.ec-portal-welcome__sub,
.ec-portal-page-head__sub {
    margin: 0;
    color: var(--ec-text-muted);
    font-size: 1rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.ec-portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 100px;
    min-width: 150px;
    height: 42px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--ec-transition);
}

.ec-portal-btn__spinner {
    position: absolute; /* Keeps it centered without pushing borders */
}

.ec-portal-btn--primary {
    background-color: var(--ec-primary);
    color: var(--theme-palette-color-8);
}

.ec-portal-btn--primary:hover {
    background-color: var(--ec-primary-hover);
    box-shadow: var(--ec-shadow-md);
}

.ec-portal-btn--secondary {
    background-color: transparent;
    color: var(--ec-primary);
    border: 1px solid var(--ec-border);
}

.ec-portal-btn--secondary:hover {
    background-color: var(--ec-surface-hover);
    border-color: var(--ec-primary);
    color: var(--theme-palette-color-2);
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.ec-portal-card {
    background: var(--ec-surface);
    border-radius: var(--ec-radius-md);
    box-shadow: var(--ec-shadow-sm);
    border: 1px solid var(--ec-border);
    padding: 24px;
    margin-bottom: 24px;
}

.ec-portal-card.card-order {
        max-width: 700px;
    margin: 0 auto;
}

.ec-portal-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ec-portal-account-card .ec-portal-card__header {
    justify-content: flex-start;
    gap: 10px;
}

.ec-portal-card__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.ec-portal-card__action {
    color: var(--ec-accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: auto;
}

.ec-portal-card__action:hover {
    text-decoration: underline;
}

/* Grid Layouts for Cards */
.ec-portal-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

.ec-portal-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ── Stats Section ───────────────────────────────────────────────────────── */
.ec-portal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.ec-portal-stat-card {
    background: var(--ec-surface);
    padding: 24px;
    border-radius: var(--ec-radius-md);
    border: 1px solid var(--ec-border);
    display: flex;
    flex-direction: column;
    box-shadow: var(--ec-shadow-sm);
    position: relative;
    overflow: hidden;
}

/* Google-style left color bar indicator */
.ec-portal-stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--ec-text-muted);
}
.ec-portal-stat-card--yellow::before { background-color: var(--ec-accent); }
.ec-portal-stat-card--green::before { background-color: var(--ec-status-green-txt); }
.ec-portal-stat-card--muted::before { background-color: var(--ec-border); }

.ec-portal-stat-card__value {
    font-size: 2.25rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 4px;
    color: var(--ec-text-main);
}

.ec-portal-stat-card__label {
    font-size: 0.875rem;
    color: var(--ec-text-muted);
    font-weight: 500;
}

/* ── Account Summary & Lists ─────────────────────────────────────────────── */
/* Feedback Message Styling */
.ec-portal-feedback {
    padding: 12px 16px;
    border-radius: var(--ec-radius-sm);
    margin-bottom: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.ec-portal-feedback--success {
    background-color: var(--ec-status-green-bg);
    color: var(--ec-status-green-txt);
    border: 1px solid rgba(19, 115, 51, 0.1);
}

.ec-portal-feedback--error {
    background-color: #fce8e6; /* Light Material Red */
    color: #d93025; /* Dark Material Red */
    border: 1px solid rgba(217, 48, 37, 0.1);
}

/* Avatar Upload Preview */
.ec-portal-form__avatar-wrap {
    position: relative;
    cursor: pointer;
}

.ec-portal-form__avatar-wrap:hover::after {
    content: 'Edit';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ec-portal-account-card__avatar-wrap {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.ec-portal-account-card__avatar,
.ec-portal-account-card__avatar-initial {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.ec-portal-account-card__avatar-initial {
    background-color: var(--ec-surface-hover);
    color: var(--ec-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    text-transform: uppercase;
    font-weight: 600;
    width: 100px;
    height: 100px;
    line-height: 100px;
    border: 1px solid var(--ec-border);
}

.ec-portal-account-card__identity {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.ec-portal-account-card__identity .ec-portal-account-card__avatar-wrap {
    margin-bottom: 0;
    justify-content: flex-start;
    flex: 0 0 auto;
}

.ec-portal-account-card__status-wrap {
    display: flex;
    align-items: center;
}
.ec-account-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1;
    
    margin-left: auto;
}

.ec-account-status-badge svg {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
}

.ec-account-status-badge--verified {
    background: #bbf7d0;
    color: #166534;
    border-color: #4ade80;
}

.ec-account-status-badge--hold {
    background: #fde68a;
    color: #92400e;
    border-color: #f59e0b;
}

.ec-account-status-badge--unverified {
    background: #fecaca;
    color: #991b1b;
    border-color: #ef4444;
}

.ec-portal-account-card__info {
    margin: 0;
}

.ec-portal-account-card__row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--ec-border);
    font-size: 0.875rem;
}

.ec-portal-account-card__row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ec-portal-account-card__row dt {
    color: var(--ec-text-muted);
    font-weight: 500;
}

.ec-portal-account-card__row dd {
    margin: 0;
    font-weight: 500;
    color: var(--ec-text-main);
    text-align: right;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.ec-portal-table-wrap {
    overflow-x: auto;
}

.ec-portal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ec-portal-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--ec-text-muted);
    font-weight: 500;
    border-bottom: 2px solid var(--ec-border);
}

.ec-portal-table td {
    padding: 16px;
    border-bottom: 1px solid var(--ec-border);
    vertical-align: middle;
}

.ec-portal-table tbody tr:hover {
    background-color: var(--ec-surface-hover);
}

table.ec-portal-table th,
table.ec-portal-table td {
    text-align: center;
}

.ot-col-sr {
    width: 50px;
}

.ec-portal-table__tracking {
    font-weight: 600;
}

.ec-portal-link {
    color: var(--ec-accent);
    text-decoration: none;
    font-weight: 500;
}

.ec-portal-link:hover {
    text-decoration: underline;
}

/* Status Badges */
.ec-portal-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ec-portal-status--received {
    background-color: var(--ec-status-gray-bg);
    color: var(--ec-status-gray-txt);
}

.ec-portal-status--in-progress {
    background-color: var(--ec-status-yellow-bg);
    color: var(--ec-status-yellow-txt);
}

.ec-portal-status--ready {
    background-color: var(--ec-status-green-bg);
    color: var(--ec-status-green-txt);
}

.ec-portal-status--delivered {
    background-color: var(--ec-text-main);
    color: var(--theme-palette-color-8);
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.ec-portal-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--ec-border);
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.ec-portal-tabs::-webkit-scrollbar {
    display: none;
}

.ec-portal-tab {
    background: none;
    border: none;
    padding: 12px 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ec-text-muted);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}

.ec-portal-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: transparent;
    border-radius: 3px 3px 0 0;
    transition: background-color var(--ec-transition);
}

.ec-portal-tab:hover {
    color: var(--ec-text-main);
}

.ec-portal-tab:hover::after {
    background-color: color-mix(in srgb, var(--ec-primary) 35%, transparent);
}

.ec-portal-tab--active {
    color: var(--ec-primary);
}

.ec-portal-tab--active::after {
    background-color: var(--ec-primary);
}

/* ── Forms & Settings ────────────────────────────────────────────────────── */
.ec-portal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ec-portal-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ec-portal-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ec-portal-field__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ec-text-main);
}

.ec-portal-field__input,
.ec-portal-field__textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius-sm);
    background-color: var(--ec-surface);
    color: var(--ec-text-main);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all var(--ec-transition);
}

.ec-portal-field__textarea {
    resize: none;
    max-height: 50px;
}

.ec-portal-field__input:focus,
.ec-portal-field__textarea:focus {
    outline: none;
    border-color: var(--ec-primary);
    box-shadow: 0 0 0 3px rgba(107, 79, 63, 0.1); /* Primary color low opacity */
}

.ec-portal-field__input--readonly {
    background-color: var(--ec-bg);
    color: var(--ec-text-muted);
    cursor: not-allowed;
}

.ec-portal-field__hint {
    font-size: 0.75rem;
    color: var(--ec-text-muted);
}

/* Password Fields */
.ec-portal-field__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ec-portal-field__pw-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--ec-text-muted);
    cursor: pointer;
    padding: 4px;
}

.ec-portal-field__pw-toggle:hover {
    color: var(--ec-text-main);
}

.ec-portal-form__actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

/* Form Avatar Row */
.ec-portal-form__avatar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.ec-portal-form__avatar-wrap img,
.ec-portal-form__avatar-wrap .ec-portal-form__avatar-initial {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.ec-portal-form__avatar-wrap .ec-portal-form__avatar-initial {
    background-color: var(--ec-surface-hover);
    color: var(--ec-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    text-transform: uppercase;
    font-weight: 600;
    width: 100px;
    height: 100px;
    line-height: 100px;
    border: 1px solid var(--ec-border);
}

.ec-portal-form__avatar-meta {
    display: flex;
    flex-direction: column;
}

.ec-portal-form__avatar-meta strong {
    font-size: 1.125rem;
}

.ec-portal-form__avatar-meta .ec-account-status-badge {
    margin-top: 4px;
    margin-bottom: 2px;
}

.ec-portal-form__avatar-meta span {
    font-size: 0.875rem;
    color: var(--ec-text-muted);
}

.ec-portal-file-input {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.ec-portal-link {
    cursor: pointer;
}


/* ──  Notifications  ── */
.ec-portal-card--notifications {
    padding: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfaf6 100%);
}

.ec-portal-notifications {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ec-portal-notification {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    border: 1px solid rgba(192, 160, 93, 0.14);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 251, 244, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.ec-portal-notification::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #c0a05d 0%, #e5d2a2 100%);
}

.ec-portal-notification__time {
    display: block;
    padding-left: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.ec-portal-notification__body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.ec-portal-notification__message {
    margin: 0;
    flex: 1;
    padding-left: 8px;
    font-size: 0.98rem;
    line-height: 1.5;
    color: #0f172a;
}

.ec-portal-notification__actions {
    flex-shrink: 0;
}

.ec-portal-notification__btn {
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(192, 160, 93, 0.22);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    white-space: nowrap;
}

.ec-portal-notification__btn:hover {
    background-color: var(--ec-surface-hover);
    border-color: var(--ec-primary);
}

@media (max-width: 768px) {
    .ec-portal-card--notifications {
        padding: 16px;
    }

    .ec-portal-notification {
        padding: 14px 16px;
        border-radius: 16px;
    }

    .ec-portal-notification__body {
        flex-direction: column;
        align-items: flex-start;
    }

    .ec-portal-notification__actions,
    .ec-portal-notification__btn {
        width: 100%;
    }
}

/* ── Utility & Empty States ──────────────────────────────────────────────── */
/* History */
.ec-portal-history-hero {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: stretch;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(194, 162, 93, 0.14), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #fcfaf6 100%);
}

.ec-portal-history-hero::after {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(194, 162, 93, 0.06);
    pointer-events: none;
}

.ec-portal-history-hero__content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.ec-portal-history-hero__eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(194, 162, 93, 0.12);
    color: #8a6a22;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ec-portal-history-hero__title {
    margin: 0 0 10px;
    font-size: 1.75rem;
    line-height: 1.15;
    color: #0f172a;
}

.ec-portal-history-hero__text {
    margin: 0;
    max-width: 58ch;
    color: #64748b;
    line-height: 1.6;
}

.ec-portal-history-hero__totals {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 14px;
    min-width: 310px;
}

.ec-portal-history-hero__total {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(203, 213, 225, 0.9);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.ec-portal-history-hero__total-label {
    margin-bottom: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
}

.ec-portal-history-hero__total strong {
    font-size: 1.9rem;
    line-height: 1;
    color: #0f172a;
}

.ec-portal-history-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.ec-portal-history-summary__item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px 20px;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #faf8f3 100%);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.ec-portal-history-summary__item::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: #94a3b8;
}

.ec-portal-history-summary__item--orders::before { background: #8a6a22; }
.ec-portal-history-summary__item--parts::before { background: #2563eb; }
.ec-portal-history-summary__item--sheet-8::before { background: #0f766e; }
.ec-portal-history-summary__item--sheet-9::before { background: #7c3aed; }
.ec-portal-history-summary__item--sheet-custom::before { background: #db2777; }
.ec-portal-history-summary__item--edging::before { background: #d97706; }
.ec-portal-history-summary__item--double-edging::before { background: #dc2626; }

.ec-portal-history-summary__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.ec-portal-history-summary__label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.ec-portal-history-summary__value {
    font-size: 1.7rem;
    line-height: 1.1;
    color: #0f172a;
}

.ec-portal-history-list__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 700;
}

.ec-portal-history-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ec-portal-history-order {
    position: relative;
    padding: 24px;
    border-radius: 22px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: linear-gradient(180deg, #ffffff 0%, #fcfbf8 100%);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.ec-portal-history-order::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20px;
    bottom: 20px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, #c2a25d 0%, #8a6a22 100%);
}

.ec-portal-history-order__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.ec-portal-history-order__identity {
    min-width: 0;
}

.ec-portal-history-order__tracking {
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    word-break: break-word;
}

.ec-portal-history-order__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ec-portal-history-order__meta > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
}

.ec-portal-history-order__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.ec-portal-history-order__actions .ec-portal-btn {
    min-width: 132px;
}

.ec-portal-history-order__status {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ec-portal-history-order__status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.ec-portal-history-order__meta > .ec-portal-history-order__status.ec-portal-history-order__status--not-approved {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.ec-portal-history-order__meta > .ec-portal-history-order__status.ec-portal-history-order__status--pending {
    background: #fff7ed;
    border-color: #fdba74;
    color: #c2410c;
}

.ec-portal-history-order__meta > .ec-portal-history-order__status.ec-portal-history-order__status--processing {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.ec-portal-history-order__meta > .ec-portal-history-order__status.ec-portal-history-order__status--completed {
    background: #ecfdf5;
    border-color: #86efac;
    color: #15803d;
}

.ec-portal-history-order__meta > .ec-portal-history-order__status.ec-portal-history-order__status--cancelled {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}


.ec-portal-history-order__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.ec-portal-history-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 82px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e2e8f0;
}

.ec-portal-history-stat__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--ec-primary);
    flex-shrink: 0;
}

.ec-portal-history-stat__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ec-portal-history-stat__label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.ec-portal-history-stat__value {
    font-size: 1rem;
    line-height: 1.2;
    color: #0f172a;
}

.ec-portal-history-order__materials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.ec-portal-history-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 600;
}

.ec-portal-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--ec-text-muted);
}

.ec-portal-empty svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.ec-portal-empty a {
    color: var(--ec-accent);
    text-decoration: none;
    font-weight: 500;
}

.ec-portal-hidden {
    display: none !important;
}

/* Password Strength Meter */
.ec-portal-pw-strength {
    margin-top: 8px;
}
.ec-portal-pw-strength__bar {
    height: 4px;
    background-color: var(--ec-bg);
    border-radius: 2px;
    overflow: hidden;
}
#ec-pw-strength-fill {
    display: block;
    height: 100%;
    width: 0%;
    transition: width 0.3s, background-color 0.3s;
}
#ec-pw-strength-label {
    display: block;
    font-size: 0.75rem;
    margin-top: 4px;
    text-align: right;
    color: var(--ec-text-muted);
}

.ec-portal-history-order__footer {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
}

.ec-portal-history-pagination {
    margin-top: 24px;
}

.ec-portal-history-pagination > .page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ec-portal-history-pagination .page-numbers a,
.ec-portal-history-pagination .page-numbers span {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ec-border);
    border-radius: 999px;
    background: var(--ec-surface);
    color: var(--ec-text-main);
    text-decoration: none;
    font-weight: 600;
}

.ec-portal-history-pagination .page-numbers a:hover {
    background: var(--ec-surface-hover);
    border-color: var(--ec-primary);
    color: var(--ec-primary);
}

.ec-portal-history-pagination .page-numbers .current {
    background: var(--ec-primary);
    border-color: var(--ec-primary);
    color: #fff;
}


/* ── Pagination ──────────────────────────────────────────────────────────── */
.ec-portal-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--ec-border);
}

.ec-portal-page-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--ec-border);
    padding: 6px 12px;
    border-radius: var(--ec-radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--ec-text-main);
}

.ec-portal-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ec-portal-page-btn:hover:not(:disabled) {
    background-color: var(--ec-surface-hover);
    border-color: var(--ec-primary);
    color: var(--ec-primary);
}

/* ── Responsive Media Queries ────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .ec-portal-row {
        grid-template-columns: 1fr;
    }
    
    .ec-portal-settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ec-portal-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
    }

    /* Class toggled by JS to show sidebar */
    .ec-portal-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.1);
    }

    .ec-portal-topbar__hamburger {
        display: block;
    }

    .ec-portal-main {
        padding: 16px;
    }

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

    .ec-portal-form__row {
        grid-template-columns: 1fr;
    }
    
    .ec-portal-welcome {
        flex-direction: column;
    }
    
    .ec-portal-welcome .ec-portal-btn {
        width: 100%;
    }

    .ec-portal-history-hero {
        flex-direction: column;
    }

    .ec-portal-history-hero__totals {
        min-width: 0;
        grid-template-columns: 1fr 1fr;
    }

    .ec-portal-history-order {
        padding: 20px;
    }

    .ec-portal-history-order__header {
        flex-direction: column;
        align-items: stretch;
    }

    .ec-portal-history-order__actions {
        width: 100%;
    }

    .ec-portal-history-order__actions .ec-portal-btn {
        width: 100%;
    }

    .ec-portal-history-order__stats {
        grid-template-columns: 1fr;
    }
}
