:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --black: #111111;
    --primary: #2563eb;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --radius: 18px;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

.wrap {
    padding: 20px;
    padding-bottom: 96px;
    max-width: 1180px;
    margin: 0 auto;
}

.mobile-wrap {
    max-width: 520px;
}

.page-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.page-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.page-subtitle {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
}

.top-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: white;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn.primary {
    background: var(--black);
    color: white;
    border-color: var(--black);
}

.btn.blue {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn.danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: transparent;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

.stat-card {
    background: linear-gradient(180deg, #ffffff, #f9fafb);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 900;
}

.table-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

th {
    background: #f9fafb;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 13px;
    font-weight: 700;
}

.badge.green {
    background: #dcfce7;
    color: #166534;
}

.badge.gray {
    background: #f3f4f6;
    color: #4b5563;
}

.form-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.form-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 16px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 14px;
    font-size: 16px;
    background: white;
    margin-bottom: 14px;
}

textarea {
    min-height: 92px;
    padding: 14px;
    resize: none;
}

label {
    display: block;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 700;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    display: flex;
    height: 68px;
    z-index: 900;
}

.bottom-nav a {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    padding-top: 10px;
}

.search-input {
    width: 100%;
    height: 58px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0 18px;
    font-size: 18px;
    background: white;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

.vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vehicle-card {
    background: white;
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 18px;
    cursor: pointer;
    transition: 0.15s;
}

.vehicle-card:hover {
    transform: translateY(-2px);
}

.vehicle-number {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 10px;
}

.vehicle-info {
    color: var(--muted);
    font-size: 15px;
}

.modal-bg {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
}

.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -100%;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 22px;
    z-index: 1001;
    transition: bottom 0.25s ease;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.12);
}

.bottom-sheet.open {
    bottom: 0;
}

.sheet-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.sheet-number {
    font-size: 28px;
    font-weight: 900;
}

.close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    font-size: 24px;
    cursor: pointer;
}

.detail-row {
    margin-bottom: 18px;
}

.detail-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 700;
}

.detail-value {
    font-size: 19px;
    font-weight: 600;
}

.remote-badge {
    margin-top: 10px;
    margin-bottom: 20px;
}

.sheet-buttons {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.sheet-buttons .btn {
    flex: 1;
    height: 54px;
}

.empty-box {
    background: white;
    border-radius: 18px;
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    box-shadow: var(--shadow);
}

.type-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.type-btn {
    flex: 1;
    height: 54px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: white;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
}

.type-btn.active {
    background: var(--black);
    color: white;
    border-color: var(--black);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 16px;
}

.check-row input {
    width: 22px;
    height: 22px;
    margin: 0;
}

.submit-btn {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 14px;
    background: var(--black);
    color: white;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 390px;
    background: white;
    border-radius: 26px;
    box-shadow: var(--shadow);
    padding: 30px;
}

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    margin: 0 auto 18px;
}

.login-title {
    margin: 0;
    text-align: center;
    font-size: 26px;
    font-weight: 900;
}

.login-subtitle {
    text-align: center;
    color: var(--muted);
    margin-top: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.login-notice {
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    line-height: 1.5;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
}

.password-modal-bg {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.48);
    z-index: 2000;
}

.password-modal {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    width: calc(100% - 40px);
    max-width: 420px;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.22);
    padding: 24px;
    z-index: 2001;
}

.password-modal.open,
.password-modal-bg.open {
    display: block;
}

.modal-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.modal-title {
    font-size: 22px;
    font-weight: 900;
}

.modal-close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    font-size: 22px;
    cursor: pointer;
}

.modal-message {
    display: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    margin-bottom: 14px;
}

.modal-message.success {
    display: block;
    background: #dcfce7;
    color: #166534;
}

.modal-message.error {
    display: block;
    background: #fee2e2;
    color: #b91c1c;
}

.admin-search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.admin-search-box input {
    margin-bottom: 0;
}

.admin-search-box .btn {
    min-width: 80px;
}

.badge.blue-badge {
    background: #dbeafe;
    color: #1d4ed8;
}

.log-search-box {
    display: grid;
    grid-template-columns: 260px 180px;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
}

.log-search-box input,
.log-search-box select {
    height: 46px;
    margin-bottom: 0;
    font-size: 14px;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form select,
.inline-form input {
    min-width: 120px;
    height: 42px;
    margin-bottom: 0;
    font-size: 14px;
}

.inline-form .btn {
    height: 42px;
    min-height: 42px;
    white-space: nowrap;
}

.pagination-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.page-info {
    font-weight: 800;
    color: var(--muted);
}

@media (max-width: 768px) {
    .log-search-box {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-search-box {
        flex-direction: column;
    }

    .admin-search-box .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .page-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-actions {
        width: 100%;
        justify-content: flex-start;
    }

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