/* Reusable pieces: buttons, fields, avatars, list rows, cards, empty states. Used by every page and modal. */

/* ----- buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 18px; border: 0; border-radius: var(--radius-sm); font-weight: 700; text-decoration: none; transition: background .15s, transform .1s, filter .15s; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ok { background: var(--ok); color: var(--ok-text); }
.btn-ok:hover:not(:disabled) { background: var(--ok-hover); }
.btn-default { background: var(--bg-card); color: var(--text); }
.btn-default:hover:not(:disabled) { background: var(--bg-hover); }
.btn-lg { min-height: 48px; padding: 10px 24px; font-size: 16px; }
.btn-sm { min-height: 34px; padding: 5px 14px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn-round { border-radius: var(--radius-pill); min-width: 210px; }
.btn-shadow { box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.btn-t { display: inline-flex; align-items: center; gap: 8px; }
.spin { display: none; width: 20px; height: 20px; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: cb-spin .7s linear infinite; }
.btn.is-busy .btn-t { display: none; }
.btn.is-busy .spin { display: block; }
@keyframes cb-spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }

/* ----- form fields ----- */
.field { margin: 0 0 14px 0; min-width: 0; }
.field label, .label-row label { display: block; margin: 0 0 6px 0; font-size: var(--fs-sm); font-weight: 700; color: var(--text-muted); }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.input { display: block; width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text); outline: none; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s; font-size: 16px; }
.input::placeholder { color: var(--text-muted); opacity: 1; }
.input:hover { border-color: #444; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.input.is-bad { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
select.input { padding-right: 38px; cursor: pointer; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path d='M1 1l6 6 6-6' fill='none' stroke='%239b9b9b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; }
select.input option { background: var(--bg-elev); color: var(--text); }
.pw { position: relative; }
.pw .input { padding-right: 50px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); }
.pw-toggle:hover { color: var(--text); background: var(--bg-hover); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { min-height: 18px; margin-top: 5px; font-size: var(--fs-xs); color: var(--text-muted); }
.hint.ok { color: var(--success); }
.hint.bad { color: var(--danger); }
.hint-lead { margin: 0 0 16px 0; color: var(--text-muted); font-size: var(--fs-sm); }
.form-error { display: none; margin: 0 0 14px 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-bg); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); font-size: var(--fs-sm); }
.form-error.on { display: block; }
.legal { margin: 14px 0 0 0; font-size: var(--fs-xs); color: var(--text-muted); text-align: center; }
.note { padding: 14px; border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-muted); }

/* ----- avatar, list rows, card, tabs ----- */
.textarea { height: auto; padding: 12px 14px; line-height: 1.45; resize: vertical; min-height: 84px; }
.empty-img { width: 64px; height: 64px; opacity: .8; }
.avatar { display: block; border-radius: 50%; object-fit: cover; background: var(--bg-card); }
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 40px; height: 40px; }
.avatar-lg { width: 96px; height: 96px; }
.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-form { width: 100%; max-width: 420px; padding: 24px; margin-top: 20px; text-align: left; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); text-align: left; }
.row i { width: 22px; text-align: center; color: var(--text-muted); }
.row span { flex: 1; color: var(--text-muted); }
.row b { font-weight: 600; }
.row-action { cursor: pointer; }
.row-action span { color: var(--text); }
.row-action:hover { background: var(--bg-hover); }
.tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.tab { padding: 12px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-muted); font-weight: 700; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.empty-zone { max-width: 460px; margin: 12vh auto 0 auto; padding: 0 20px; text-align: center; }
.empty-icon { font-size: 54px; color: var(--text-muted); margin-bottom: 14px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.prose p { margin: 0 0 12px 0; color: var(--text-muted); line-height: 1.6; }
