* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Arial, sans-serif;
    color: #333;
    padding: 30px 20px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Navigation ── */
nav {
    margin-bottom: 24px;
    font-size: 0.9rem;
}

nav a {
    text-decoration: none;
    margin-right: 16px;
}

nav a:hover { text-decoration: underline; }

/* ── Headings ── */
h1 { font-size: 1.6rem; margin-bottom: 6px; }
h2 { font-size: 1.1rem; margin-bottom: 16px; color: #444; }

/* ── Buttons ── */
.btn {
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 5px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    background: #0066cc;
}

.btn:hover { opacity: 0.88; }

.btn-outline {
    background: #fff !important;
    color: #0066cc !important;
    border: 1px solid #0066cc !important;
    padding: 9px 22px;
}

.btn-outline:hover { background: #e8f0fe !important; }

button {
    background: #0066cc;
    color: #fff;
    border: none;
    padding: 9px 22px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
}

button:hover { background: #0052a3; }

.btn-clear {
    background: #e8e8e8 !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
}

.btn-clear:hover { background: #d0d0d0 !important; }

.btn-cancel {
    background: #e8e8e8;
    color: #333;
    border: 1px solid #ccc;
    padding: 11px 28px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    line-height: normal;
}

.btn-cancel:hover { background: #d0d0d0; }

.btn-edit {
    background: none;
    border: 1px solid #0066cc;
    color: #0066cc;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-edit:hover {
    background: #0066cc;
    color: #fff;
}

.btn-delete {
    background: #e8e8e8;
    border: 1px solid #ccc;
    color: #333;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-delete:hover { background: #d0d0d0; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }

label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.required::after { content: ' *'; color: #cc0000; }

input, select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: Arial, sans-serif;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #0066cc;
}

textarea { height: 80px; resize: vertical; }

.hint { font-size: 0.82rem; color: #777; margin-top: 4px; }

.form-actions { display: flex; gap: 12px; margin-top: 6px; }

/* ── Cards ── */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 28px;
    max-width: 560px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.card-with-top-margin { margin-top: 24px; }

/* ── Alerts ── */
.success {
    background: #e6f4ea;
    border: 1px solid #34a853;
    color: #1e7e34;
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.error-msg {
    background: #fdecea;
    border: 1px solid #cc0000;
    color: #cc0000;
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* ── Badges ── */
.badge {
    display: inline-block;
    background: #e8f0fe;
    color: #1a56cc;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: bold;
}

.subcat {
    display: block;
    font-size: 0.82rem;
    color: #555;
    margin-top: 3px;
}

/* ── Table ── */
table {
    width: 100%;
    max-width: 860px;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

thead { background: #0066cc; color: #fff; }

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.9rem;
    font-weight: bold;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
    vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9f9f9; }

.notes-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
}

/* ── History page ── */
.filters {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    max-width: 860px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 180px;
}

.filter-actions { display: flex; gap: 10px; align-items: flex-end; }

.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    max-width: 860px;
}

.no-results {
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    max-width: 860px;
    text-align: center;
    color: #777;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ── Dashboard ── */
.top-actions {
    max-width: 860px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.stat { font-size: 0.9rem; color: #555; }
.stat strong { color: #333; font-size: 1.1rem; }

.vehicles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    max-width: 860px;
}

.vehicle-card {
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    background: #fff;
}

.vehicle-name {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8f0fe;
    text-decoration: none;
    display: block;
    color: #0066cc;
}

.vehicle-name:hover { text-decoration: underline; }

.card-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
}

.card-actions a {
    font-size: 0.85rem;
    text-decoration: none;
    color: #0066cc;
    padding: 5px 0;
}

.card-actions a:hover { text-decoration: underline; }
.card-actions .divider { color: #ccc; line-height: 1.8; }

/* ── Delete dialog ── */
.dialog-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.dialog-overlay.active { display: flex; }

.dialog-box {
    background: #fff;
    border-radius: 8px;
    padding: 28px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    text-align: center;
}

.dialog-box p {
    font-size: 1rem;
    margin-bottom: 22px;
    color: #333;
}

.dialog-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.dialog-yes {
    background: #cc0000;
    color: #fff;
    border: none;
    padding: 9px 24px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
}

.dialog-yes:hover { background: #aa0000; }

.dialog-no {
    background: #e8e8e8;
    color: #333;
    border: 1px solid #ccc;
    padding: 9px 24px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
}

.dialog-no:hover { background: #d0d0d0; }

/* ── Settings page ── */

#settings-form {

    margin-top: 20px;
}

.form-group.inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.form-group.inline label { flex: 1; }

input[type="color"] {
    width: 56px;
    height: 36px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    padding: 2px;
}

.section-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

.vehicle-section { margin-bottom: 10px; }

.vehicle-label {
    font-weight: bold;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── App Header ── */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 14px 28px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    max-width: 860px;
    margin-bottom: 30px;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-icon {
    font-size: 1.5rem;
    color: #0066cc;
}

.app-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.app-nav {
    display: flex;
    gap: 20px;
}

.app-nav a {
    text-decoration: none;
    color: #555;
    font-size: 0.95rem;
    padding: 6px 10px;
    border-radius: 5px;
    transition: background 0.15s;
}

.app-nav a:hover {
    background: #f0f0f0;
    color: #333;
}

.app-nav a.active {
    background: #f1c962;
    color: #071421;
    font-weight: bold;
}

.search-box {
    margin: 20px auto;
    max-width: 600px;
    display: flex;
}

.search-box form {
    display: flex;
    width: 100%;
    gap: 8px;
}

.search-box input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--accent, #ccc);
    border-radius: 6px;
}

.search-box button {
    padding: 12px 20px;
    font-size: 1rem;
    background: var(--accent, #333);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.search-banner {
    background: #fff8e1;
    border-left: 4px solid var(--accent, #f0a500);
    padding: 10px 16px;
    margin-bottom: 16px;
    border-radius: 4px;
    font-size: 0.95rem;
}

.search-banner a {
    color: #888;
    text-decoration: none;
    font-size: 0.85rem;
}

/* ── Hamburger (hidden on desktop) ── */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #333;
    padding: 6px 10px;
}

.hamburger:hover { background: #f0f0f0 !important; border-radius: 5px; }

/* ── Mobile flyout menu (hidden on desktop) ── */
.mobile-menu {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 8px 0;
    min-width: 180px;
    z-index: 999;
    flex-direction: column;
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    font-size: 1rem;
}

.mobile-menu a:hover { background: #f0f0f0; }

.mobile-menu a.active {
    background: #f1c962;
    color: #071421;
    font-weight: bold;
}

/* ── Responsive breakpoint ── */
@media (max-width: 600px) {
    .app-nav { display: none; }
    .hamburger { display: block; }
    .app-header { position: relative; }
}