@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    margin: 0;
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

/* --- Sidebar --- */
aside {
    width: 250px;
    min-width: 250px;
    background-color: white;
    border-right: 1px solid #eee;
    padding: 20px;
    display: flex;
    flex-direction: column;
    z-index: 200;
}

.sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 0 4px;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
}

.logo-container {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px 5px;
    background: transparent;
    flex: 1;
}

.brand-name {
    font-size: 34px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0;
    font-family: 'Arial Black', Impact, sans-serif;
}

.nan-renk { color: #009639; }
.san-renk { color: #1a1a1a; }

.brand-sub {
    font-size: 15px;
    color: #000;
    font-weight: 500;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 20px 0;
}

.menu-title {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    margin-bottom: 10px;
    padding-left: 15px;
    letter-spacing: 1px;
}

.menu-title-spaced {
    margin-top: 30px;
}

.menu-item {
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.3s;
}

.menu-item.active { background-color: #3b82f6; color: white; }
.menu-item:hover:not(.active) { background-color: #f3f4f6; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

/* --- App shell --- */
.app-shell {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mobile-header {
    display: none;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    height: 2px;
    background: #374151;
    border-radius: 2px;
}

.mobile-brand {
    font-size: 22px;
    font-weight: 900;
    font-style: italic;
    font-family: 'Arial Black', Impact, sans-serif;
}

main {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
}

.page-title {
    margin: 0 0 20px;
    color: #111827;
    font-size: 1.5rem;
}

/* --- Top bar --- */
.top-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 12px;
}

.search-container {
    flex: 1 1 200px;
    min-width: 0;
}

.search-container input {
    padding: 12px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    width: 100%;
    max-width: 320px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
}

.sort-select {
    flex: 1 1 180px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    outline: none;
    color: #4b5563;
    font-size: 14px;
    min-width: 0;
}

.add-button {
    flex: 0 1 auto;
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    white-space: nowrap;
}

.add-button:hover { background-color: #2563eb; }

/* --- Table --- */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

td {
    padding: 15px 12px 15px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #1f2937;
    vertical-align: middle;
}

td:last-child { padding-right: 0; }

tr:last-child td { border-bottom: none; }

.vehicle-info { display: flex; flex-direction: column; gap: 2px; }
.vehicle-brand { font-weight: 600; }
.vehicle-category { font-size: 12px; color: #6b7280; }
.plate { font-weight: 600; letter-spacing: 1px; color: #111827; white-space: nowrap; }

.status-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.status-safe { background-color: #dcfce7; color: #166534; }
.status-yellow { background-color: #fef08a; color: #854d0e; }
.status-red { background-color: #fee2e2; color: #991b1b; }
.status-expired { background-color: #1f2937; color: white; }

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.delete-btn {
    background-color: #fee2e2;
    color: #991b1b;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.delete-btn:hover { background-color: #fca5a5; }

.edit-btn {
    background-color: #e0f2fe;
    color: #0369a1;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.edit-btn:hover { background-color: #bae6fd; }

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 450px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.15rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    flex-shrink: 0;
}

.input-group { margin-bottom: 15px; }

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: #4b5563;
    font-weight: 600;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 16px;
}

.input-uppercase { text-transform: uppercase; }

.save-btn {
    width: 100%;
    padding: 14px;
    background-color: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    font-size: 15px;
}

.save-btn:hover { background-color: #059669; }

/* --- Tablet (1024px) --- */
@media (max-width: 1024px) {
    main { padding: 24px 28px; }

    .search-container input { max-width: 100%; }

    th, td { font-size: 13px; }

    td { padding: 12px 8px 12px 0; }
}

/* --- Mobile sidebar + layout (900px) --- */
@media (max-width: 900px) {
    aside {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        height: 100dvh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

    aside.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .logo-container {
        margin-bottom: 0;
        padding: 5px;
        text-align: left;
    }

    .mobile-header {
        display: flex;
    }

    main {
        padding: 16px;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container,
    .search-container input,
    .sort-select,
    .add-button {
        width: 100%;
        max-width: none;
    }

    .table-container {
        padding: 12px;
        background: transparent;
        box-shadow: none;
    }

    /* Kart görünümü */
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        display: none;
    }

    tbody tr {
        background: white;
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 14px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        border: 1px solid #f0f0f0;
    }

    tbody tr:last-child {
        margin-bottom: 0;
    }

    tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 0;
        border-bottom: 1px solid #f3f4f6;
    }

    tbody td:first-child {
        padding-top: 0;
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 4px;
    }

    tbody td:last-child {
        padding-bottom: 0;
        border-bottom: none;
    }

    tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 12px;
        color: #9ca3af;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        flex-shrink: 0;
        min-width: 90px;
        padding-top: 2px;
    }

    tbody td[data-label="Araç Bilgisi"] {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    tbody td[data-label="Araç Bilgisi"]::before {
        display: none;
    }

    tbody td[data-label="Durum"] {
        flex-direction: column;
        align-items: stretch;
    }

    tbody td[data-label="Durum"]::before {
        margin-bottom: 4px;
    }

    tbody td[data-label="Durum"] .status-stack {
        align-items: stretch;
    }

    tbody td[data-label="Durum"] .status {
        text-align: center;
        white-space: normal;
    }

    tbody td[data-label="İşlem"] {
        flex-direction: column;
        align-items: stretch;
    }

    tbody td[data-label="İşlem"] .action-buttons {
        width: 100%;
    }

    tbody td[data-label="İşlem"] .edit-btn,
    tbody td[data-label="İşlem"] .delete-btn {
        flex: 1;
        text-align: center;
        padding: 10px 14px;
    }

    .vehicle-brand {
        font-size: 15px;
    }
}

/* --- Small mobile (480px) --- */
@media (max-width: 480px) {
    main { padding: 12px; }

    .mobile-header { padding: 10px 12px; }

    .page-title { font-size: 1.1rem; margin-bottom: 14px; }

    .modal-content {
        padding: 18px;
        border-radius: 10px;
    }

    tbody tr { padding: 14px; }

    tbody td::before {
        min-width: 72px;
        font-size: 11px;
    }

    .status {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* --- Landscape phone --- */
@media (max-width: 900px) and (orientation: landscape) {
    .modal-overlay {
        align-items: flex-start;
        padding-top: 12px;
        padding-bottom: 12px;
    }
}
