/* Assignment Manager Styles */

.assignment-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.assignment-tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.assignment-tab-btn:hover {
    color: #10b981;
    background: #f0fdf4;
}

.assignment-tab-btn.active {
    color: #10b981;
    border-bottom-color: #10b981;
}

.assignment-view {
    display: none;
}

.assignment-view.active {
    display: block;
}

/* User Info Displays */
.user-info,
.assignment-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-info strong,
.assignment-info strong {
    color: #1f2937;
    font-weight: 600;
}

.user-info small,
.assignment-info small {
    color: #6b7280;
    font-size: 0.813rem;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Assignment Modal Styles */
.assignment-modal {
    padding: 1.5rem;
}

.assignment-modal h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.farmer-info-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.farmer-info-box i {
    font-size: 2rem;
    color: #10b981;
}

.farmer-info-box strong {
    display: block;
    color: #1f2937;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.farmer-info-box small {
    color: #6b7280;
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.938rem;
    color: #1f2937;
    background-color: #ffffff;
    transition: all 0.2s;
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-control:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

textarea.form-control {
    resize: vertical;
    font-family: inherit;
}

/* Officer Assignments View */
.officer-assignments-view {
    padding: 1.5rem;
}

.officer-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.officer-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.officer-header p {
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.farmers-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.farmer-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.farmer-card:hover {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.farmer-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.farmer-details strong {
    color: #1f2937;
    font-weight: 600;
}

.farmer-details small {
    color: #6b7280;
    font-size: 0.813rem;
}

/* Bulk Assignment Modal */
.bulk-assignment-modal {
    padding: 1.5rem;
}

.bulk-assignment-modal h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.farmer-selection-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    background: #f9fafb;
}

.farmer-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.farmer-checkbox:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

.farmer-checkbox:last-child {
    margin-bottom: 0;
}

.farmer-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.farmer-checkbox span {
    flex: 1;
    font-size: 0.938rem;
    color: #374151;
}

/* Officer Summary Grid */
.officers-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.officer-summary-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.2s;
}

.officer-summary-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.officer-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.officer-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
}

.officer-header small {
    color: #6b7280;
    font-size: 0.813rem;
}

.farmer-count {
    background: #10b981;
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.workload-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.workload-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.workload-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .officers-summary-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .assignment-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .assignment-tab-btn {
        white-space: nowrap;
    }

    .officers-summary-grid {
        grid-template-columns: 1fr;
    }

    .section-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .section-actions > * {
        width: 100%;
    }

    .farmer-selection-list {
        max-height: 300px;
    }
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.assignment-view.active {
    animation: slideIn 0.3s ease;
}

/* Assignment Details View Modal */
.assignment-details-view {
    padding: 1.5rem;
}

.assignment-details-view .assignment-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.assignment-details-view .assignment-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.assignment-details-view h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.assignment-details-view h4 i {
    color: #10b981;
}

.assignment-details-view .details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.assignment-details-view .detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.assignment-details-view .detail-item.full-width {
    grid-column: span 2;
}

.assignment-details-view .detail-item label {
    font-size: 0.813rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.assignment-details-view .detail-item span {
    font-size: 0.938rem;
    color: #1f2937;
}

.assignment-details-view .empty-state {
    color: #9ca3af;
    font-style: italic;
    padding: 1rem;
    text-align: center;
    background: #f9fafb;
    border-radius: 0.5rem;
}

@media (max-width: 768px) {
    .assignment-details-view .details-grid {
        grid-template-columns: 1fr;
    }

    .assignment-details-view .detail-item.full-width {
        grid-column: span 1;
    }
}

/* =====================================================
   Vibrant Assignment Modals
   ===================================================== */

.assignment-modal-overlay {
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(4px);
    animation: amOverlayIn 0.2s ease;
}

@keyframes amOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.assignment-modal-container {
    max-width: 760px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    animation: amModalIn 0.28s ease;
    overflow: hidden;
}

@keyframes amModalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.assignment-modal-header {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 55%, #a5b4fc 100%);
    border-bottom: none;
    padding: 1.25rem 1.5rem;
    color: #fff;
}

.assignment-modal-header-text h2 {
    margin: 0;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
}

.assignment-modal-header-kicker {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 0.2rem;
}

.assignment-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.assignment-modal-close:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.assignment-modal-body {
    padding: 0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.assignment-modal-vibrant {
    padding: 1.25rem 1.5rem 1.5rem;
}

.am-modal-hero {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.15rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(129, 140, 248, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.18);
    margin-bottom: 1.25rem;
}

.am-modal-hero--assign {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(52, 211, 153, 0.08) 100%);
    border-color: rgba(16, 185, 129, 0.22);
}

.am-modal-hero--reassign {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(251, 191, 36, 0.08) 100%);
    border-color: rgba(245, 158, 11, 0.24);
}

.am-modal-hero--officer {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(56, 189, 248, 0.08) 100%);
    border-color: rgba(14, 165, 233, 0.22);
}

.am-modal-hero-icon,
.am-modal-hero-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.28);
}

