/* ═══════════════════════════════════════════════════════════════════════════
   BOA Shared Components — Toast, badges, action tiles, empty state, login
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Login ──────────────────────────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    padding: 24px 16px;
}
.login-wrap article {
    max-width: 420px; width: 100%; text-align: center;
    box-shadow: var(--shadow-lg); border-radius: 16px;
    padding: 36px 32px;
}
.login-wrap article h1, .login-wrap article h2 {
    font-size: 1.6rem; margin-bottom: 4px; color: var(--primary-dark);
}
.login-wrap article p {
    color: var(--text-muted); font-size: .9rem; margin-bottom: 20px;
}
.login-wrap .error {
    color: var(--danger); background: var(--danger-light); padding: 8px 12px;
    border-radius: var(--radius-sm); font-size: .85rem; margin-bottom: 12px;
}

/* Company picker buttons */
.company-btn {
    display: block; width: 100%; padding: 14px 16px; margin-bottom: 10px;
    background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm);
    font-size: 1rem; font-weight: 600; cursor: pointer; text-align: center;
    text-decoration: none; transition: background .15s;
}
.company-btn:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: var(--text); color: #fff; padding: 12px 24px;
    border-radius: var(--radius-sm); z-index: 400; box-shadow: var(--shadow-lg);
    animation: fadeInUp .3s ease; max-width: 90vw; text-align: center; font-size: .9rem;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Action tile grid ──────────────────────────────────────────────────── */
.action-grid, .action-tiles {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.action-tile {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 16px 12px; border-radius: var(--radius); color: #fff; border: none;
    font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: all .15s; text-align: center; min-height: 52px;
    box-shadow: var(--shadow); -webkit-user-select: none; user-select: none;
    --pico-background-color: var(--primary-dark);
    --pico-color: #fff;
}
.action-tile:hover { opacity: .9; color: #fff; text-decoration: none; }
.action-tile:active { transform: scale(.97); }
.action-tile.active { box-shadow: inset 0 2px 6px rgba(0,0,0,.25); }
.action-tile i { font-size: 1.1rem; }
.action-tile, .action-tile.blue { background: var(--primary-dark); }
.action-tile.green { background: var(--success); }
.action-tile.amber { background: var(--accent); }
.action-tile.slate { background: var(--slate); }
.action-tile.grey { background: #94a3b8; }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.wp-badge { font-size: .7rem; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.wp-badge-order { background: var(--primary-light); color: var(--primary-dark); }
.wp-badge-done { background: var(--success-light); color: #065f46; }
.wp-badge-pending { background: var(--accent-light); color: #92400e; }
.status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 12px; font-size: .78rem; font-weight: 600; }
.status-done { background: var(--success-light); color: #065f46; }
.status-pending { background: var(--accent-light); color: #92400e; }

/* ── Empty state ────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; display: block; }

/* ── Info block (detail pages) ──────────────────────────────────────────── */
.ap-info-block {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    border-left: 4px solid var(--primary); overflow: hidden; position: relative;
    margin-bottom: 14px;
}
.ap-info-block .info-date-bar, .ap-date-bar {
    background: var(--accent); color: #fff; padding: 8px 14px;
    font-weight: 700; font-size: .9rem; display: flex;
    justify-content: space-between; align-items: center;
}
.ap-info-block .info-line { margin-bottom: 2px; word-break: break-word; padding: 0 16px; }
.ap-info-block .info-line b { color: var(--text); }
.ap-info-content { padding: 14px; font-size: .88rem; line-height: 1.6; color: var(--text); }

/* ── Detail rows ────────────────────────────────────────────────────────── */
.detail-row { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-of-type { border-bottom: none; }
.detail-label { font-size: .82rem; color: var(--text-muted); min-width: 80px; flex-shrink: 0; }
.detail-value { font-size: .88rem; word-break: break-word; }

/* ── WP Card (work order / transport cards) ─────────────────────────────── */
.wp-card {
    display: flex; align-items: stretch; background: var(--card);
    border-radius: var(--radius); overflow: hidden; text-decoration: none;
    color: inherit; box-shadow: var(--shadow); border-left: 4px solid var(--primary);
    transition: box-shadow .15s, transform .1s; margin-bottom: 10px;
}
.wp-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.wp-card.todo { border-left-color: var(--danger); }
.wp-card.is-done { border-left-color: var(--success); opacity: .7; }
.wp-card.stop-work-filled { background: #f5f5f5; opacity: .85; border-left-color: #9ca3af; }
.wp-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; gap: 8px; }
.wp-card-title { font-weight: 700; font-size: .95rem; }
.wp-card-time { font-size: .82rem; color: var(--primary); font-weight: 600; white-space: nowrap; }
.wp-card-address { font-size: .82rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.wp-card-reason { font-size: .8rem; color: var(--text-muted); margin-top: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wp-card-badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.wp-card-body { flex: 1; padding: 12px 14px; font-size: .85rem; line-height: 1.4; }
.wp-card-side { display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 8px 10px; min-width: 54px; background: var(--bg); }

/* ── Action buttons ─────────────────────────────────────────────────────── */
.ap-btn { padding: 10px 16px; border: none; border-radius: 8px; font-size: .88rem; font-weight: 600;
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .15s;
    text-decoration: none; min-height: 44px; }
.ap-btn:hover { text-decoration: none; }
.ap-btn:active { transform: scale(.97); }
.ap-btn-primary { background: var(--primary); color: #fff; }
.ap-btn-primary:hover { background: var(--primary-dark); }
.ap-btn-success { background: var(--success); color: #fff; }
.ap-btn-success:hover { background: #059669; }
.ap-btn-danger { background: var(--danger); color: #fff; }
.ap-btn-danger:hover { background: #dc2626; }
.ap-btn-warning { background: var(--warning); color: #fff; }
.ap-btn-warning:hover { background: #d97706; }
.ap-btn-outline { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.ap-btn-outline:hover { background: var(--primary-light); color: var(--primary); }
.ap-btn-full { width: 100%; justify-content: center; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
    text-align: center; padding: 14px; font-size: .75rem;
    color: var(--text-muted); border-top: 1px solid var(--border);
}

/* ── Mock overlay (debug POST preview) ──────────────────────────────────── */
.mock-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex;
    justify-content: center; align-items: center; z-index: 300; padding: 16px;
}
.mock-card {
    background: var(--card); border-radius: 12px; padding: 20px; width: 100%;
    max-width: 500px; max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.mock-card h3 { font-size: 1rem; color: var(--primary-dark); margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px; }
.mock-card pre { background: #1e293b; color: #e2e8f0; padding: 12px; border-radius: 8px;
    font-size: .78rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
    max-height: 300px; overflow-y: auto; }
.mock-card .mock-close { margin-top: 14px; width: 100%; padding: 12px; background: var(--primary);
    color: #fff; border: none; border-radius: 8px; font-size: .95rem; font-weight: 600; cursor: pointer; }
.mock-card .mock-close:hover { background: var(--primary-dark); }
.mock-banner { background: var(--accent-light); color: #92400e; padding: 10px 14px;
    border-radius: var(--radius-sm); text-align: center; margin: 12px;
    font-size: .8rem; font-weight: 600; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .login-wrap article { padding: 28px 20px; }
    .action-tile { padding: 12px 8px; font-size: .82rem; min-height: 48px; }
    .ap-info-block { padding: 10px 12px; font-size: .84rem; }
}
