/* Official Theme for Sbuyzone Stock Management System */
/* สไตล์ทางการที่อ่านง่าย สะอาดตา เหมาะสำหรับองค์กร */

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

body {
    font-family: 'Sarabun', 'Segoe UI', Tahoma, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

.container {
    padding: 30px 15px;
}

/* Card Styles */
.card {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.card-header {
    background: #ffffff;
    border-bottom: 2px solid #0066cc;
    padding: 20px 30px;
}

.card-header h3,
.card-header h4 {
    color: #1a1a1a;
    font-weight: 600;
    font-size: 24px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header h3 i,
.card-header h4 i {
    color: #0066cc;
    font-size: 26px;
}

.card-body {
    padding: 30px;
}

/* Dashboard Header */
.dashboard-header {
    background: #ffffff;
    padding: 20px 30px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e1e8ed;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h3 {
    color: #1a1a1a;
    font-weight: 600;
    font-size: 24px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-header h3 i {
    color: #0066cc;
}

/* Summary Cards */
.summary-card {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.summary-card .icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}

.summary-card .icon.blue {
    background: #e3f2fd;
    color: #0066cc;
}

.summary-card .icon.green {
    background: #e8f5e9;
    color: #2e7d32;
}

.summary-card .icon.orange {
    background: #fff3e0;
    color: #f57c00;
}

.summary-card .icon.red {
    background: #ffebee;
    color: #c62828;
}

.summary-card h6 {
    color: #666;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.summary-card .value {
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 700;
}

/* Form Elements */
.form-label {
    color: #333333;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.text-danger {
    color: #dc3545 !important;
}

.form-control,
.form-select {
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 10px 14px;
    font-weight: 400;
    color: #495057;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    background: #ffffff;
    color: #495057;
    border-color: #0066cc;
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.15);
    outline: none;
}

/* Select2 Styling */
.select2-container--bootstrap-5 .select2-selection {
    background: #ffffff !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    padding: 8px 14px !important;
    min-height: 42px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #495057;
    font-weight: 400;
    line-height: 24px;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #0066cc !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.15) !important;
}

.select2-dropdown {
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.select2-results__option {
    color: #495057;
    font-weight: 400;
    padding: 10px 14px;
}

.select2-results__option--highlighted {
    background: #0066cc !important;
    color: white !important;
}

/* Detail Box */
#lot_details,
.detail-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px;
    padding: 18px 20px !important;
}

#lot_details p,
.detail-box p {
    margin-bottom: 8px;
    color: #495057;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.6;
}

#lot_details p:last-child,
.detail-box p:last-child {
    margin-bottom: 0;
}

#lot_details strong,
.detail-box strong {
    color: #212529;
    font-weight: 600;
}

#lot_details .text-primary,
.detail-box .text-primary {
    color: #0066cc !important;
    font-weight: 600;
    font-size: 16px;
}

/* Divider */
hr {
    border: none;
    height: 1px;
    background: #dee2e6;
    margin: 20px 0;
}

/* Buttons */
.btn-primary {
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    background: #0052a3;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

.btn-primary:active:not(:disabled) {
    background: #004080;
    box-shadow: 0 1px 2px rgba(0, 102, 204, 0.2);
}

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

.btn-primary i {
    font-size: 18px;
}

.btn-success {
    background: #28a745;
    border-color: #28a745;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
    border-color: #1e7e34;
}

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

.btn-danger:hover:not(:disabled) {
    background: #c82333;
    border-color: #bd2130;
}

.btn-warning {
    background: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
    border-color: #d39e00;
    color: #212529;
}

.btn-info {
    background: #17a2b8;
    border-color: #17a2b8;
}

.btn-info:hover:not(:disabled) {
    background: #138496;
    border-color: #117a8b;
}

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

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    border-color: #545b62;
}

/* Tables */
.table {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    padding: 12px;
}

.table tbody td {
    padding: 12px;
    vertical-align: middle;
    color: #495057;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: #f8f9fa;
}

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

/* Badges */
.badge {
    padding: 6px 12px;
    font-weight: 600;
    border-radius: 4px;
}

/* Spinner */
.spinner-border {
    border-color: rgba(255, 255, 255, 0.3);
    border-right-color: white;
}

.spinner-border-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Spacing */
.mb-3 {
    margin-bottom: 18px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px 10px;
    }

    .card-header {
        padding: 16px 20px;
    }

    .card-header h3,
    .card-header h4 {
        font-size: 20px;
    }

    .card-body {
        padding: 20px;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    #lot_details,
    .detail-box {
        padding: 14px 16px !important;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* Alert Styles */
.alert {
    border-radius: 6px;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}