.am-modal-hero--assign .am-modal-hero-icon {
    background: linear-gradient(135deg, #10b981, #34d399);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.28);
}

.am-modal-hero--reassign .am-modal-hero-icon {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.28);
}

.am-modal-hero-avatar--officer {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.28);
}

.am-modal-hero-copy {
    flex: 1;
    min-width: 0;
}

.am-modal-kicker {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6366f1;
    margin-bottom: 0.25rem;
}

.am-modal-hero-copy h3 {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
}

.am-modal-hero-copy p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.am-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.am-modal-tags span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(99, 102, 241, 0.14);
    font-size: 0.75rem;
    color: #4b5563;
}

.am-modal-stat-chip {
    text-align: center;
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(99, 102, 241, 0.18);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.1);
    min-width: 72px;
}

.am-modal-stat-chip strong {
    display: block;
    font-size: 1.35rem;
    line-height: 1;
    color: #6366f1;
}

.am-modal-stat-chip span {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.am-modal-stat-chip--green strong {
    color: #10b981;
}

.am-modal-section {
    margin-bottom: 1.25rem;
}

.am-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.am-section-heading h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.am-section-heading h4 i {
    color: #6366f1;
}

.am-section-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
}

.am-officers-grid,
.am-farmers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.85rem;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.am-officer-card,
.am-farmer-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.am-officer-card:hover,
.am-farmer-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.28);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.1);
}

.am-officer-card-top,
.am-farmer-card-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.am-officer-avatar,
.am-farmer-mini-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    flex-shrink: 0;
}

.am-farmer-mini-avatar {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.am-officer-identity,
.am-farmer-card-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.am-officer-identity strong,
.am-farmer-card-details strong {
    color: #1f2937;
    font-size: 0.9375rem;
}

.am-officer-identity span,
.am-farmer-card-details span {
    color: #6b7280;
    font-size: 0.8125rem;
}

.am-status-pill {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.am-status-pill--active {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.am-officer-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.am-officer-card-meta i {
    width: 14px;
    margin-right: 0.35rem;
    color: #9ca3af;
}

.am-officer-card-notes {
    margin: 0.65rem 0 0;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #eef2f7;
    font-size: 0.8125rem;
    color: #4b5563;
}

.am-officer-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eef2f7;
}

.am-farmer-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.am-farmer-assigned-date {
    color: #6366f1 !important;
    font-weight: 500;
}

.am-officers-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-radius: 14px;
    border: 1px dashed rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.04);
}

.am-officers-empty--compact {
    padding: 1.5rem 1rem;
}

.am-officers-empty i {
    font-size: 2rem;
    color: #a5b4fc;
    margin-bottom: 0.65rem;
}

.am-officers-empty p {
    margin: 0;
    color: #6b7280;
}

.am-form-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
}

.am-form-panel .form-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #374151;
}

.am-form-panel .form-group label i {
    color: #6366f1;
}

.am-form-control {
    border-color: #d1d5db;
    border-radius: 10px;
}

.am-form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.am-farmer-selection-list {
    border-color: rgba(99, 102, 241, 0.16);
    background: #f8fafc;
    border-radius: 12px;
}

.am-farmer-checkbox:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.am-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding-top: 0.25rem;
}

.am-btn-glow {
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.24);
}

.am-btn-glow.btn-success {
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.24);
}

.am-btn-glow.btn-warning {
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.24);
}

@media (max-width: 768px) {
    .assignment-modal-container {
        width: 95%;
        max-height: 92vh;
    }

    .am-modal-hero {
        flex-wrap: wrap;
    }

    .am-modal-stat-chip {
        margin-left: auto;
    }

    .am-officers-grid,
    .am-farmers-grid {
        grid-template-columns: 1fr;
        max-height: 280px;
    }

    .am-modal-actions {
        flex-direction: column-reverse;
    }

    .am-modal-actions .btn {
        width: 100%;
    }
}
