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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    background: #f5f5f5;
    color: #333;
}

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

/* Navbar */
.navbar {
    background: #1a1a2e;
    color: #fff;
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-links a {
    color: #aaa;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.15s;
}

.nav-links a:hover, .nav-links a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.nav-email { color: #aaa; }

.btn-logout {
    color: #aaa;
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid #444;
    border-radius: 4px;
    transition: all 0.15s;
}
.btn-logout:hover { color: #fff; border-color: #888; }

/* Plan badges */
.plan-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.plan-free     { background: #444; color: #aaa; }
.plan-standard { background: #1a5276; color: #aed6f1; }
.plan-premium  { background: #6c3483; color: #d7bde2; }

/* Cards */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}
.btn-primary   { background: #2471a3; color: #fff; }
.btn-primary:hover { background: #1a5276; }
.btn-success   { background: #1e8449; color: #fff; }
.btn-success:hover { background: #145a32; }
.btn-warning   { background: #d68910; color: #fff; }
.btn-warning:hover { background: #b7770d; }
.btn-danger    { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #922b21; }
.btn-secondary { background: #eee; color: #333; }
.btn-secondary:hover { background: #ddd; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: #555; }
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border 0.15s;
}
.form-control:focus { outline: none; border-color: #2471a3; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input { width: auto; }

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}
.alert-error   { background: #fdecea; color: #c0392b; border: 1px solid #f5b7b1; }
.alert-success { background: #eafaf1; color: #1e8449; border: 1px solid #a9dfbf; }

/* Score badges */
.score-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.score-hot  { background: #fde8d8; color: #d35400; }
.score-good { background: #d5f5e3; color: #1e8449; }
.score-mid  { background: #fef9e7; color: #d68910; }
.score-weak { background: #f9ebea; color: #c0392b; }

/* Lots list */
.lots-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.lots-filters {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-group label { font-size: 12px; font-weight: 600; color: #888; text-transform: uppercase; }

.lot-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: grid;
    grid-template-columns: auto 1fr auto auto auto auto auto;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.15s;
}
.lot-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.1); }

.lot-kadastr { font-weight: 600; font-size: 13px; }
.lot-kadastr a { color: #2471a3; text-decoration: none; }
.lot-kadastr a:hover { text-decoration: underline; }

.lot-field { text-align: right; }
.lot-field .value { font-weight: 600; font-size: 14px; }
.lot-field .label { font-size: 11px; color: #999; }

.lot-profit-positive { color: #1e8449; }
.lot-profit-negative { color: #c0392b; }

/* Lot detail */
.lot-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-field { margin-bottom: 12px; }
.detail-field .label { font-size: 12px; color: #999; margin-bottom: 2px; }
.detail-field .value { font-size: 15px; font-weight: 500; }

table.analogs {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table.analogs th {
    text-align: left;
    padding: 8px 12px;
    background: #f8f8f8;
    border-bottom: 2px solid #eee;
    font-weight: 600;
    color: #666;
}
table.analogs td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}
table.analogs tr:hover td { background: #fafafa; }

/* Auth pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
}
.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 36px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.auth-card h1 {
    font-size: 22px;
    margin-bottom: 8px;
    color: #1a1a2e;
}
.auth-card .subtitle {
    color: #888;
    margin-bottom: 24px;
    font-size: 13px;
}
.auth-links { margin-top: 16px; font-size: 13px; color: #888; text-align: center; }
.auth-links a { color: #2471a3; text-decoration: none; }

/* Admin */
.admin-queue { display: flex; flex-direction: column; gap: 12px; }
.admin-lot-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 4px solid #2471a3;
}
.admin-lot-card.route-b { border-left-color: #d35400; }
.admin-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* Verified badge */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eafaf1;
    color: #1e8449;
    border: 1px solid #a9dfbf;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .lot-card { grid-template-columns: 1fr 1fr; }
    .lot-detail-grid { grid-template-columns: 1fr; }
    .lots-filters { flex-direction: column; }
}
