body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f6f9;
    color: #333;
}

.custom-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.custom-navbar .navbar-brand {
    color: #2c3e50;
    font-size: 1.4rem;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card.no-hover-lift:hover {
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-primary {
    background-color: #4361ee;
    border-color: #4361ee;
}

.btn-primary:hover {
    background-color: #3a56d4;
    border-color: #3a56d4;
}

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

.status-badge {
    font-size: 0.85rem;
    font-weight: 500;
}

.task-list-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

/* Glassmorphism for modals */
.modal-content {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.time-display {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    font-family: monospace;
}

.card-title {
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.table th,
.table td {
    word-break: keep-all;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

.eq-expanded-panel {
    background: #fff;
    border-color: #dce2ea !important;
}

.eq-expanded-head {
    background: #f8fafc;
}

.eq-head-main {
    min-width: 0;
}

.eq-head-content {
    min-width: 0;
}

.eq-toggle-btn {
    flex: 0 0 auto;
    align-self: center;
}

.manager-main-wrap {
    max-width: 1680px;
    margin: 0 auto;
    padding: 0 10px;
}

.manager-form-wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 10px;
}

.eq-id-link {
    color: #3d57e0;
    font-size: 0.95rem;
    line-height: 1;
}

.eq-expanded-meta {
    border-top: 1px solid #e8edf3;
}

.eq-expanded-body {
    background: #fbfcfe;
}

.eq-schedule-line {
    font-size: 0.72rem !important;
    line-height: 1.25;
}

.eq-schedule-line .text-secondary,
.eq-schedule-line .fw-semibold {
    font-size: 0.72rem;
}

.eq-progress {
    height: 8px;
    border-radius: 999px;
    background: #e9edf4;
}

.eq-progress .progress-bar {
    background-color: #4962e7;
}

.eq-state-item {
    border: 1px solid #e2e7ef;
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
}

.eq-state-item.in-progress {
    border-left: 4px solid #2e7dff;
}

.eq-state-item.waiting {
    border-left: 4px solid #f4a62a;
}

.eq-state-item.completed {
    border-left: 4px solid #3ca56c;
}

.shipped-year-body {
    font-size: 0.7rem;
}

.shipped-year-table th,
.shipped-year-table td {
    font-size: 0.7rem;
}

.shipped-year-table .btn {
    font-size: 0.7rem !important;
}

.restock-table th,
.restock-table td {
    font-size: 0.7rem;
}

.restock-table .btn {
    font-size: 0.7rem !important;
}

.paused-eq-id {
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    .paused-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .paused-toolbar h2 {
        font-size: 1.25rem;
    }

    .paused-back-btn {
        width: 100%;
        min-height: 44px;
    }

    .paused-eq-btn {
        align-items: flex-start;
        font-size: 1rem !important;
        line-height: 1.35;
        padding-top: 0.85rem !important;
        padding-bottom: 0.85rem !important;
    }

    .paused-eq-btn .paused-count-badge {
        font-size: 0.8rem !important;
        margin-top: 2px;
    }

    .paused-task-col .card-body {
        padding: 0.9rem;
    }

    .paused-task-col .btn {
        min-height: 44px;
    }
}

.worker-main-wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 10px;
}

.worker-eq-title {
    overflow-wrap: anywhere;
}

.rental-main-wrap {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 6px 20px;
}

.rental-hero {
    background: linear-gradient(160deg, #fff8e8 0%, #f9fbff 58%, #eef8f2 100%);
    border: 1px solid rgba(212, 221, 235, 0.95);
    border-radius: 22px;
    padding: 1rem;
}

.rental-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #7c5c10;
}

.rental-title {
    font-size: 1.35rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #17324d;
}

.rental-lead {
    color: #53657a;
    font-size: 0.9rem;
    line-height: 1.5;
}

.rental-search-card,
.rental-result-card,
.rental-history-card,
.rental-saved-card {
    border: 1px solid #e3eaf3;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
}

.rental-search-card {
    position: sticky;
    top: 64px;
    z-index: 10;
}

.rental-search-input,
.rental-form-control {
    border-radius: 14px;
    border: 1px solid #d3deea;
    min-height: 50px;
    font-size: 1rem;
}

.rental-search-input:focus,
.rental-form-control:focus {
    border-color: #ffb648;
    box-shadow: 0 0 0 0.2rem rgba(255, 182, 72, 0.2);
}

.rental-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #f59f00 0%, #ffb648 100%);
    border: none;
    color: #1f2933;
    font-weight: 700;
    min-height: 52px;
    font-size: 1rem;
    white-space: nowrap;
    word-break: keep-all;
}

.rental-submit-btn:hover {
    color: #1f2933;
    background: linear-gradient(135deg, #e69000 0%, #ffaa28 100%);
}

.rental-eq-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

.rental-meta-box {
    border-radius: 14px;
    background: #f7faff;
    border: 1px solid #e1e9f5;
    padding: 0.85rem 0.95rem;
}

.rental-meta-label {
    font-size: 0.72rem;
    color: #6c7d90;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.rental-meta-value {
    font-size: 1rem;
    color: #19324b;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.rental-photo-preview,
.rental-photo-display {
    width: 100%;
    max-height: 240px;
    border-radius: 16px;
    object-fit: cover;
    background: #eef3f8;
    border: 1px solid #d8e1ec;
}

.rental-photo-zoomable {
    cursor: zoom-in;
}

.rental-photo-modal-content {
    background: rgba(245, 248, 252, 0.98);
}

.rental-photo-modal-image {
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 16px;
    background: #eef3f8;
}

.rental-empty-preview {
    border: 1px dashed #c9d5e2;
    border-radius: 16px;
    background: #f8fbff;
    color: #6f8094;
    min-height: 120px;
    font-size: 0.92rem;
}

.rental-history-list {
    display: grid;
    gap: 0.85rem;
}

.rental-history-time {
    font-size: 0.76rem;
    color: #6b7a88;
    white-space: nowrap;
}

@media (min-width: 769px) {
    .rental-main-wrap {
        max-width: 860px;
        padding: 0 10px 28px;
    }

    .rental-hero {
        border-radius: 24px;
        padding: 1.35rem;
    }

    .rental-title {
        font-size: 1.8rem;
    }

    .rental-lead {
        font-size: 0.98rem;
    }

    .rental-eq-meta {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .rental-search-card {
        top: 78px;
    }

    .rental-photo-preview,
    .rental-photo-display {
        max-height: 320px;
    }

    .rental-photo-modal-image {
        max-height: 82vh;
    }
}

@media (max-width: 768px) {
    .worker-main-wrap {
        padding: 0 4px;
    }

    .worker-user-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    .worker-user-name {
        font-size: 1.2rem;
    }

    .rental-main-wrap {
        padding: 0 2px 16px;
    }

    .rental-hero {
        margin-left: -2px;
        margin-right: -2px;
        border-radius: 18px;
    }

    .rental-search-card,
    .rental-result-card,
    .rental-history-card,
    .rental-saved-card {
        border-radius: 18px;
    }

    .rental-search-card .card-body,
    .rental-result-card .card-body,
    .rental-history-card .card-body,
    .rental-saved-card .card-body {
        padding: 0.95rem !important;
    }

    .rental-title {
        font-size: 1.28rem;
    }

    .rental-lead {
        font-size: 0.88rem;
    }

    .rental-history-time {
        white-space: normal;
    }

    .rental-photo-preview,
    .rental-photo-display {
        max-height: 220px;
    }

    .rental-photo-modal-image {
        max-height: 68vh;
    }

    .worker-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .worker-toolbar h3 {
        font-size: 1.3rem;
    }

    .worker-toolbar-actions {
        flex-direction: column;
        width: 100%;
    }

    .worker-toolbar-actions .btn {
        width: 100%;
        min-height: 44px;
    }

    .worker-task-body {
        padding: 0.9rem;
    }

    .worker-eq-title {
        font-size: 1rem;
    }

    .worker-task-name {
        font-size: 0.95rem;
    }

    .task-action-row {
        flex-direction: column;
    }

    .task-action-row form,
    .task-action-row .w-50,
    .task-action-row .w-100,
    .task-action-row button {
        width: 100% !important;
        min-height: 44px;
    }

    #selectTaskModal .accordion-button {
        font-size: 0.95rem;
    }

    #selectTaskModal .list-group-item {
        padding: 0.75rem 0.8rem;
    }
}

/* Task detail mobile optimization */
.task-detail-wrap {
    max-width: 1280px;
    margin: 0 auto;
}

.task-detail-history-table td,
.task-detail-history-table th {
    white-space: nowrap;
}

@media (max-width: 1024px) {
    .task-detail-wrap {
        max-width: 100%;
    }

    .task-detail-nav-btn {
        font-size: 1rem !important;
    }

    .task-detail-action-btn {
        font-size: 1.05rem !important;
    }
}

@media (max-width: 768px) {
    .task-detail-topbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .task-detail-nav-btn {
        width: 100%;
        min-height: 44px;
        font-size: 1rem !important;
        padding: 0.6rem 0.9rem !important;
    }

    .task-detail-header {
        padding: 0.95rem !important;
    }

    .task-detail-header > div {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }

    .task-detail-title {
        font-size: 1.2rem;
    }

    .task-detail-status {
        font-size: 0.78rem !important;
        padding: 0.45rem 0.7rem !important;
    }

    .task-detail-body {
        padding: 1rem !important;
    }

    .task-detail-summary-box {
        padding: 0.85rem !important;
        border-radius: 12px !important;
    }

    .task-detail-summary-item {
        border-right: 0 !important;
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 0.6rem;
        margin-bottom: 0.6rem;
    }

    .task-detail-summary-item:last-child {
        border-bottom: 0;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .task-detail-time-line {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px;
    }

    .task-detail-actions {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .task-detail-actions form,
    .task-detail-actions button,
    .task-detail-action-btn {
        width: 100% !important;
        min-height: 44px;
        font-size: 1rem !important;
    }

    .task-detail-guide ul {
        padding-left: 1rem;
    }

    .task-detail-history-table {
        border: 0;
        background: transparent;
    }

    .task-detail-history-table thead {
        display: none;
    }

    .task-detail-history-table,
    .task-detail-history-table tbody,
    .task-detail-history-table tr,
    .task-detail-history-table td {
        display: block;
        width: 100%;
    }

    .task-detail-history-table tr {
        border: 1px solid #e6eaf0;
        border-radius: 10px;
        background: #fff;
        margin-bottom: 10px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }

    .task-detail-history-table th,
    .task-detail-history-table td {
        padding: 0.45rem 0.65rem;
        white-space: normal;
        text-align: left;
        border: 0;
        border-bottom: 1px dashed #eef2f6;
    }

    .task-detail-history-table tr td:last-child {
        border-bottom: 0;
    }

    .task-detail-history-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        color: #6c757d;
        margin-bottom: 2px;
        font-weight: 600;
    }
}