/* Teliart CRM – eraldi veebilehe kest (crm.teliart.ee) */

body.tcrm-app {
    --ink: #1c202c;
    --muted: #666e80;
    --line: #e3e6ea;
    --accent: #1f4e4a;
    --danger: #b42318;

    margin: 0;
    min-height: 100vh;
    background: #f3f4f4;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
body.tcrm-app *, body.tcrm-app *::before, body.tcrm-app *::after { box-sizing: border-box; }
body.tcrm-app a { color: var(--accent); }
body.tcrm-app button, body.tcrm-app input, body.tcrm-app select, body.tcrm-app textarea { font-family: inherit; }

.tcrm-mark {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    border-right-color: transparent;
    transform: rotate(-45deg);
    flex: none;
}

/* ---------- Logo ---------- */

.tcrm-logo {
    display: block;
    width: auto;
    max-width: 160px;
    height: auto;
    max-height: 30px;
    object-fit: contain;
}
.tcrm-logo.is-login { max-width: 220px; max-height: 56px; }
.tcrm-brand-crm {
    padding-left: 10px;
    border-left: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.tcrm-login-brand.has-logo { gap: 14px; margin-bottom: 24px; }
.tcrm-login-brand.has-logo .tcrm-brand-crm { font-size: 15px; padding-left: 14px; }

/* ---------- Ülariba ---------- */

.tcrm-top {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 60px;
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.tcrm-top-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
body.tcrm-app .tcrm-top-brand { color: var(--ink); text-decoration: none; }

.tcrm-nav {
    display: flex;
    align-self: stretch;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tcrm-nav::-webkit-scrollbar { display: none; }
body.tcrm-app .tcrm-nav a {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
body.tcrm-app .tcrm-nav a:hover { color: var(--ink); }
body.tcrm-app .tcrm-nav a.is-active { color: var(--ink); border-bottom-color: var(--accent); }

.tcrm-top-user {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    white-space: nowrap;
}
.tcrm-top-name { color: var(--muted); }
body.tcrm-app .tcrm-top-user a { font-weight: 600; text-decoration: none; }
body.tcrm-app .tcrm-top-user a:hover { text-decoration: underline; }

.tcrm-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6px 24px 48px;
}
.tcrm-main .tcrm { max-width: none; }
.tcrm .wp-header-end { display: none; }

/* ---------- Teated ---------- */

.tcrm .notice {
    margin: 0 0 16px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
}
.tcrm .notice p { margin: 0; }
.tcrm .notice-error { border-left-color: var(--danger); }

/* ---------- Sisselogimine ---------- */

.tcrm-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.tcrm.tcrm-login { width: 100%; max-width: 400px; }
.tcrm-login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.tcrm-login-brand .tcrm-mark { width: 22px; height: 22px; border-width: 4px; }
.tcrm-login-brand strong { display: block; font-size: 18px; }
.tcrm-login-brand span { color: var(--muted); }

.tcrm-login-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent);
    border-radius: 10px;
}
.tcrm-login-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 650; }
.tcrm-login-card p { margin: 0; }
.tcrm .tcrm-login-card .tcrm-btn { justify-content: center; min-height: 42px; font-size: 15px; }
.tcrm-login-lost { align-self: center; }
.tcrm-login-msg {
    padding: 10px 12px;
    border-radius: 6px;
    background: #e4eeec;
}
.tcrm-login-msg.is-error { background: #fdecea; color: var(--danger); }

/* ---------- Kohanduv ---------- */

@media (max-width: 900px) {
    .tcrm-top { flex-wrap: wrap; gap: 0 16px; padding: 10px 16px 0; }
    .tcrm-top-user { gap: 12px; }
    .tcrm-top-name { display: none; }
    .tcrm-nav { order: 3; width: 100%; min-height: 44px; margin: 6px -4px 0; }
    .tcrm-main { padding: 0 16px 40px; }
}
@media (max-width: 480px) {
    .tcrm-top-brand { font-size: 15px; }
}
