/* ProReturns OS - Portal Stylesheet */

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.12);
    --primary-glow-strong: rgba(99, 102, 241, 0.3);
    
    --emerald: #10b981;
    --emerald-glow: rgba(16, 185, 129, 0.1);
    --rose: #f43f5e;
    --rose-glow: rgba(244, 63, 94, 0.1);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.08);
    
    --glass-bg: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-blur: 16px;
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

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

body.portal-body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Glow Elements */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.2;
}

.orb-1 {
    top: -200px;
    right: -100px;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.orb-2 {
    bottom: -200px;
    left: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--emerald) 0%, transparent 70%);
}

/* Common text & buttons */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-muted {
    color: var(--text-muted);
}

.text-emerald {
    color: var(--emerald) !important;
}

.text-rose {
    color: var(--rose) !important;
}

.font-bold {
    font-weight: 700;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-smooth);
    font-size: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-emerald {
    background: linear-gradient(135deg, var(--emerald) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-emerald:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-block {
    width: 100%;
}

.max-width-600 {
    max-width: 600px;
}

/* ========================================== */
/* LOGIN SCREEN STYLES */
/* ========================================== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    background-color: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    padding: 48px 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.login-header h2 {
    font-size: 28px;
    margin-top: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background-color: rgba(255, 255, 255, 0.05);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.login-error-msg {
    color: var(--rose);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    display: none;
    text-align: center;
}

.login-credentials-hint {
    margin-top: 32px;
    border-top: 1px dashed var(--border-color);
    padding-top: 24px;
}

.login-credentials-hint h4 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.hint-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hint-btn {
    text-align: left;
    justify-content: flex-start;
    padding: 10px 14px;
    font-size: 13px;
}

/* ========================================== */
/* APP LAYOUT STRUCTURE */
/* ========================================== */
.portal-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar styling */
.portal-sidebar {
    background-color: #0b0f19;
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-header {
    margin-bottom: 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 14px;
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.role-badge {
    background-color: var(--primary-glow);
    color: #a5b4fc;
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 4px;
    width: fit-content;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.menu-item:hover, .menu-item.active {
    background-color: rgba(255,255,255,0.03);
    color: white;
}

.menu-item.active {
    background-color: var(--primary-glow);
    color: white;
    border-left: 3px solid var(--primary);
    border-radius: 0 10px 10px 0;
}

.menu-item .badge {
    margin-left: auto;
    background-color: var(--rose);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-glow);
    border: 1px solid var(--primary);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.profile-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.profile-subtext {
    font-size: 10px;
}

.btn-logout {
    font-size: 13px;
    padding: 10px;
}

/* Main Section Content */
.portal-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar Styling */
.portal-topbar {
    background-color: rgba(11, 15, 25, 0.4);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    height: 70px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-search .form-control {
    width: 320px;
    padding: 8px 16px;
    font-size: 13px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-bell {
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.notification-bell:hover {
    color: white;
}

.system-time {
    font-size: 13px;
    font-family: monospace;
}

/* Tab contents and transitions */
.tab-viewport {
    padding: 32px;
    flex-grow: 1;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-pane.active {
    display: block;
}

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

.tab-header {
    margin-bottom: 32px;
}

.tab-header h2 {
    font-size: 28px;
    margin-bottom: 6px;
}

/* Statistics cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
    align-items: stretch;
}

.stat-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: var(--transition-smooth);
    min-height: 100px;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.12);
}

.stat-card.savings {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(11, 15, 25, 0.4) 100%);
    border-color: rgba(16, 185, 129, 0.2);
}

.stat-icon {
    font-size: 28px;
    width: 56px;
    height: 56px;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card.savings .stat-icon {
    background-color: var(--emerald-glow);
}

.stat-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    margin: 4px 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.stat-trend {
    font-size: 11px;
    font-weight: 600;
}

.stat-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* Grids */
.portal-grid-2 {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 32px;
}

.portal-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card-title {
    font-size: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

/* Timeline Activity */
.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    padding-left: 20px;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 4px;
    width: 2px;
    height: calc(100% - 15px);
    background-color: var(--border-color);
}

.activity-item {
    position: relative;
    display: flex;
    flex-direction: column;
    font-size: 13px;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary);
}

.activity-item.emerald::before { background-color: var(--emerald); }
.activity-item.rose::before { background-color: var(--rose); }

.activity-time {
    font-size: 10px;
    color: var(--text-muted);
    font-family: monospace;
    margin-top: 2px;
}

/* Address Widget box */
.address-box {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 10px;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.5;
}

/* Table styling */
.table-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow-x: auto;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.portal-table th, .portal-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.portal-table th {
    background-color: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
}

.portal-table tbody tr:last-child td {
    border-bottom: none;
}

.portal-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-received {
    background-color: var(--emerald-glow);
    color: var(--emerald);
}

.badge-damaged {
    background-color: var(--rose-glow);
    color: var(--rose);
}

.badge-pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-shipped {
    background-color: var(--primary-glow);
    color: #818cf8;
}

/* Interactive Details Table */
.details-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.details-table th, .details-table td {
    padding: 12px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.details-table th {
    color: var(--text-muted);
    font-weight: 500;
    text-align: left;
    width: 200px;
}

.details-table td {
    text-align: right;
}

.details-table tr:last-child th, .details-table tr:last-child td {
    border-bottom: none;
}

.status-box {
    border: 1px solid;
    padding: 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-top: 16px;
}

/* PPWR Reports section */
.reports-download-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 13px;
}

/* Admin lists queue */
.inspection-queue-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.queue-item {
    background-color: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.queue-item:hover {
    border-color: var(--primary);
    background-color: rgba(255,255,255,0.04);
}

.queue-item.active-item {
    border-color: var(--primary);
    background-color: var(--primary-glow);
}

.queue-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.queue-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.queue-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.admin-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Photo Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 200;
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    max-width: 800px;
    width: 90%;
    padding: 32px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.open .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
}

.modal-close:hover {
    color: white;
}

.modal-title {
    font-size: 22px;
    margin-bottom: 6px;
}

.modal-pkg-item-desc {
    font-size: 14px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 32px;
}

.modal-photos-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.modal-photo-item {
    aspect-ratio: 4/3;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

.modal-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-photo-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background-color: rgba(0,0,0,0.7);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.modal-report {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 16px;
}

.report-title {
    font-size: 16px;
    margin-bottom: 16px;
}

.report-list {
    list-style: none;
}

.report-list li {
    font-size: 13px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
}

.report-list li strong {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

/* ========================================== */
/* RESPONSIVE DESIGN Rules */
/* ========================================== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .portal-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .portal-wrapper {
        grid-template-columns: 1fr;
    }
    
    .portal-sidebar {
        height: auto;
        position: sticky;
        top: 0;
        z-index: 50;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
        background-color: var(--bg-primary);
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .sidebar-header {
        margin-bottom: 0px;
    }
    
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 6px;
        margin-bottom: 4px;
        white-space: nowrap;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
        flex-grow: 0;
        width: 100%;
    }

    .sidebar-menu::-webkit-scrollbar {
        height: 3px;
    }

    .sidebar-menu::-webkit-scrollbar-thumb {
        background-color: rgba(255, 255, 255, 0.1);
        border-radius: 2px;
    }
    
    .menu-item {
        padding: 8px 12px;
        font-size: 13px;
        flex-shrink: 0;
        border-radius: 8px;
    }
    
    .menu-item.active {
        border-left: none;
        border-bottom: 2px solid var(--primary);
        border-radius: 8px 8px 0 0;
    }
    
    .sidebar-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid var(--border-color);
        padding-top: 12px;
        margin-top: 4px;
    }
    
    .btn-logout {
        width: auto;
        margin: 0;
        padding: 8px 16px;
    }
    
    .user-profile {
        gap: 8px;
    }

    .profile-avatar {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }

    .profile-info {
        display: none;
    }

    .portal-topbar {
        display: none;
    }

    .tab-viewport {
        padding: 16px;
    }

    .tab-header h2 {
        font-size: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
    }

    .stat-card {
        padding: 12px 16px;
        gap: 12px;
        min-height: 90px;
    }

    .stat-icon {
        font-size: 20px;
        width: 40px;
        height: 40px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 10px;
    }
}



/* =====================================================
   MOBILE, TOUCH & USABILITY IMPROVEMENTS
   ===================================================== */
button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}

.mobile-logout-btn {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    font-size: 18px;
    cursor: pointer;
}

.notification-bell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background-color: transparent;
}

.portal-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 500;
    max-width: min(360px, calc(100vw - 32px));
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: rgba(17, 24, 39, 0.96);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    color: var(--text-main);
    font-size: 13px;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.portal-toast.show {
    opacity: 1;
    transform: translateY(0);
}

body.modal-open {
    overflow: hidden;
}

@media (hover: none) {
    .btn:hover,
    .queue-item:hover,
    .stat-card:hover {
        transform: none;
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 16px;
        min-height: 100dvh;
    }

    .login-card {
        padding: 30px 22px;
        border-radius: 18px;
    }

    .login-header {
        margin-bottom: 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .btn,
    .form-control {
        min-height: 44px;
    }

    .portal-sidebar {
        min-width: 0;
        padding: 10px 12px;
        gap: 8px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .mobile-logout-btn {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .sidebar-menu {
        padding-bottom: 3px;
        margin-bottom: 0;
    }

    .menu-item {
        min-height: 42px;
        padding: 9px 12px;
    }

    .sidebar-footer {
        display: none;
    }

    .portal-topbar {
        display: flex;
        position: static;
        height: auto;
        min-height: 58px;
        padding: 8px 12px;
        gap: 8px;
        background-color: rgba(11, 15, 25, 0.78);
    }

    .topbar-search {
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar-search .form-control {
        width: 100%;
        min-width: 0;
    }

    .topbar-actions {
        flex: 0 0 auto;
        gap: 4px;
    }

    .system-time {
        display: none;
    }

    .tab-viewport {
        padding: 18px 12px 32px;
    }

    .tab-header {
        margin-bottom: 20px;
    }

    .tab-header h2 {
        font-size: clamp(20px, 6vw, 25px);
        overflow-wrap: anywhere;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 18px;
    }

    .stat-card {
        min-width: 0;
        min-height: 104px;
        padding: 14px;
        align-items: flex-start;
    }

    .stat-details {
        min-width: 0;
    }

    .stat-label,
    .stat-sub,
    .stat-trend {
        overflow-wrap: anywhere;
    }

    .portal-grid-2 {
        gap: 16px;
    }

    .portal-card {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .card-title {
        font-size: 17px;
    }

    .table-container {
        max-width: 100%;
        border-radius: 12px;
        -webkit-overflow-scrolling: touch;
    }

    .portal-table {
        min-width: 720px;
    }

    .portal-table th,
    .portal-table td {
        padding: 13px 14px;
        white-space: normal;
    }

    .details-table th {
        width: 42%;
    }

    .download-item {
        align-items: flex-start;
        gap: 12px;
        flex-wrap: wrap;
    }

    .download-item .btn {
        width: 100%;
    }

    .queue-item {
        gap: 12px;
        align-items: flex-start;
    }

    .modal {
        padding: 12px;
    }

    .modal-content {
        width: 100%;
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 24px 18px;
        border-radius: 18px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .modal-title {
        padding-right: 44px;
        font-size: 20px;
    }

    .modal-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .modal-photos-gallery {
        gap: 10px;
    }

    .portal-toast {
        left: 16px;
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
        max-width: none;
    }
}

@media (max-width: 520px) {
    .brand-name {
        font-size: 14px;
    }

    .stats-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .stat-card {
        min-height: 88px;
        flex-direction: row;
        align-items: center;
    }

    .download-item,
    .queue-item {
        flex-direction: column;
    }

    .queue-item .btn {
        width: 100%;
    }

    .details-table,
    .details-table tbody,
    .details-table tr,
    .details-table th,
    .details-table td {
        display: block;
        width: 100%;
    }

    .details-table th {
        padding-bottom: 4px;
        border-bottom: 0;
    }

    .details-table td {
        padding-top: 0;
        text-align: left;
    }

    .modal-photos-gallery {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ========================================== */
/* V3 Demo Login Profiles */
/* ========================================== */
.login-container {
    padding: 36px 20px;
}

.login-card {
    max-width: 560px;
    padding: 40px;
    border-radius: 26px;
    background: linear-gradient(155deg, rgba(17, 24, 39, 0.9), rgba(11, 15, 25, 0.84));
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 54px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.password-toggle:hover,
.password-toggle.active {
    color: white;
    background: rgba(255, 255, 255, 0.06);
}

.form-control[aria-invalid="true"] {
    border-color: var(--rose);
    box-shadow: 0 0 0 3px var(--rose-glow);
}

.login-submit {
    min-height: 48px;
    margin-top: 4px;
}

.demo-profiles {
    display: grid;
    gap: 12px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.demo-profiles-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 2px;
}

.demo-profiles-heading > span {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
}

.demo-profiles-heading small {
    color: var(--text-muted);
    font-size: 11px;
}

.demo-profile-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 13px;
    align-items: start;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.025);
}

.demo-profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    color: white;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 800;
}

.client-avatar {
    background: linear-gradient(135deg, #6366f1, #3b82f6);
}

.admin-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
}

.demo-profile-content {
    min-width: 0;
}

.demo-profile-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.demo-profile-title strong {
    font-size: 14px;
}

.demo-role-badge {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--primary-glow);
    color: #a5b4fc;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.demo-role-badge.admin {
    background: var(--emerald-glow);
    color: #6ee7b7;
}

.demo-profile-content p {
    margin: 4px 0 10px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
}

.demo-credentials {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(100px, 0.55fr);
    gap: 8px;
}

.demo-credentials span {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.14);
}

.demo-credentials b {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.demo-credentials code {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text-main);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
}

@media (max-width: 560px) {
    .login-card {
        padding: 30px 18px;
        border-radius: 20px;
    }

    .demo-profiles-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .demo-profile-card {
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 13px;
    }

    .demo-profile-avatar {
        width: 40px;
        height: 40px;
        border-radius: 11px;
        font-size: 12px;
    }

    .demo-profile-title {
        align-items: flex-start;
    }

    .demo-credentials {
        grid-template-columns: minmax(0, 1fr);
    }
}
