/* ═══════════════════════════════════════════════════════════
   PatrolWizzard V6 — Manager Portal — App Styles
   Portal-specific overrides and extensions
   ═══════════════════════════════════════════════════════════ */

/* Login logo white bg fix */
.login-card .logo-area img {
    background: #ffffff;
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* Dashboard widgets */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--sp-4);
    margin-top: var(--sp-4);
}
.widget {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.widget-header {
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.widget-header h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}
.widget-body {
    padding: var(--sp-4);
}
.widget-body .widget-list {
    list-style: none;
}
.widget-body .widget-list li {
    padding: var(--sp-2) 0;
    border-bottom: 1px solid var(--border-light);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.widget-body .widget-list li:last-child {
    border-bottom: none;
}

/* Quick action cards */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
}
.quick-action {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--sp-4);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.quick-action:hover {
    border-color: var(--pw-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.quick-action .qa-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--sp-2);
    background: var(--pw-primary-50);
    color: var(--pw-primary);
}
.quick-action .qa-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-secondary);
}

/* Detail panels */
.detail-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--sp-4);
    padding: var(--sp-4);
}
.detail-field .detail-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--sp-1);
}
.detail-field .detail-value {
    font-size: var(--text-sm);
    color: var(--text-primary);
    font-weight: 500;
}

/* ── Property Detail Tabs ─────────────────────────────── */
.prop-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: var(--sp-4);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.prop-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}
.prop-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.prop-tab.active {
    background: var(--pw-primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.prop-tab.active svg { stroke: #fff; }

/* ── Sub-tables (inside property tabs) ────────────────── */
.sub-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}
.sub-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-light);
    background: var(--bg-subtle, var(--bg-card));
}
.sub-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.sub-table tbody tr:hover {
    background: var(--bg-hover);
}
.sub-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Tab content card ─────────────────────────────────── */
.prop-tab-content {
    min-height: 200px;
}


/* ── Geofence Map ─────────────────────────────────────── */
#geo-map {
    background: var(--bg-subtle, #f1f5f9);
}
#geo-map .gm-style-iw { font-size: 13px; }

/* ── Bug FAB forced visibility ────────────────────────── */
#pw-bug-fab {
    position: fixed !important;
    z-index: 999999 !important;
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Active Employee Location - map markers */
.ael-marker { background: none !important; border: none !important; }
#ael-map-container .leaflet-container { width: 100% !important; height: 100% !important; }

/* Scan Tour Tag Manager — drag & drop */
.stm-tag:hover { background: var(--surface-secondary) !important; }
.stm-tag:active { cursor: grabbing; }
.stm-tag[draggable="true"]:hover { border-color: var(--primary) !important; }
.stm-ctx div:hover { background: var(--surface-secondary); }

/* Route Check Tag Manager — drag & drop */
.rc-tag:hover { background: var(--surface-secondary) !important; border-color: var(--primary) !important; }
.rc-tag:active { cursor: grabbing; }
.rc-ctx div:hover { background: var(--surface-secondary); }

/* ── Stat grid — dashboard cards in a single row ──────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--sp-4);
    margin-bottom: var(--sp-4);
}
