/* =========================
   Base Layout
========================= */

.at-wrap {
    display: grid;
    gap: 20px;
    max-width: 980px;
    margin: 20px auto;
}

.at-card,
.at-sub-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
    font-family: Arial, sans-serif;
}

/* =========================
   Alerts
========================= */

.at-alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.at-alert-success {
    background: #e9f8ef;
    border: 1px solid #a8e0b8;
    color: #1f6b35;
}

.at-alert-error {
    background: #fdeaea;
    border: 1px solid #f2b0b0;
    color: #8a1f1f;
}

/* =========================
   Vehicle List
========================= */

.at-vehicle-list {
    display: grid;
    gap: 15px;
}

.at-vehicle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fafafa;
}

.at-vehicle-item strong {
    display: inline-block;
    margin-bottom: 4px;
}

/* =========================
   Forms
========================= */

.at-form-grid {
    display: grid;
    gap: 14px;
}

.at-form-grid label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.at-form-grid input,
.at-form-grid select,
.at-form-grid textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    font-family: inherit;
}

.at-form-actions {
    margin-top: 6px;
}

.at-form-grid button,
.at-inline-actions .button,
.at-card .button {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.at-form-grid button:hover,
.at-inline-actions .button:hover,
.at-card .button:hover {
    background: #005f8c;
    color: #fff;
}

/* =========================
   Tables
========================= */

.at-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.at-table th,
.at-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

.at-table th {
    background: #f5f5f5;
}

/* =========================
   Timeline
========================= */

.at-timeline-item {
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

.at-timeline-item:last-child {
    border-bottom: none;
}

.at-receipt-list {
    margin-top: 8px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================
   Health Score
========================= */

.at-health-box {
    background: #f6f9ff;
    border: 1px solid #cfdcff;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    display: inline-flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.at-health-score {
    font-size: 24px;
    font-weight: 700;
}

.at-health-grade {
    font-size: 18px;
    font-weight: 600;
}

/* =========================
   Status
========================= */

.at-status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

.at-status-upcoming {
    background: #e7f3ff;
    color: #0073aa;
}

.at-status-due {
    background: #fff3cd;
    color: #856404;
}

.at-status-overdue {
    background: #f8d7da;
    color: #721c24;
}

.at-status-completed {
    background: #e2f7e2;
    color: #1b5e20;
}

.at-status-unknown {
    background: #eeeeee;
    color: #555;
}

/* =========================
   QR Block
========================= */

.at-qr-block {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    margin: 16px 0;
    flex-wrap: wrap;
}

.at-qr-code {
    width: 140px;
    min-width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.at-qr-code img,
.at-qr-code canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

.at-qr-meta {
    flex: 1;
    min-width: 220px;
}

.at-qr-title {
    margin-bottom: 6px;
}

.at-qr-url {
    font-size: 12px;
    color: #666;
    word-break: break-all;
    margin-top: 8px;
}

/* =========================
   Inline Actions
========================= */

.at-inline-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* =========================
   Paywall
========================= */

.at-locked-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.at-locked-item {
    padding: 14px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fafafa;
    font-weight: 600;
    position: relative;
}

.at-locked-item::after {
    content: "Locked";
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #b42318;
}

.at-paywall-box {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
}

/* =========================
   Print
========================= */

@media print {
    .button,
    form,
    nav,
    header,
    footer,
    .at-alert {
        display: none !important;
    }

    .at-card,
    .at-sub-card,
    .at-qr-block {
        border: 2px solid #000;
        border-radius: 0;
        box-shadow: none;
        page-break-inside: avoid;
    }
}