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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
}

a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header {
    background: #16213e;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #2a2a4a;
}
.header h1 { font-size: 18px; font-weight: 600; color: #fff; }
.header .user-info { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.header button {
    background: rgba(255,255,255,0.1);
    border: none; color: #ccc; padding: 6px 14px;
    border-radius: 6px; cursor: pointer; font-size: 13px;
}
.header button:hover { background: rgba(255,255,255,0.2); }

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 32px;
    background: #16213e;
    border-radius: 12px;
    border: 1px solid #2a2a4a;
}
.login-container h2 { color: #fff; margin-bottom: 24px; text-align: center; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #999; margin-bottom: 4px; }
.form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px;
    background: #0f0f23;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
}
.form-group input:focus { border-color: #3b82f6; }
.btn-primary {
    width: 100%;
    padding: 12px;
    background: #3b82f6;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary:hover { background: #2563eb; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.toggle-link { text-align: center; margin-top: 16px; font-size: 13px; }
.error-msg { color: #ef4444; font-size: 13px; margin-bottom: 12px; text-align: center; }

/* Dashboard */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.toolbar h2 { color: #fff; font-size: 20px; }
.filter-bar { display: flex; gap: 8px; align-items: center; }
.filter-bar select {
    background: #16213e; border: 1px solid #2a2a4a;
    color: #ccc; padding: 6px 12px; border-radius: 6px; font-size: 13px;
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.project-card {
    display: block;
    background: #16213e;
    border: 1px solid #2a2a4a;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.15);
}
.project-card:hover { border-color: #3b82f6; transform: translateY(-2px); text-decoration: none; color: inherit; }
.project-card:active { transform: scale(0.98); border-color: #3b82f6; }
.card-thumb {
    width: 100%;
    height: 160px;
    background: #0f0f23;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 40px;
    overflow: hidden;
    position: relative;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb-placeholder { font-size: 40px; }
.card-body { padding: 14px; }
.card-address { font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.card-city { font-size: 13px; color: #999; margin-bottom: 8px; }
.card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #666; }

/* Project Detail */
.project-detail { max-width: 900px; margin: 0 auto; }
.detail-header {
    background: #16213e; border: 1px solid #2a2a4a;
    border-radius: 12px; padding: 24px; margin-bottom: 24px;
}
.detail-header h2 { color: #fff; font-size: 22px; margin-bottom: 4px; }
.detail-header .address-sub { color: #999; font-size: 14px; margin-bottom: 12px; }
.detail-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #999; }
.scan-list { list-style: none; }
.scan-item {
    background: #16213e; border: 1px solid #2a2a4a;
    border-radius: 10px; padding: 16px; margin-bottom: 12px;
    display: flex; justify-content: space-between; align-items: center;
}
.scan-item .scan-info { font-size: 14px; }
.scan-item .scan-actions { display: flex; gap: 8px; }
.btn-sm {
    padding: 6px 14px; border-radius: 6px; border: none;
    font-size: 12px; font-weight: 600; cursor: pointer;
}
.btn-view { background: #3b82f6; color: #fff; }
.btn-view:hover { background: #2563eb; }

/* Admin */
.user-table { width: 100%; border-collapse: collapse; }
.user-table th, .user-table td {
    padding: 10px 14px; text-align: left;
    border-bottom: 1px solid #2a2a4a;
}
.user-table th { color: #999; font-size: 12px; text-transform: uppercase; }
.user-table td { font-size: 14px; }

/* Viewer embed */
.viewer-frame {
    width: 100%; height: 500px;
    border: 1px solid #2a2a4a; border-radius: 12px;
    background: #0f0f23; margin-top: 16px;
}

/* Responsive */
@media (max-width: 600px) {
    .project-grid { grid-template-columns: 1fr; gap: 12px; }
    .container { padding: 12px; }
    .card-thumb { height: 200px; }
    .card-body { padding: 12px; }
    .card-address { font-size: 16px; }
    .card-city { font-size: 14px; }
    .card-meta { font-size: 13px; }
    .toolbar h2 { font-size: 18px; }
    .header { padding: 10px 16px; }
    .header h1 { font-size: 16px; }
    .header .user-info { gap: 8px; font-size: 12px; }
}
