/* ===== ERP MAIN LAYOUT ===== */
.erp-main {
    padding: 1.5rem 2rem;
    background: #f0f2f5;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ===== PAGE HEADER ===== */
.erp-page-header {
    background: white;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.header-left {
    flex: 1;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.breadcrumb-link {
    color: #3b82f6;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #9ca3af;
}

.breadcrumb-current {
    color: #374151;
    font-weight: 500;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem 0;
}

.page-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ===== BUTTONS ===== */
.btn-erp {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s;
    text-decoration: none;
}

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

.btn-erp-primary:hover {
    background: #2563eb;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-erp-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-erp-secondary:hover {
    background: #e5e7eb;
}

.btn-erp-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ===== FORM GRID ===== */
.erp-form-grid {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .erp-form-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== MAIN COLUMN ===== */
.erp-main-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== SIDEBAR ===== */
.erp-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== CARDS ===== */
.erp-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    font-weight: 500;
}

.card-header-left i {
    color: #3b82f6;
    font-size: 1rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.card-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* ===== STATUS BADGE ===== */
.status-badge {
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* ===== FIELD GROUPS ===== */
.erp-field-group {
    display: grid;
    gap: 1rem;
}

.erp-field-group-2 {
    grid-template-columns: 1fr 1fr;
}

.erp-field-group-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 768px) {
    .erp-field-group-2,
    .erp-field-group-3 {
        grid-template-columns: 1fr;
    }
}

.erp-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.field-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
}

.field-label.required::after {
    content: '*';
    color: #dc2626;
    margin-left: 0.2rem;
}

/* ===== INPUTS ===== */
.erp-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.15s;
    background: white;
    color: #111827;
    width: 100%;
}

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

.erp-input.is-invalid {
    border-color: #dc2626;
}

.erp-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.field-error {
    color: #dc2626;
    font-size: 0.8rem;
}

/* ===== SELECT ===== */
.erp-select-wrapper {
    position: relative;
}

.erp-select {
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    color: #111827;
    width: 100%;
    appearance: none;
    cursor: pointer;
}

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

.select-arrow {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    font-size: 0.8rem;
}

/* ===== CURRENCY INPUT ===== */
.erp-currency-input {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.erp-currency {
    padding-left: 2rem;
}

/* ===== TEXTAREA ===== */
.erp-textarea {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.15s;
    background: white;
    color: #111827;
    width: 100%;
    resize: vertical;
    font-family: inherit;
}

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

/* ===== SIDEBAR FIELDS ===== */
.sidebar-field {
    margin-bottom: 1rem;
}

.sidebar-field:last-child {
    margin-bottom: 0;
}

.sidebar-textarea {
    min-height: 100px;
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.quick-action-btn {
    padding: 0.75rem 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.15s;
    font-size: 0.8rem;
    color: #374151;
}

.quick-action-btn:hover {
    background: #f9fafb;
    border-color: #3b82f6;
    color: #3b82f6;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .erp-main {
        padding: 1rem;
    }

    .erp-page-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .header-actions .btn-erp {
        width: 100%;
        justify-content: center;
    }

    .quick-actions {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
}
/* Additional styles for the items table */
.items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.items-table thead {
    background: var(--erp-gray-50);
    border-bottom: 2px solid var(--erp-gray-200);
}

.items-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--erp-gray-700);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.items-table td {
    padding: 8px 10px;
    vertical-align: middle;
    border-bottom: 1px solid var(--erp-gray-100);
}

.items-table tbody tr:hover {
    background: var(--erp-gray-50);
}

.item-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--erp-gray-300);
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.item-input:focus {
    outline: none;
    border-color: var(--erp-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.item-input.quantity-input {
    text-align: center;
    width: 80px;
}

.item-input.price-input {
    text-align: right;
}

.subtotal-display {
    font-weight: 600;
    color: var(--erp-gray-800);
    text-align: right;
    display: block;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.remove-item-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.total-row {
    background: var(--erp-gray-50);
    font-weight: 600;
}

.total-row td {
    padding: 15px 10px;
    border-top: 2px solid var(--erp-gray-300);
}

.text-right {
    text-align: right;
}

.item-count {
    font-size: 0.8rem;
    color: var(--erp-gray-500);
    margin-left: 10px;
    font-weight: 400;
}

.table-responsive {
    overflow-x: auto;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--erp-gray-500);
}

.empty-state i {
    font-size: 3rem;
    color: var(--erp-gray-300);
    margin-bottom: 10px;
}

.empty-state p {
    margin: 0;
    font-size: 1rem;
}

/* Validation styles */
.item-input.is-invalid {
    border-color: #ef4444;
}

.item-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-error {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .items-table {
        font-size: 0.8rem;
    }
    
    .items-table th,
    .items-table td {
        padding: 6px 5px;
    }
    
    .item-input.quantity-input {
        width: 60px;
    }
}