/* ── GLAS Passport Admin Styles ── */

:root {
    --bg: #f5f5f0;
    --card: #ffffff;
    --navy: #1f3a4d;
    --navy-soft: #4a6275;
    --accent: #5e6da3;
    --success: #3a7d5c;
    --error: #c0392b;
    --rule: #e0dfd4;
    --text: #2c3e50;
    --text-muted: #7f8c8d;
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

/* ── Top Bar ── */

.topbar {
    background: var(--navy);
    color: white;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.topbar-brand {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: white;
    text-decoration: none;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user {
    font-size: 13px;
    opacity: 0.8;
}

.topbar-right .btn {
    color: white;
    border-color: white;
    background: transparent;
}

.topbar-right .btn:hover {
    background: white;
    color: var(--navy);
}

/* ── Container ── */

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

.container-narrow {
    max-width: 560px;
}

/* ── Page Header ── */

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

.page-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--navy);
}

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

.page-header-actions {
    display: flex;
    gap: 8px;
}

/* ── Buttons ── */

.btn {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border: 1px solid var(--navy);
    border-radius: var(--radius);
    background: transparent;
    color: var(--navy);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    line-height: 1.4;
    text-align: center;
}

.btn:hover {
    background: var(--navy);
    color: white;
}

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

.btn-primary:hover {
    background: #2c4f66;
}

.btn-sm {
    font-size: 12px;
    padding: 5px 12px;
}

.btn-subtle {
    border-color: var(--rule);
    color: var(--text-muted);
}

.btn-subtle:hover {
    background: var(--text-muted);
    color: white;
    border-color: var(--text-muted);
}

.btn-danger {
    border-color: var(--error);
    color: var(--error);
}

.btn-danger:hover {
    background: var(--error);
    color: white;
}

.btn-full {
    width: 100%;
}

/* ── Forms ── */

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    padding: 0;
}

.form-label input[type="text"],
.form-label input[type="email"],
.form-label input[type="password"] {
    font-size: 15px;
    padding: 10px 12px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: white;
    color: var(--text);
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

.form-label input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94, 109, 163, 0.15);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text);
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 8px;
}

fieldset.form-label legend {
    margin-bottom: 8px;
}

/* ── Search ── */

.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.search-bar input {
    flex: 1;
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: white;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ── Tables ── */

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.data-table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: #fafaf7;
    border-bottom: 1px solid var(--rule);
}

.data-table td {
    padding: 12px 14px;
    font-size: 14px;
    border-bottom: 1px solid var(--rule);
    vertical-align: middle;
}

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

.data-table tbody tr:hover {
    background: #fafaf7;
}

td.actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Badges ── */

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-individual { background: #e8e4f0; color: #5e4a8a; }
.badge-company { background: #dceef0; color: #2e6b77; }
.badge-done { background: #d4edda; color: #2d6a3f; }
.badge-pending { background: #f0ece0; color: #8a7a50; }
.badge-inactive { background: #f0e0e0; color: #8a5050; }

/* ── Alerts ── */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-success { background: #d4edda; color: #1e5631; border: 1px solid #b7d9c3; }
.alert-error { background: #fce4e4; color: #8b1a1a; border: 1px solid #f0c0c0; }

/* ── Empty State ── */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 15px;
}

.empty-state a { color: var(--accent); }

/* ── Login Page ── */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    text-align: center;
}

.login-card svg {
    margin: 0 auto 16px;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

/* ── Words Grid ── */

.words-grid {
    display: grid;
    grid-template-columns: 160px 1fr 1fr 1fr;
    gap: 0;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.words-grid-header {
    padding: 14px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-align: center;
    background: #fafaf7;
    border-bottom: 1px solid var(--rule);
}

.words-grid-divider {
    grid-column: 1 / -1;
    height: 2px;
    background: var(--rule);
}

.words-row-label {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--rule);
    border-right: 1px solid var(--rule);
    background: #fafaf7;
}

.words-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.words-cell {
    padding: 8px;
    border-bottom: 1px solid var(--rule);
    border-right: 1px solid var(--rule);
}

.words-cell:nth-child(4n) {
    border-right: none;
}

.words-cell input[type="text"] {
    width: 100%;
    font-size: 14px;
    padding: 8px 10px;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: white;
    color: var(--text);
}

.words-cell input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(94, 109, 163, 0.15);
}
