* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f7fb;
    color: #1f2937;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #eef4fb;
}

.login-card {
    width: 400px;
    background: white;
    padding: 35px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.login-card h1 {
    margin: 0;
    color: #0f5f9f;
}

.login-card p {
    margin-bottom: 25px;
    color: #6b7280;
}

label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
}

input {
    width: 100%;
    padding: 11px;
    margin-top: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

button {
    width: 100%;
    margin-top: 22px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #0f5f9f;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

button:hover {
    background: #0b4d82;
}

.error {
    padding: 10px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    margin-bottom: 15px;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 245px;
    height: 100vh;
    background: #0f172a;
    color: white;
    padding: 20px;
}

.brand h2 {
    margin: 0;
    color: white;
}

.brand p {
    margin-top: 5px;
    color: #94a3b8;
}

.sidebar a {
    display: block;
    color: #cbd5e1;
    text-decoration: none;
    padding: 12px 10px;
    margin-top: 6px;
    border-radius: 8px;
}

.sidebar a:hover {
    background: #1e293b;
    color: white;
}

.sidebar-footer {
    position: absolute;
    bottom: 20px;
    color: #94a3b8;
}

.main-content {
    margin-left: 245px;
    padding: 25px;
}

.topbar {
    background: white;
    padding: 18px 22px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.topbar h2 {
    margin: 0;
}

.topbar span {
    color: #64748b;
}

.user-info a {
    margin-left: 15px;
    color: #0f5f9f;
    text-decoration: none;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.card {
    background: white;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.card h3 {
    margin: 0;
    color: #64748b;
    font-size: 15px;
}

.card p {
    font-size: 36px;
    font-weight: bold;
    margin: 12px 0 0;
    color: #0f5f9f;
}

.panel {
    background: white;
    padding: 25px;
    margin-top: 25px;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.page-header {
    background: white;
    padding: 22px;
    border-radius: 14px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.page-header h2 {
    margin: 0;
}

.page-header p {
    margin: 6px 0 0;
    color: #64748b;
}

.btn-primary {
    background: #0f5f9f;
    color: white;
    padding: 11px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
}

.btn-primary:hover {
    background: #0b4d82;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    background: #f1f5f9;
    padding: 12px;
    color: #475569;
    font-size: 14px;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.data-table tr:hover {
    background: #f8fafc;
}

.btn-secondary {
    background: #e2e8f0;
    color: #1e293b;
    padding: 11px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
}

.modern-form label {
    margin-top: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

select,
textarea {
    width: 100%;
    padding: 11px;
    margin-top: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: Arial, sans-serif;
}

textarea {
    min-height: 100px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table th {
    width: 35%;
    text-align: left;
    color: #64748b;
    padding: 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.detail-table td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.timeline-item {
    border-left: 4px solid #0f5f9f;
    padding: 10px 15px;
    margin-bottom: 15px;
    background: #f8fafc;
    border-radius: 8px;
}

.timeline-item span {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-top: 4px;
}

.timeline-item p {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.chart-grid .panel {
    min-height: 340px;
}

.chart-container {
    width: 100%;
    height: 280px;
    position: relative;
}

.chart-container canvas {
    max-height: 280px !important;
}

.card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    transition: .2s;
}

.card h3 {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
}

.card p {
    font-size: 38px;
    font-weight: 700;
    color: #0f5f9f;
    margin: 0;
}

.dashboard-link {
    text-decoration: none;
    color: inherit;
}

.dashboard-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
}

@media (max-width: 1400px) {

    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .chart-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 900px) {

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

}

.asset-header {
    align-items: center;
}

.asset-label {
    font-size: 13px;
    color: #64748b;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px;
}

.asset-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.asset-actions .btn-primary,
.asset-actions .btn-secondary {
    width: auto !important;
    margin-top: 0 !important;
    white-space: nowrap;
}

.asset-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.asset-actions {
    display: flex !important;
    align-items: center;
    gap: 22px !important;
}

.asset-actions a {
    width: auto !important;
    min-width: 160px;
    text-align: center;
    margin: 0 !important;
    display: inline-block;
}

.asset-actions .btn-secondary {
    min-width: 90px;
}

.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
}
.status-active {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-pmdue {
    background: #fef3c7;
    color: #92400e;
}

.status-repair {
    background: #fee2e2;
    color: #991b1b;
}

.status-out {
    background: #fecaca;
    color: #7f1d1d;
}

.status-retired {
    background: #e5e7eb;
    color: #374151;
}

.search-input {
    width: 260px;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin: 0;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-bar .filter-btn {
    width: auto !important;
    min-width: 120px;
    padding: 10px 18px;
    display: inline-block !important;

    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 8px;

    font-weight: 600;
    cursor: pointer;
}

.filter-bar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-bar .filter-btn {
    width: auto !important;
    margin-top: 0 !important;
    min-width: 120px;
    padding: 10px 18px;
    display: inline-flex !important;
    justify-content: center;
    align-items: center;

    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #334155;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.filter-bar .filter-btn:hover {
    background: #f1f5f9;
}

.wo-status-badge {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.wo-open {
    background: #dbeafe;
    color: #1d4ed8;
}

.wo-assigned {
    background: #e0f2fe;
    color: #0369a1;
}

.wo-progress {
    background: #fef3c7;
    color: #92400e;
}

.wo-waiting {
    background: #ffedd5;
    color: #9a3412;
}

.wo-completed {
    background: #dcfce7;
    color: #166534;
}

.wo-closed {
    background: #e5e7eb;
    color: #374151;
}

.wo-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.notification-link {
    text-decoration: none;
    font-size: 22px;
    margin-right: 18px;
}

.notification-item {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.notification-item h3 {
    margin: 0 0 6px;
}

.notification-item p {
    margin: 0 0 6px;
    color: #475569;
}

.notification-item.unread {
    background: #eff6ff;
    border-left: 4px solid #0f5f9f;
}

.notification-link {
    position: relative;
    text-decoration: none;
    font-size: 22px;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -10px;

    background: #ef4444;
    color: white;

    border-radius: 999px;

    min-width: 18px;
    height: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 11px;
    font-weight: bold;
}

.dashboard-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.dashboard-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
}

.card p {
    white-space: nowrap;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
}

.calendar-table th {
    background: #f1f5f9;
    padding: 12px;
    color: #475569;
}

.calendar-table td {
    width: 14.28%;
    height: 130px;
    vertical-align: top;
    border: 1px solid #e5e7eb;
    padding: 8px;
    background: white;
}

.empty-day {
    background: #f8fafc !important;
}

.calendar-day strong {
    display: block;
    margin-bottom: 6px;
    color: #1f2937;
}

.calendar-event {
    font-size: 12px;
    padding: 5px 7px;
    border-radius: 6px;
    margin-top: 5px;
}

.event-pm {
    background: #fef3c7;
    color: #92400e;
}

.event-wo {
    background: #dbeafe;
    color: #1d4ed8;
}

.cost-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.cost-grid .card {
    min-width: 0;
}

.cost-grid .card p {
    font-size: 30px;
    white-space: normal;
    word-break: break-word;
}

@media (max-width: 1100px) {
    .cost-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .cost-grid {
        grid-template-columns: 1fr;
    }
}

.history-panel {
    min-height: 120px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.wo-cost-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
    gap: 18px !important;
}

.wo-cost-card {
    width: auto !important;
    min-height: 120px;
}

.wo-cost-card p {
    font-size: 32px !important;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .wo-cost-grid {
        grid-template-columns: 1fr !important;
    }
}

.wo-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(360px, 1fr));
    gap: 22px;
    margin-bottom: 25px;
}

.wo-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(300px, 420px));
    gap: 22px;
    margin-bottom: 25px;
}

.wo-detail-grid .panel,
.wo-action-grid .panel {
    width: 100%;
}

@media (max-width: 900px) {
    .wo-detail-grid,
    .wo-action-grid {
        grid-template-columns: 1fr;
    }
}

.test-equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(320px,1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.test-equipment-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.test-equipment-card:hover {
    border-color: #1f64a6;
}

.test-equipment-card input[type="checkbox"] {
    margin-top: 4px;
}

.no-print {
    display: block;
}

@media print {
    .no-print {
        display: none;
    }
}

.btn-report {
    display:inline-block;
    padding:12px 24px;
    background:#1f64a6;
    color:#fff;
    text-decoration:none;
    border-radius:6px;
    font-weight:600;
}

.equipment-detail-grid {
    align-items: start;
}

.equipment-detail-grid .panel {
    height: auto;
    min-height: unset;
}

.equipment-info-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr 1.1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 25px;
}

.equipment-info-grid .panel {
    height: auto !important;
    min-height: 0 !important;
    padding: 22px;
}

.equipment-info-grid .detail-table th {
    width: 38%;
}

.equipment-info-grid .detail-table td {
    width: 62%;
}

@media (max-width: 1400px) {
    .equipment-info-grid {
        grid-template-columns: 1fr;
    }
}


.btn-info:hover {
    background: #138496;
}

.btn-info {
    display:inline-block;
    background:#17a2b8;
    color:white;
    padding:10px 16px;
    border-radius:8px;
    text-decoration:none;
    font-weight:600;
}

.btn-info:hover {
    background:#138496;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 1000px;
}

.facility-table {
    min-width: 1200px;
}

.facility-table th:last-child,
.facility-table td:last-child {
    width: 320px;
    min-width: 320px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.action-buttons a {
    white-space: nowrap;
    padding: 9px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

.search-form input {
    width: 300px;
    padding: 10px 14px;
    border: 1px solid #d0d7e2;
    border-radius: 8px;
    font-size: 14px;
}

.age-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
}

.age-good {
    background: #dcfce7;
    color: #166534;
}

.age-warning {
    background: #fef3c7;
    color: #92400e;
}

.age-danger {
    background: #fee2e2;
    color: #991b1b;
}