:root {
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #f2f4f7;
    color: #1a1d23;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    border: 1px solid #e2e5ea;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.brand {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
}

h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 20px;
    color: #4b5160;
}

form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

label {
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
}

input {
    padding: 9px 10px;
    border: 1px solid #d3d7de;
    border-radius: 6px;
    font-size: 14px;
}

input:focus {
    outline: 2px solid #2f6feb;
    outline-offset: 1px;
}

button {
    margin-top: 20px;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #1a1d23;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: #333844;
}

.form-error {
    background: #fdecec;
    color: #a3282f;
    border: 1px solid #f5c2c5;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    margin: 0 0 12px;
}

.form-hint {
    background: #eef4ff;
    color: #1c4ed8;
    border: 1px solid #c9dbff;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    margin: 0 0 12px;
}

.form-footer {
    margin: 20px 0 0;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

.form-footer a {
    color: #2f6feb;
    text-decoration: none;
}

/* ---------------------------------------------------------------
   Rakenduse lehed (sisselogitud vaade)
   --------------------------------------------------------------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid #e2e5ea;
}

.topbar-brand {
    font-weight: 700;
    font-size: 16px;
    color: #1a1d23;
    text-decoration: none;
}

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

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

.topbar-nav a:hover {
    color: #1a1d23;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #4b5160;
}

.topbar-user form {
    display: inline;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 24px 64px;
}

.page h1 {
    font-size: 22px;
    margin: 0 0 6px;
}

.page h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin: 0 0 12px;
}

.page section {
    margin-top: 32px;
}

.breadcrumb {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 8px;
}

.breadcrumb a {
    color: #4b5160;
}

.muted {
    color: #8a90a0;
    font-weight: 400;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.card {
    background: #ffffff;
    border: 1px solid #e2e5ea;
    border-radius: 10px;
    padding: 16px 20px;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-value {
    font-size: 22px;
    font-weight: 700;
}

.card-label {
    font-size: 12px;
    color: #6b7280;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #e2e5ea;
    border-radius: 10px;
    overflow: hidden;
    font-size: 13px;
}

th, td {
    text-align: left;
    padding: 9px 12px;
    border-bottom: 1px solid #eef0f3;
    vertical-align: top;
}

thead th {
    background: #f7f8fa;
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

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

.table-fields th {
    width: 180px;
    background: #f7f8fa;
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef0f3;
    color: #4b5160;
    font-size: 11px;
    font-weight: 600;
}

.badge-ok {
    background: #e6f5ec;
    color: #1e7a45;
}

.badge-error {
    background: #fdeaea;
    color: #a32020;
}

.badge-admin {
    background: #eae6fd;
    color: #4a2fa3;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.form-inline label {
    margin-top: 0;
    font-size: 12px;
    color: #6b7280;
}

.form-inline input,
.form-inline select {
    padding: 7px 9px;
    font-size: 13px;
}

.form-inline button {
    margin-top: 0;
}

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

button {
    cursor: pointer;
}

.button-quiet {
    background: #ffffff;
    color: #4b5160;
    border: 1px solid #d7dbe2;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.button-danger {
    background: #ffffff;
    color: #a32020;
    border: 1px solid #f0cfcf;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
}

.flash {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin: 0 0 20px;
}

.flash-ok {
    background: #e6f5ec;
    color: #1e7a45;
}

.flash-error {
    background: #fdeaea;
    color: #a32020;
}

.actions {
    background: #ffffff;
    border: 1px solid #e2e5ea;
    border-radius: 10px;
    padding: 18px 20px;
}
