/* Shared styles across all pages */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
}

/* COMMON LAYOUT */
.content {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.page-section {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-title {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.page-description {
    color: #7f8c8d;
    line-height: 1.6;
    margin-top: 10px;
}

/* === TABLE STYLES === */
table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

table th {
    background-color: #ecf0f1;
    padding: 12px;
    text-align: left;
    color: #2c3e50;
    font-weight: 600;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

table tr:hover {
    background-color: #f8f9fa;
}

.data-table,
.config-table,
.form-table,
.material-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-table th,
.config-table th,
.form-table th,
.material-table th {
    background-color: #2c3e50;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #1a252f;
}

.data-table td,
.config-table td,
.form-table td,
.material-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
    font-size: 14px;
    color: #495057;
}

.data-table tr:hover,
.config-table tr:hover,
.form-table tr:hover,
.material-table tr:hover {
    background-color: #f8f9fa;
}

.data-table tr:last-child td,
.config-table tr:last-child td,
.form-table tr:last-child td,
.material-table tr:last-child td {
    border-bottom: none;
}

/* === BUTTON STYLES === */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn:hover:not(:disabled) {
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-success {
    background-color: #2ecc71;
    color: white;
}

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

.btn-small {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-enable {
    background-color: #2ecc71;
    color: white;
}

.btn-disable {
    background-color: #e74c3c;
    color: white;
}

.btn-sync {
    background-color: #17a2b8;
    color: white;
}

.btn-sync:hover {
    background-color: #138496;
}

/* === FORM STYLES === */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    background-color: white;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control-static {
    background-color: #f8f9fa;
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    min-height: 42px;
    display: flex;
    align-items: center;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* === MODAL STYLES === */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content.card {
    max-width: 600px;
    width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

.modal-footer {
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    margin-top: 20px;
    text-align: right;
}

/* === BADGE STYLES === */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
    text-align: center;
    min-width: 60px;
}

.status-active {
    background-color: #2ecc71;
    color: white;
}

.status-inactive {
    background-color: #e74c3c;
    color: white;
}

.status-draft {
    background-color: #f39c12;
    color: white;
}

.type-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    min-width: 60px;
}

.type-material {
    background-color: #95a5a6;
    color: white;
}

.type-craft {
    background-color: #95a5a6;
    color: white;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 15px 0;
}

.page-btn {
    padding: 8px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    min-width: 80px;
}

.page-btn:hover:not(:disabled) {
    background-color: #2980b9;
}

.page-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* === LOADING STATES === */
.loading-state, .error-state, .empty-state {
    padding: 40px;
    text-align: center;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 16px;
}

.loading-state {
    background-color: #f8f9fa;
    color: #7f8c8d;
    border: 1px dashed #dee2e6;
}

.error-state {
    background-color: #fdf2f2;
    color: #e74c3c;
    border: 1px solid #f5c6cb;
}

.empty-state {
    background-color: #f8f9fa;
    color: #7f8c8d;
    border: 1px dashed #dee2e6;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .content {
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .data-table,
    .config-table,
    .form-table,
    .material-table {
        display: block;
        overflow-x: auto;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
}