/* FieldOps Module Styles */

/* Dashboard stat cards */
.fieldops-stat-card {
    text-align: center;
    padding: 15px;
}

.fieldops-stat-card h3 {
    font-size: 28px;
    margin-bottom: 5px;
}

/* Service Calendar */
.fieldops-calendar {
    width: 100%;
}

.fieldops-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Route Map */
.fieldops-map-container {
    width: 100%;
    height: 500px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Route Stop Cards */
.fieldops-stop-card {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 8px;
    background: #fff;
    transition: box-shadow 0.2s;
}

.fieldops-stop-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.fieldops-stop-card.completed {
    border-left: 3px solid #2ecc71;
}

.fieldops-stop-card.in-progress {
    border-left: 3px solid #f39c12;
}

.fieldops-stop-card.skipped {
    border-left: 3px solid #e74c3c;
    opacity: 0.7;
}

/* Readings badge colors */
.fieldops-reading-good {
    color: #2ecc71;
}

.fieldops-reading-warning {
    color: #f39c12;
}

.fieldops-reading-danger {
    color: #e74c3c;
}

/* Drag and drop sortable */
.fieldops-sortable-ghost {
    opacity: 0.4;
    background: #c8ebfb;
}

.fieldops-sortable-chosen {
    background: #f0f8ff;
}

.fieldops-sortable-drag {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Route Builder - Stop cards in sortable list */
.fieldops-sortable-list .fieldops-stop-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: default;
}

.fieldops-stop-handle {
    cursor: grab;
    padding: 4px 6px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 40px;
}

.fieldops-stop-handle:active {
    cursor: grabbing;
}

.fieldops-stop-number {
    font-weight: bold;
    color: #3570B1;
    font-size: 14px;
}

.fieldops-stop-info {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}

.fieldops-stop-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    padding-top: 2px;
}

/* Pin color dot indicator */
.fieldops-pin-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
}

/* Location search results panel */
.fieldops-location-results .fieldops-location-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.fieldops-location-results .fieldops-location-item:hover {
    background: #f8f9fa;
}

.fieldops-location-results .fieldops-location-item:last-child {
    border-bottom: none;
}

.fieldops-location-item-info {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}

/* Route Assignments page - day cards */
.fieldops-assignment-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
    margin-bottom: 6px;
    border: 1px solid #eee;
    border-radius: 3px;
    background: #fff;
    font-size: 12px;
}

.fieldops-assignment-card:hover {
    background: #f8f9fa;
}

.fieldops-assignment-num {
    font-weight: bold;
    color: #3570B1;
    min-width: 20px;
    text-align: center;
    font-size: 13px;
}

.fieldops-assignment-info {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}

.fieldops-assignment-info a {
    font-weight: 600;
}

.fieldops-assignment-actions {
    flex-shrink: 0;
}

/* Route Dashboard - grid */
.fieldops-route-grid th {
    background: #f5f5f5;
    font-size: 12px;
    text-transform: uppercase;
}

.fieldops-route-grid td {
    vertical-align: middle;
}

.fieldops-today-col {
    background: #fffde7 !important;
    border-left: 2px solid #f39c12 !important;
}

