* {
    box-sizing: border-box;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
    border-radius: 10px 10px 0 0 !important;
}

.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-info,
.card-header.bg-warning {
    color: #fff;
}

.stat-card {
    transition: transform 0.2s;
}

a:hover .stat-card {
    transform: translateY(-3px);
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: 0.3;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}



.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 420px;
    width: 100%;
}

.login-card h3 {
    color: #1a1a2e;
    font-weight: 700;
}

.login-card .logo-icon {
    font-size: 3rem;
    color: #0f3460;
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #6c757d;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.btn-group-sm > .btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
}

.order-detail-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.order-detail-value {
    font-size: 1.1rem;
    font-weight: 500;
    word-wrap: break-word;
}

.doc-list .doc-item {
    padding: 8px 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.doc-list .doc-item:hover {
    background: #f8f9fa;
}

.filter-section {
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.filter-section .row {
    --bs-gutter-y: 8px;
}

/* ===== Password Input with Toggle ===== */
.input-group.password-group {
    position: relative;
}

.input-group.password-group .password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 5;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.1rem;
}

.input-group.password-group .password-toggle:hover {
    color: #333;
}

.input-group.password-group input {
    padding-right: 40px;
}

/* ===== Password Strength Meter ===== */
.strength-meter {
    margin-top: 6px;
}

.strength-meter .strength-bar-track {
    height: 4px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.strength-meter .strength-bar {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-meter .strength-text {
    font-size: 0.75rem;
    margin-top: 2px;
    display: block;
}

.strength-text.bg-danger { color: #dc3545; }
.strength-text.bg-warning { color: #ffc107; }
.strength-text.bg-info { color: #0dcaf0; }
.strength-text.bg-success { color: #198754; }

/* ===== Horizontal Timeline ===== */
.timeline-horizontal {
    display: flex;
    align-items: flex-start;
    overflow-x: auto;
    padding: 10px 0;
    gap: 0;
}

.timeline-horizontal .tl-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    min-width: 80px;
    cursor: default;
}

.timeline-horizontal .tl-item.clickable {
    cursor: pointer;
}

.timeline-horizontal .tl-item.clickable:hover .tl-marker {
    transform: scale(1.2);
}

.timeline-horizontal .tl-marker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #dee2e6;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    z-index: 2;
    position: relative;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.timeline-horizontal .tl-marker.completed {
    background: #198754;
    border-color: #198754;
    color: #fff;
}

.timeline-horizontal .tl-marker.current {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(13,110,253,0.2);
}

.timeline-horizontal .tl-marker.pending {
    background: #fff;
    border-color: #adb5bd;
    color: #adb5bd;
}

.timeline-horizontal .tl-marker.special {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.timeline-horizontal .tl-label {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 6px;
    color: #6c757d;
    max-width: 80px;
    line-height: 1.2;
    word-wrap: break-word;
}

.timeline-horizontal .tl-label.completed {
    color: #198754;
    font-weight: 600;
}

.timeline-horizontal .tl-label.current {
    color: #0d6efd;
    font-weight: 600;
}

.timeline-horizontal .tl-time {
    font-size: 0.6rem;
    color: #adb5bd;
    text-align: center;
    margin-top: 2px;
}

.timeline-horizontal .tl-connector {
    flex: 1;
    min-width: 20px;
    height: 3px;
    background: #dee2e6;
    align-self: center;
    margin-bottom: 18px;
}

.timeline-horizontal .tl-connector.completed {
    background: #198754;
}

.timeline-horizontal.timeline-hold {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px;
    opacity: 0.7;
    pointer-events: none;
}

.timeline-horizontal.timeline-cancelled {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 12px;
    opacity: 0.7;
    pointer-events: none;
}

/* ===== Validation Styles ===== */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.input-group.password-group .form-control.is-invalid {
    background-position: right 40px center;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #dc3545;
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: #198754;
}

/* ===== RESPONSIVE OVERRIDES ===== */

@media (max-width: 575.98px) {
    .login-card {
        padding: 1.5rem;
        margin: 10px;
    }

    .login-card h3 {
        font-size: 1.3rem;
    }

    .stat-card .stat-number {
        font-size: 1.3rem;
    }

    .stat-card .stat-label {
        font-size: 0.7rem;
    }

    .stat-card .stat-icon {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .card-header {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .table td, .table th {
        padding: 0.4rem 0.5rem;
    }

    .order-detail-value {
        font-size: 0.95rem;
    }

    .filter-section {
        padding: 10px;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.35rem 0.65rem;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .timeline-content {
        padding: 8px 12px;
    }

    .timeline-content .status-label {
        font-size: 0.85rem;
    }

    .doc-list .doc-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .doc-list .doc-item a {
        align-self: flex-end;
    }

    h4 {
        font-size: 1.15rem;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .stat-card .stat-number {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }
}

@media (max-width: 767.98px) {
    .navbar .navbar-nav .nav-link {
        padding-left: 0.5rem;
    }

    .table-responsive {
        border: 0;
        margin-bottom: 0;
    }

    .order-detail-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 991.98px) {
    .row > [class*="col-"] {
        margin-bottom: 12px;
    }

    .filter-section .btn {
        width: 100%;
    }
}

@media print {
    .navbar, .btn, form, .filter-section {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .card-body {
        padding: 1rem;
    }
}
