/* Supplier Management - Frontend Styles */

.sm-frontend-container {
    max-width: 1200px;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Tabs */
.sm-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.sm-tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.sm-tab-btn:hover {
    color: #333;
}

.sm-tab-btn.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
}

.sm-tab-content {
    display: none;
}

.sm-tab-content.active {
    display: block;
}

/* Header */
.sm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sm-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

/* Buttons */
.sm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.sm-btn-primary {
    background: #2271b1;
    color: white;
}

.sm-btn-primary:hover {
    background: #135e96;
}

.sm-btn-secondary {
    background: #f0f0f1;
    color: #2c3338;
}

.sm-btn-secondary:hover {
    background: #dcdcde;
}

.sm-btn-danger {
    background: #dc3545;
    color: white;
}

.sm-btn-danger:hover {
    background: #c82333;
}

.sm-btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Table */
.sm-table-container {
    overflow-x: auto;
}

.sm-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.sm-table thead {
    background: #f0f0f1;
}

.sm-table th,
.sm-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.sm-table th {
    font-weight: 600;
    color: #2c3338;
}

.sm-table tbody tr:hover {
    background: #f9f9f9;
}

.sm-table td button {
    margin-right: 5px;
}

/* Search Box */
.sm-search-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.sm-search-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.sm-search-box select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Summary Cards */
.sm-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.sm-summary-card {
    padding: 20px;
    border-radius: 4px;
    background: #f0f0f1;
    text-align: center;
}

.sm-summary-card.sm-success {
    background: #d3f9d8;
}

.sm-summary-card.sm-danger {
    background: #ffe3e3;
}

.sm-summary-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.sm-summary-value {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

/* Badges */
.sm-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #6c757d;
    color: white;
}

.sm-badge-success {
    background: #28a745;
}

.sm-best-price {
    background: #d3f9d8 !important;
}

/* Modal */
.sm-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.sm-modal-content {
    background-color: #fff;
    margin: 50px auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.sm-modal-small {
    max-width: 500px;
}

.sm-modal-close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    line-height: 20px;
}

.sm-modal-close:hover {
    color: #333;
}

/* Form */
.sm-form-group {
    margin-bottom: 20px;
}

.sm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3338;
}

.sm-form-group input,
.sm-form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.sm-form-group input:focus,
.sm-form-group select:focus {
    border-color: #2271b1;
    outline: none;
}

/* Item Row */
.sm-item-row {
    display: grid;
    grid-template-columns: 1fr 200px 40px;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.sm-item-row input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Message */
#sm-message {
    margin-bottom: 15px;
}

.sm-message-success {
    padding: 12px;
    background: #d3f9d8;
    border-left: 4px solid #28a745;
    border-radius: 4px;
}

.sm-message-error {
    padding: 12px;
    background: #ffe3e3;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .sm-frontend-container {
        padding: 15px;
    }
    
    .sm-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .sm-item-row {
        grid-template-columns: 1fr;
    }
    
    .sm-summary-cards {
        grid-template-columns: 1fr;
    }
    
    .sm-table {
        font-size: 13px;
    }
    
    .sm-table th,
    .sm-table td {
        padding: 8px;
    }
}
