/**
 * PWA Dashboard — mobile-first styles
 */
.cg-pwa-dash {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px 32px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.cg-pwa-dash__header {
    padding: 16px 0 12px;
}

.cg-pwa-dash__greeting {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
}

.cg-pwa-dash__avatar {
    border-radius: 50%;
}

/* ── Impact Stats ── */
.cg-pwa-dash__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #067F38 0%, #0a9d48 100%);
    border-radius: 16px;
    padding: 20px 16px;
}

.cg-pwa-stat {
    text-align: center;
    color: #fff;
}

.cg-pwa-stat__value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.cg-pwa-stat__unit {
    display: block;
    font-size: 11px;
    opacity: 0.85;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cg-pwa-stat__label {
    display: block;
    font-size: 12px;
    opacity: 0.7;
    margin-top: 2px;
}

/* ── Sections ── */
.cg-pwa-dash__section {
    margin-bottom: 24px;
}

.cg-pwa-dash__section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cg-pwa-dash__section-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
}

.cg-pwa-dash__see-all {
    font-size: 13px;
    color: #067F38;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ── Quick Actions ── */
.cg-pwa-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.cg-pwa-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    background: #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.15s;
}

.cg-pwa-action:hover {
    background: #f0faf4;
}

.cg-pwa-action__icon {
    font-size: 24px;
    line-height: 1;
}

.cg-pwa-action__label {
    font-size: 11px;
    color: #444;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

/* ── Recent Sessions ── */
.cg-pwa-sessions {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #eee;
    border-radius: 12px;
    overflow: hidden;
}

.cg-pwa-session {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    text-decoration: none;
    transition: background 0.15s;
}

.cg-pwa-session:hover {
    background: #f8f9fa;
}

.cg-pwa-session__type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    line-height: 1;
}

.cg-pwa-session__type--cart {
    background: #e8f5e9;
    color: #2e7d32;
}

.cg-pwa-session__type--order {
    background: #e3f2fd;
    color: #1565c0;
}

.cg-pwa-session__type--file {
    background: #fff3e0;
    color: #e65100;
}

.cg-pwa-session__info {
    flex: 1;
    min-width: 0;
}

.cg-pwa-session__title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cg-pwa-session__meta {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 1px;
}

.cg-pwa-session__carbon {
    font-size: 13px;
    font-weight: 700;
    color: #067F38;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Navigation ── */
.cg-pwa-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #eee;
    border-radius: 12px;
    overflow: hidden;
}

.cg-pwa-nav__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #fff;
    text-decoration: none;
    transition: background 0.15s;
}

.cg-pwa-nav__item:hover {
    background: #f8f9fa;
}

.cg-pwa-nav__label {
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 500;
}

.cg-pwa-nav__arrow {
    font-size: 20px;
    color: #ccc;
    font-weight: 300;
}

/* ── Empty state ── */
.cg-pwa-empty {
    text-align: center;
    padding: 24px 16px;
    background: #f8f9fa;
    border-radius: 12px;
}

.cg-pwa-empty p {
    margin: 0;
    font-size: 14px;
    color: #888;
}

/* ── Login screen ── */
.cg-pwa-dash__login {
    text-align: center;
    padding: 40px 0 20px;
}

.cg-pwa-dash__login-logo {
    border-radius: 20px;
    margin-bottom: 16px;
}

.cg-pwa-dash__login h1 {
    font-size: 26px;
    color: #067F38;
    margin: 0 0 6px;
}

.cg-pwa-dash__login > p {
    font-size: 14px;
    color: #666;
    margin: 0 0 24px;
}

.cg-pwa-dash__login-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: left;
}

.cg-pwa-dash__login-form {
    text-align: left;
}

.cg-pwa-dash__login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
}

.cg-pwa-dash__login-form input[type="text"],
.cg-pwa-dash__login-form input[type="password"] {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;  /* Prevents iOS zoom */
    margin-bottom: 14px;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.cg-pwa-dash__login-form input:focus {
    border-color: #067F38;
    outline: none;
    box-shadow: 0 0 0 2px rgba(6, 127, 56, 0.2);
}

.cg-pwa-dash__login-options {
    margin-bottom: 16px;
}

.cg-pwa-dash__login-options label {
    display: inline;
    font-size: 13px;
    font-weight: 400;
    color: #666;
}

/* Buttons */
.cg-pwa-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    line-height: 1.4;
}

.cg-pwa-btn--primary {
    background: #067F38;
    color: #fff;
}

.cg-pwa-btn--primary:hover {
    background: #056830;
}

.cg-pwa-btn--full {
    display: block;
    width: 100%;
}

.cg-pwa-dash__login-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
}

.cg-pwa-dash__login-links a {
    font-size: 13px;
    color: #067F38;
    text-decoration: none;
}

/* ── Login / Demo divider ── */
.cg-pwa-dash__login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #9CA3AF;
    font-size: 13px;
}

.cg-pwa-dash__login-divider::before,
.cg-pwa-dash__login-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #E5E7EB;
}

.cg-pwa-dash__login-divider span {
    padding: 0 12px;
}

.cg-pwa-dash__demo-section {
    text-align: center;
}

.cg-pwa-dash__demo-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: #0F1720;
    margin: 0 0 6px;
}

.cg-pwa-dash__demo-section > p {
    font-size: 13px;
    color: #6B7280;
    margin: 0 0 14px;
}

.cg-pwa-dash__demo-form input[type="email"] {
    display: block;
    width: 100%;
    box-sizing: border-box; /* padding and border count inside the 100% width */
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid #D4D8DD;
    border-radius: 0;
    margin-bottom: 10px;
    -webkit-appearance: none;
}

.cg-pwa-dash__demo-form input[type="email"]:focus {
    border-color: #067F38;
    outline: none;
    box-shadow: 0 0 0 2px rgba(6, 127, 56, 0.2);
}

.cg-pwa-dash__demo-hint {
    font-size: 12px;
    color: #9CA3AF;
    margin-top: 8px;
}

/* ── 3-column stats on narrow screens ── */
@media (max-width: 360px) {
    .cg-pwa-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .cg-pwa-dash__stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
