/* =========================
   SofaFlow Design System
   ========================= */

/* --- Base --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #212529;
}

.main-content {
    min-height: calc(100vh - 160px);
    padding-top: 24px;
    padding-bottom: 32px;
}

/* --- Navbar --- */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-dark .nav-link.active,
.navbar-dark .nav-link:hover {
    color: #fff !important;
    opacity: 1;
}

.navbar-dark .nav-link {
    color: rgba(255,255,255,.75);
    transition: color 0.15s ease-in-out;
}

/* --- Cards --- */
.card {
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.25rem;
    border-radius: 0.5rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0.875rem 1.25rem;
}

.card-header h5,
.card-header h6 {
    margin-bottom: 0;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* --- Buttons --- */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn-group .btn + .btn,
.btn + .btn {
    margin-left: 0.25rem;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

/* Action button group in sidebar cards */
.card-body .d-grid .btn {
    text-align: left;
    padding: 0.625rem 1rem;
}

.card-body .d-grid .btn i {
    margin-right: 0.375rem;
}

/* --- Tables --- */
.table {
    margin-bottom: 0;
}

.table thead th {
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    border-bottom-width: 2px;
    padding: 0.75rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.035);
}

/* --- Alerts --- */
.alert {
    border: none;
    border-radius: 0.375rem;
}

/* --- Links --- */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Badges --- */
.badge {
    padding: 0.4em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* --- Forms --- */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
    color: #495057;
}

.form-control,
.form-select {
    border-radius: 0.375rem;
    border-color: #ced4da;
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.2);
}

/* --- Page Headers --- */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* --- Definition Lists (detail pages) --- */
dl.row dt {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.875rem;
}

dl.row dd {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

/* --- Footer --- */
footer {
    border-top: 1px solid #dee2e6;
    margin-top: auto;
}

footer p {
    margin-bottom: 0;
}

/* --- Stats Cards (Dashboard) --- */
.stats-card .card-body {
    padding: 1.25rem;
}

.stats-card .card-title {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.stats-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0;
}

/* --- Text utilities --- */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Timeline (Order View) --- */
.timeline-content h6 {
    font-weight: 600;
    margin-bottom: 0.375rem;
}

/* --- Item acceptance (Handover) --- */
.item-acceptance-table .form-select {
    min-width: 100px;
}

.item-acceptance-table .accepted-qty {
    max-width: 80px;
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .main-content {
        padding-top: 16px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .card-body {
        padding: 1rem;
    }

    .table thead th {
        font-size: 0.75rem;
    }

    .btn-group-sm .btn {
        padding: 0.2rem 0.4rem;
    }
}
