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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 20px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.card h1 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 8px;
    color: #1a1a2e;
}

.card .subtitle {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #4a6cf7;
    color: #fff;
}

.btn-primary:hover {
    background: #3b5de7;
}

.btn-primary:disabled {
    background: #a0b4f7;
    cursor: not-allowed;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-success:hover {
    background: #219a52;
}

.link {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: #888;
}

.link a {
    color: #4a6cf7;
    text-decoration: none;
}

.link a:hover {
    text-decoration: underline;
}

.error-msg {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.error-msg.show {
    display: block;
}

.success-msg {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.success-msg.show {
    display: block;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.header-left h2 {
    font-size: 20px;
}

.header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-right .btn {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
}

.status-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.status-card .plate {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.status-badge.success {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.pending {
    background: #fef9c3;
    color: #ca8a04;
}

.status-badge.failed,
.status-badge.retrying {
    background: #fef2f2;
    color: #dc2626;
}

.status-detail {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.status-detail .item {
    font-size: 14px;
}

.status-detail .item .label {
    color: #888;
    font-size: 12px;
}

.status-detail .item .value {
    font-weight: 600;
    margin-top: 2px;
}

.log-table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.log-table h3 {
    padding: 16px 24px;
    font-size: 16px;
    border-bottom: 1px solid #eee;
}

.log-item {
    padding: 14px 24px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-item:last-child {
    border-bottom: none;
}

.log-item .log-time {
    font-size: 13px;
    color: #888;
}

.log-item .log-status {
    font-size: 13px;
    font-weight: 600;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 26px;
    transition: 0.3s;
}

.toggle .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .slider {
    background-color: #4a6cf7;
}

.toggle input:checked + .slider:before {
    transform: translateX(22px);
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.toggle-row span {
    font-size: 14px;
    color: #555;
}

.settings-section {
    margin-top: 20px;
}

.settings-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal h3 {
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.dashboard-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px;
}

/* Admin styles */
.admin-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #eee;
}

.tab {
    padding: 10px 24px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #888;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover {
    color: #4a6cf7;
}

.tab.active {
    color: #4a6cf7;
    border-bottom-color: #4a6cf7;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #4a6cf7;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

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

.search-bar input,
.search-bar select {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.search-bar input {
    flex: 1;
}

.table-wrapper {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

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

table th {
    background: #f8f9fb;
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #eee;
}

table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
}

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

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.pagination button {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}

.pagination button:hover {
    background: #f0f2f5;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .current-page {
    font-size: 14px;
    color: #666;
}

.inline-btn {
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    margin-right: 4px;
}

.inline-btn:hover {
    background: #f0f2f5;
}

.inline-btn.danger {
    color: #dc2626;
    border-color: #fecaca;
}

.inline-btn.danger:hover {
    background: #fef2f2;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}
