/* ============================================================
   ERP Pabrik Seragam — Custom Styles
   ============================================================ */

:root {
    --primary:        #8B0000;   /* dark red */
    --primary-dark:   #6B0000;
    --primary-light:  #A52020;
    --primary-rgb:    139, 0, 0;
    --accent:         #C0392B;
    --sidebar-width:  240px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f7f3f3;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- NAVBAR ---- */
.navbar-brand {
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.navbar.bg-darkred {
    background-color: var(--primary) !important;
}

/* Override Bootstrap bg-primary to dark red */
.bg-primary { background-color: var(--primary) !important; }
.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary-dark) !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}
.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}
.btn-outline-primary:hover {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
.text-primary { color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }
.badge.bg-primary { background-color: var(--primary) !important; }

/* Active nav link */
.navbar-dark .navbar-nav .nav-link.active,
.navbar-dark .navbar-nav .nav-link:hover {
    color: #fff !important;
    background-color: rgba(255,255,255,0.12);
    border-radius: 0.4rem;
}

/* ---- CARDS ---- */
.card {
    border: none;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    border-radius: 0.75rem;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    font-weight: 600;
}

/* ---- STAT CARDS ---- */
.stat-card {
    border-radius: 0.75rem;
    padding: 1.25rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card.bg-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%) !important;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.25;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 0.25rem;
}

/* ---- STEP PROGRESS ---- */
.step-progress {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 70px;
    position: relative;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #dee2e6;
    z-index: 0;
}

.step-item.done:not(:last-child)::after {
    background: #198754;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    z-index: 1;
    border: 2px solid #dee2e6;
    background: #fff;
    color: #adb5bd;
}

.step-item.done .step-circle {
    background: #198754;
    border-color: #198754;
    color: #fff;
}

.step-item.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.2);
}

.step-label {
    font-size: 0.65rem;
    text-align: center;
    margin-top: 4px;
    color: #6c757d;
    max-width: 70px;
    line-height: 1.2;
}

.step-item.done .step-label,
.step-item.active .step-label {
    color: #212529;
    font-weight: 600;
}

/* ---- TABLES ---- */
.table th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    font-weight: 600;
    border-top: none;
}

.table-hover tbody tr:hover {
    background-color: rgba(var(--primary-rgb), 0.04);
}

/* ---- BADGES ---- */
.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ---- FORMS ---- */
.form-label {
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(var(--primary-rgb), 0.5);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.15);
}

/* ---- BUTTONS ---- */
.btn {
    font-weight: 500;
    border-radius: 0.5rem;
}

.btn-sm {
    font-size: 0.8rem;
}

/* ---- NOTIFIKASI DROPDOWN ---- */
.notif-dropdown .notif-item {
    white-space: normal;
    border-bottom: 1px solid #f0f0f0;
    padding: 0.6rem 1rem;
}

.notif-dropdown .notif-item:hover {
    background: #fdf5f5;
}

/* ---- PROGRESS BAR ---- */
.progress {
    border-radius: 1rem;
    height: 8px;
}

.progress-bar.bg-primary {
    background-color: var(--primary) !important;
}

/* ---- PROJEK CARD ---- */
.projek-card {
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.projek-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.15);
}

/* ---- FOOTER ---- */
.footer {
    margin-top: auto;
    border-top: 2px solid rgba(var(--primary-rgb), 0.15) !important;
}

/* ---- ALERT LINK ---- */
.alert-link { color: var(--primary); }

/* ---- DROPDOWN ACTIVE ---- */
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--primary);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 576px) {
    .stat-card .stat-value { font-size: 1.4rem; }
    .step-label { font-size: 0.6rem; }
    .table-responsive { font-size: 0.85rem; }
}

/* ---- PRINT ---- */
@media print {
    .navbar, .footer, .btn, .no-print { display: none !important; }
    .card { box-shadow: none; border: 1px solid #dee2e6; }
}

/* ---- MISC ---- */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #495057;
    border-left: 4px solid var(--primary);
    padding-left: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .border-start-md {
        border-left: 1px solid #dee2e6 !important;
    }
}

/* ---- STEP PANEL TOGGLE ---- */
.card-header[onclick] {
    user-select: none;
}
.card-header[onclick]:hover {
    background-color: rgba(0,0,0,0.03);
}
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 60%, #3d0000 100%);
}

/* ---- NAVBAR BADGE ROLE ---- */
.badge.bg-light.text-primary {
    color: var(--primary) !important;
}
