/* CRM — lihtne, funktsionaalne (mitte ilus) */
body { font-family: Arial, Helvetica, sans-serif; margin: 20px; color: #222; font-size: 14px; }
header { border-bottom: 2px solid #ccc; padding-bottom: 8px; margin-bottom: 18px; }
header .user { font-weight: bold; }
a { color: #1a6; text-decoration: none; }
a:hover { text-decoration: underline; }
h2 { margin: 8px 0; }
.muted { color: #888; }
.flash { color: #c0392b; font-weight: bold; }
input, button { padding: 6px 8px; margin: 2px; font-size: 14px; }
table { border-collapse: collapse; width: 100%; margin-top: 8px; }
th { text-align: left; color: #666; font-size: 12px; padding: 4px 10px; }
td { padding: 4px 10px; border-bottom: 1px solid #eee; vertical-align: top; }

.header-stats span { display: inline-block; margin: 2px 10px 2px 0; background: #f0f0f0;
                     padding: 3px 9px; border-radius: 4px; }
.timeline .date { white-space: nowrap; color: #555; }
.timeline .type { white-space: nowrap; color: #444; }
.timeline .amt { color: #888; margin-left: 8px; }
/* tüübi-värvid eristamiseks */
.timeline .t-email_sent     { background: #eef6ff; }
.timeline .t-email_received { background: #eefbef; }
.timeline .t-invoice        { background: #fff7ec; }
.timeline .t-offer          { background: #fdfdec; }
.timeline .t-shopify_order  { background: #f6eeff; }

/* Laienevad kirja-read (v1.2) — klõps avab sisu kohapeal */
.timeline .email-row { cursor: pointer; }
.timeline .email-row:hover { filter: brightness(0.97); }
.timeline .email-row .caret { display: inline-block; color: #888; transition: transform .12s; }
.timeline .email-row.open .caret { transform: rotate(90deg); }
.timeline .email-body td { padding: 0; }
.email-content { margin: 0; padding: 10px 14px; background: #fafafa; border-left: 3px solid #ccc;
                 white-space: pre-wrap; word-break: break-word; font-family: inherit;
                 font-size: 13px; color: #222; max-height: 480px; overflow-y: auto; }
.draft-note { margin: 0; padding: 6px 14px; background: #fff4d6; color: #7a5b00;
              font-size: 12px; font-style: italic; }

/* Üldtabel (v1.1) */
.list { font-size: 13px; }
.list th { background: #f4f4f4; border-bottom: 2px solid #ddd; white-space: nowrap; }
.list th a { color: #333; }
.list tr.filt td { background: #fafafa; padding: 2px 6px; }
.list tr.filt input { padding: 2px 4px; margin: 0; font-size: 12px; width: 100%; box-sizing: border-box; }
.list tr.filt td.mm input, .list tr.filt td.dr input { width: 48%; display: inline-block; }
.list tr.filt-actions td { background: #fafafa; padding: 4px 6px; }
.list td.num { text-align: right; white-space: nowrap; }
.list td.val { font-weight: bold; }
.list td.date { white-space: nowrap; color: #555; }
.list tr:hover td { background: #f0f8ff; }

/* Logo + pagineerimine */
header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand { display: inline-flex; }
.logo { height: 34px; width: auto; vertical-align: middle; }
.crm-label { font-weight: bold; color: #666; letter-spacing: 1px; }
.pager { margin: 14px 0; font-size: 13px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.pager .rpp a, .pager .pages a { padding: 2px 7px; border: 1px solid #ddd; border-radius: 3px; margin: 0 1px; }
.pager .rpp b, .pager .pages b.cur { padding: 2px 7px; background: #1a6; color: #fff; border-radius: 3px; }
.pager .disabled, .pager .ell { color: #bbb; padding: 2px 5px; }
