* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f4f5f7;
    color: #1f2430;
}

.lang-switcher {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 6px 16px;
    background: #111827;
}

.lang-switcher a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.lang-switcher a.active {
    background: #2563eb;
    color: #fff;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    background: #1f2937;
    color: #fff;
    padding: 12px 24px;
}

.topbar-title {
    font-weight: 600;
}

.topbar-org {
    font-size: 13px;
    color: #cbd5e1;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

.topbar nav {
    display: flex;
    gap: 16px;
    flex: 1;
}

.topbar nav a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
}

.topbar nav a:hover {
    color: #fff;
}

.logout-form button {
    background: transparent;
    border: 1px solid #475569;
    color: #cbd5e1;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.container {
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 16px;
}

h1 {
    font-size: 22px;
    margin-bottom: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-top: 12px;
}

th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #eef0f2;
    font-size: 14px;
}

th {
    background: #f9fafb;
    font-weight: 600;
    color: #475569;
}

.stacked-form, .login-box form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
    background: #fff;
    padding: 16px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 16px;
}

.inline-form, .filter-form {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

input, select, button {
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #d0d5dd;
    font-size: 14px;
}

button {
    background: #2563eb;
    color: #fff;
    border: none;
    cursor: pointer;
}

button:hover {
    background: #1d4ed8;
}

.btn-approve {
    background: #16a34a;
}

.btn-approve:hover {
    background: #15803d;
}

.btn-reject {
    background: #dc2626;
}

.btn-reject:hover {
    background: #b91c1c;
}

.btn-add {
    display: inline-block;
    margin-bottom: 12px;
    background: #2563eb;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-active {
    background: #dcfce7;
    color: #15803d;
}

.badge-pending {
    background: #fef9c3;
    color: #92700e;
}

.badge-rejected, .badge-inactive, .badge-not_found {
    background: #fee2e2;
    color: #b91c1c;
}

.thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.thumb-lg {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 4px;
}

.thumb-preview {
    max-width: 160px;
    border-radius: 4px;
    margin-top: 4px;
}

.login-box {
    max-width: 360px;
    margin: 80px auto;
}

.error {
    color: #b91c1c;
    font-size: 14px;
}

.field-hint {
    color: #6b7280;
    font-size: 13px;
    margin-top: -4px;
}

.error-box {
    max-width: 480px;
    margin: 80px auto;
    text-align: center;
}

/* ---------- Guard skaner sahifasi ---------- */

.scanner-wrap {
    max-width: 480px;
    margin: 0 auto;
}

#reader {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.scan-result {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    text-align: center;
    color: #fff;
    z-index: 100;
    cursor: pointer;
}

.scan-result.hidden {
    display: none;
}

.scan-title {
    font-size: clamp(32px, 8vw, 64px);
    font-weight: 800;
    letter-spacing: 1px;
}

.scan-name {
    font-size: clamp(24px, 6vw, 40px);
    font-weight: 700;
}

.scan-detail {
    font-size: clamp(18px, 4vw, 28px);
}

.scan-message {
    font-size: clamp(20px, 5vw, 32px);
    max-width: 640px;
}

.scan-hint {
    position: absolute;
    bottom: 24px;
    font-size: 16px;
    opacity: 0.85;
}

.scan-photo {
    width: clamp(120px, 30vw, 220px);
    height: clamp(120px, 30vw, 220px);
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid #fff;
}

.status-active {
    background: #16a34a;
}

.status-pending {
    background: #ca8a04;
}

.status-rejected {
    background: #dc2626;
}

.status-inactive {
    background: #4b5563;
}

.status-not_found {
    background: #b91c1c;
}

/* ---------- Public sahifa (/p/{my_link_token}) ---------- */

.public-card {
    max-width: 360px;
    margin: 60px auto;
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.public-photo {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 16px;
}

.public-status {
    margin-top: 16px;
    font-size: 16px;
}