.fieldops-grid-count {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    background: #3570B1;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

.fieldops-grid-count:hover {
    background: #2a5a8e;
    color: #fff;
    text-decoration: none;
}

/* Route info bar (distance/duration) */
.fieldops-route-info {
    padding: 8px 15px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    color: #555;
    font-size: 13px;
}

.fieldops-route-info i {
    color: #3570B1;
}

/* ====================================================================
   Service Calendar (Phase 4)
   ==================================================================== */

.fieldops-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.fieldops-calendar-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fieldops-calendar-range {
    font-size: 16px;
    font-weight: 600;
    margin-left: 10px;
    color: #333;
}

.fieldops-calendar-summary {
    display: flex;
    gap: 20px;
    padding: 10px 0;
    flex-wrap: wrap;
}

.fieldops-summary-item {
    font-size: 13px;
}

.fieldops-summary-item strong {
    font-size: 15px;
}

/* Calendar Grid */
.fieldops-calendar-grid {
    margin-bottom: 0;
    table-layout: fixed;
}

.fieldops-calendar-grid th,
.fieldops-calendar-grid td {
    vertical-align: top;
    border-color: #e0e0e0;
}

.fieldops-cal-tech-col {
    width: 140px;
    min-width: 140px;
    background: #f9f9f9;
}

.fieldops-cal-day-col {
    text-align: center;
    background: #f5f5f5;
    padding: 6px 4px !important;
}

.fieldops-cal-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fieldops-cal-day-name {
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
}

.fieldops-cal-day-num {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.fieldops-cal-today-num {
    background: #3570B1;
    color: #fff;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    display: inline-block;
    text-align: center;
}

.fieldops-cal-tech-cell {
    padding: 8px !important;
    background: #fafafa;
    vertical-align: middle !important;
}

.fieldops-cal-cell {
    padding: 6px !important;
    min-height: 80px;
    position: relative;
    cursor: default;
}

.fieldops-cal-cell-content {
    font-size: 12px;
}

.fieldops-cal-cell-count {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 4px;
}

.fieldops-cal-progress {
    margin-bottom: 4px;
}

.fieldops-cal-stops-mini {
    max-height: 100px;
    overflow: hidden;
}

.fieldops-cal-stop-mini {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 2px;
    line-height: 1.2;
}

.fieldops-cal-stop-mini small {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fieldops-cal-expand {
    display: block;
    text-align: center;
    padding: 2px;
    font-size: 10px;
    color: #999;
    border-top: 1px solid #eee;
    margin-top: 4px;
}

.fieldops-cal-expand:hover {
    color: #3570B1;
    text-decoration: none;
}

.fieldops-cal-empty {
    text-align: center;
    color: #ddd;
    font-size: 14px;
    padding: 10px 0;
}

/* No staff message */
.fieldops-no-staff-assigned {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* ====================================================================
   Route Stops - Field Tech Interface (Phase 5)
   ==================================================================== */

/* Stop list cards */
.fieldops-stop-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.fieldops-stop-number-lg {
    font-size: 20px;
    font-weight: bold;
    color: #3570B1;
    min-width: 30px;
    text-align: center;
    padding-top: 2px;
}

.fieldops-stop-card-info {
    flex: 1;
    min-width: 0;
}

.fieldops-stop-card-info h5 a {
    color: #333;
    font-weight: 600;
}

.fieldops-stop-card-info h5 a:hover {
    color: #3570B1;
}

.fieldops-stop-card-status {
    text-align: right;
    flex-shrink: 0;
}

.fieldops-stop-card-actions {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Action bar on record page */
.fieldops-stop-action-bar {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Checklist items */
.fieldops-checklist-item {
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
    margin: 0;
}

.fieldops-checklist-item:last-child {
    border-bottom: none;
}

/* Photo gallery */
.fieldops-photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fieldops-photo-thumb {
    width: 120px;
    height: 90px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.fieldops-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ====================================================================
   Work Orders (Phase 6)
   ==================================================================== */

.fieldops-wo-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

/* ====================================================================
   Shopping List (Phase 7)
   ==================================================================== */

.fieldops-shopping-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.fieldops-shopping-item:last-child {
    border-bottom: none;
}

.fieldops-shopping-item.purchased {
    opacity: 0.6;
    text-decoration: line-through;
}

.fieldops-shopping-item-info {
    flex: 1;
    min-width: 0;
}

.fieldops-shopping-item-actions {
    flex-shrink: 0;
}

/* ====================================================================
   Dashboard Widgets (Phase 8)
   ==================================================================== */

.fieldops-widget {
    padding: 20px;
    text-align: center;
}

.fieldops-widget h3 {
    font-size: 32px;
    margin: 0 0 5px;
    font-weight: bold;
}

.fieldops-widget p {
    color: #888;
    margin: 0;
    font-size: 13px;
}

.fieldops-skipped-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
}

.fieldops-skipped-row:last-child {
    border-bottom: none;
}

/* Report tables */
.fieldops-report-table th {
    background: #f5f5f5;
    font-size: 12px;
    text-transform: uppercase;
}

/* ====================================================================
   Route Optimization (Phase 10)
   ==================================================================== */

/* Optimize button pulse animation */
#btn-optimize-route {
    transition: all 0.2s;
}

#btn-optimize-route:hover {
    transform: scale(1.05);
}

/* Geocode status indicator */
#geocode-status {
    padding: 4px 0;
}

#geocode-status .fa-map-marker {
    color: #2ecc71;
}

/* Tags table in settings */
#tags-table td {
    vertical-align: middle;
}

/* Print styles for shopping list */
@media print {
    .fieldops-no-print {
        display: none !important;
    }

    .fieldops-shopping-item {
        break-inside: avoid;
    }
}

/* ====================================================================
   Fleet Route Optimization (Phase 11)
   ==================================================================== */

/* Tech color dot in panel headers */
.fieldops-tech-color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

/* Proposal tech panel */
.fieldops-proposal-tech-panel {
    transition: box-shadow 0.2s;
}

.fieldops-proposal-tech-panel:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.fieldops-proposal-tech-panel .panel-heading {
    padding: 10px 15px;
}

/* Proposal stops list */
.fieldops-proposal-stops-list {
    max-height: 300px;
    overflow-y: auto;
}

.fieldops-proposal-stop-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.fieldops-proposal-stop-item:last-child {
    border-bottom: none;
}

.fieldops-proposal-stop-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
}

.fieldops-proposal-stop-info {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    line-height: 1.4;
}

.fieldops-proposal-stop-info strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Map legend */
.fieldops-map-legend {
    padding: 8px 15px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
}

.fieldops-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.fieldops-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #555;
}

.fieldops-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Generate button */
#btn-generate-proposal {
    transition: all 0.2s;
    font-size: 14px;
    padding: 10px 20px;
}

#btn-generate-proposal:hover {
    transform: scale(1.02);
}

/* Proposal status badges in table */
.fieldops-proposal-status {
    font-size: 12px;
}

/* Fleet optimizer checkbox list */
#fleet-tech-checkboxes {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px 12px;
}

#fleet-tech-checkboxes .checkbox {
    margin: 4px 0;
}

/* Accept/Reject buttons on proposal view */
#btn-accept-proposal,
#btn-reject-proposal {
    min-width: 200px;
    transition: all 0.2s;
}

#btn-accept-proposal:hover {
    transform: scale(1.03);
}

#btn-reject-proposal:hover {
    transform: scale(1.03);
}

/* ====================================================================
   Button Text Color Fixes
   Fix for link-based buttons inheriting wrong text colors
   ==================================================================== */

.panel_s a.btn-primary,
.panel_s a.btn-info,
.panel_s a.btn-success,
.panel_s a.btn-warning,
.panel_s a.btn-danger {
    color: #fff !important;
}

.panel_s a.btn-primary:hover,
.panel_s a.btn-info:hover,
.panel_s a.btn-success:hover,
.panel_s a.btn-warning:hover,
.panel_s a.btn-danger:hover {
    color: #fff !important;
}

.panel_s a.btn-default {
    color: #333 !important;
}

.panel_s a.btn-default:hover {
    color: #333 !important;
}
