/* Dashboard Card */
.dashboard-card {
    background: white;
    border-radius: 1rem;
    border: 1px solid #f1f1f1;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1a1a1a;
    padding: 0px;
}

/* Header Section */
.header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid #f1f1f1;
    background: linear-gradient(to right, #ffffff, #f9f9f9);
}

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

.header h1 {
    font-size: 1rem;
    font-weight: 400;
    color: rgb(43, 45, 66);
    font-family: 'Poppins', sans-serif;
    margin: 0;
}

/* Filter Section */
.filter-section {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-badge.pending {
    background-color: #FEF3C7;
    color: #92400E;
}

.status-badge.sent {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.status-badge.valuated {
    background-color: #E9D8FD;
    color: #5B21B6;
}

.status-badge.valuation_sent {
    background-color: #E9D8FD;
    color: #5B21B6;
}

.status-badge.valuation_accepted {
    background-color: #D1FAE5;
    color: #065F46;
}

.status-badge.valuation_declined {
    background-color: #FEE2E2;
    color: #991B1B;
}

.status-badge.accepted {
    background-color: #D1FAE5;
    color: #065F46;
}

.status-badge.paid {
    background-color: #D1FAE5;
    color: #065F46;
}

.status-badge.aborted {
    background-color: #F3F4F6;
    color: #374151;
}

/* Filter Form */
.filter-form {
    display: inline-block;
}

.status-filter {
    padding: 8px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    background-color: white;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.status-filter:hover {
    border-color: #D1D5DB;
}

.status-filter:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Table Styles */
.table-container {
    padding: 1.5rem;
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.orders-table th,
.orders-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #E5E7EB;
}

.orders-table th {
    background-color: #F9FAFB;
    font-weight: 500;
    color: #374151;
}

.orders-table tr:hover {
    background-color: #F9FAFB;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.action-btn {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    color: #374151;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid #E5E7EB;
    background-color: white;
    cursor: pointer;
}

.action-btn i {
    font-size: 0.875rem;
}

.action-btn:hover {
    background-color: #F3F4F6;
    border-color: #D1D5DB;
}

.action-btn.view-btn {
    color: #6B7280;
}

/* Postal Status Columns */
.postal-status {
    font-weight: 500;
    color: #374151;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #F3F4F6;
    font-size: 0.8rem;
}

.latest-event {
    color: #6B7280;
    font-size: 0.875rem;
    cursor: help;
}

.latest-event:hover {
    color: #374151;
}

.action-btn.mark-as-sent {
    color: #059669;
    border-color: #059669;
}

.action-btn.mark-as-sent:hover {
    background-color: #ECFDF5;
    color: #047857;
}

/* Container */
.container {
    max-width: 75rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Empty State */
.text-center {
    text-align: center;
    color: #6B7280;
    padding: 2rem;
}

/* Modal Styles */
.modal-content {
    border-radius: 0.5rem;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #E5E7EB;
    padding: 1rem 1.5rem;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: #111827;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #E5E7EB;
    padding: 1rem 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #E5E7EB;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #374151;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background-color: #F3F4F6;
    color: #374151;
    border: 1px solid #E5E7EB;
}

.btn-secondary:hover {
    background-color: #E5E7EB;
}

.btn-primary {
    background-color: #3B82F6;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #2563EB;
}

.btn-close {
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.btn-close:hover {
    opacity: 0.75;
}

/* Mark as Sent Form */
.mark-as-sent-form {
    display: inline-block;
}

.mark-as-sent-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.system-id-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #E5E7EB;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #374151;
    width: 120px;
    transition: all 0.2s;
}

.system-id-input:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.system-id-input::placeholder {
    color: #9CA3AF;
}

/* Valuation Form */
.valuation-form {
    display: inline-block;
}

.valuation-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.valuation-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #E5E7EB;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #374151;
    width: 120px;
    transition: all 0.2s;
}

.valuation-input:read-only {
    background-color: #F9FAFB;
    cursor: not-allowed;
    color: #6B7280;
}

.valuation-input:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.valuation-input::placeholder {
    color: #9CA3AF;
}

.action-btn.value-btn {
    color: #3B82F6;
    border-color: #3B82F6;
}

.action-btn.value-btn:hover {
    background-color: #EFF6FF;
    color: #2563EB;
}

/* Alert Messages */
.alert {
    margin: 1rem 1.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

/* Order Show Page Styles */
.order-details {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1.5rem;
}

.info-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.info-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item label {
    font-size: 0.875rem;
    color: #64748b;
}

.info-item p {
    font-size: 1rem;
    color: #1e293b;
    font-weight: 500;
}

/* Valuation Form */
.valuation-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.valuation-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.valuation-info .info-item {
    max-width: 300px;
}

/* Status Form */
.status-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 500px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    color: #64748b;
}

.form-select,
.form-input,
.form-textarea {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 1rem;
    color: #1e293b;
    width: 100%;
}

.form-select:focus,
.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.sent {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.valuated {
    background: #f3e8fd;
    color: #6b21a8;
}

.status-badge.valuation_sent {
    background: #e0f2fe;
    color: #075985;
}

.status-badge.accepted {
    background: #dcfce7;
    color: #166534;
}

.status-badge.declined {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.aborted {
    background: #f3f4f6;
    color: #374151;
}

/* Header Styles */
.header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.header-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-title-group h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.text-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

/* Alert Styles */
.alert {
    margin: 1rem 1.5rem;
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn i {
    font-size: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

/* Valuation Loading */
.valuation-loading {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.valuation-loading p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

.valuation-loading::before {
    content: '';
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: #fff;
    color: #111827;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Card Styles */
.card {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.card-body {
    color: #4b5563;
}

/* Status Badge Styles */
.status-badge-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge-sent {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-badge-valuated {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge-valuation-sent {
    background-color: #f3e8fd;
    color: #6b21a8;
}

.status-badge-payment {
    background-color: #fef9c3;
    color: #854d0e;
}

.status-badge-completed {
    background-color: #dcfce7;
    color: #166534;
}

/* Grid Layout */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .timeline::before {
        left: 5px;
    }
    
    .timeline-marker {
        width: 12px;
        height: 12px;
    }
    
    .timeline-content {
        padding: 12px;
    }
    
    .timeline-title {
        font-size: 0.9rem;
    }
    
    .timeline-description {
        font-size: 0.8rem;
    }
}

/* Icon Wrapper */
.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
}

.icon-wrapper i {
    font-size: 1rem;
}

/* Mark as paid button */
.mark-as-paid {
    background-color: #10B981;
    color: white;
}

.mark-as-paid:hover {
    background-color: #059669;
}

/* Fetch new valuation button */
.fetch-valuation-btn {
    background-color: #3B82F6;
    color: white;
}

.fetch-valuation-btn:hover {
    background-color: #2563EB;
}

/* Return button */
.return-btn {
    background-color: #EF4444;
    color: white;
}

.return-btn:hover {
    background-color: #DC2626;
}