/* Pets CRM — тёплая, спокойная палитра, не «AI-default» */
:root {
    --bg:        #f7f3ec;
    --bg-card:   #ffffff;
    --bg-soft:   #efe9de;
    --ink:       #2b2118;
    --ink-soft:  #6b5e51;
    --line:      #e3dccd;
    --accent:    #c25b3a;       /* терракота — кнопки, важное */
    --accent-h:  #a44a2d;
    --leaf:      #5a7a52;       /* зелёный — «сделано», ок */
    --leaf-bg:   #e6ede0;
    --warn:      #b9651b;       /* «скоро» — янтарь */
    --warn-bg:   #fbecd6;
    --danger:    #a8392e;       /* «просрочено» */
    --danger-bg: #f5d9d3;
    --shadow:    0 1px 0 rgba(43, 33, 24, 0.04), 0 6px 24px -12px rgba(43, 33, 24, 0.18);
    --r:         14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-feature-settings: "ss01", "ss02";
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.5;
}

.body-app {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 .4em; }
h1 { font-size: 2rem; line-height: 1.15; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

.muted { color: var(--ink-soft); font-size: .92rem; }
.tiny  { font-size: .82rem; color: var(--ink-soft); }

/* ───── Sidebar ───── */
.sidebar {
    background: var(--bg-soft);
    border-right: 1px solid var(--line);
    padding: 28px 18px;
    display: flex; flex-direction: column; gap: 18px;
    position: sticky; top: 0; height: 100vh;
}
.brand {
    font-family: 'Fraunces', serif;
    font-weight: 600; font-size: 1.4rem;
    letter-spacing: -0.02em;
    display: flex; align-items: center; gap: 10px;
    color: var(--ink);
}
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display:inline-block; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: 9px;
    color: var(--ink); font-family: 'Inter', system-ui, sans-serif;
    font-size: .95rem; font-weight: 500;
}
.nav a:hover { background: rgba(0,0,0,.04); text-decoration: none; }
.nav a.active { background: var(--ink); color: #fff; }
.nav a.active:hover { background: var(--ink); }
.nav-ico { width: 18px; text-align: center; opacity: .85; }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--ink-soft); font-family: 'Inter', sans-serif; }
.sidebar-foot a { color: var(--ink-soft); }
.sidebar-foot strong { color: var(--ink); font-weight: 600; display: block; }

/* ───── Main ───── */
.main { padding: 36px 44px 72px; max-width: 1100px; }
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 28px; flex-wrap: wrap;
}
.page-head .sub { color: var(--ink-soft); font-family: 'Inter', sans-serif; font-size: .92rem; }
.eyebrow {
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .72rem;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

/* ───── Cards ───── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 20px;
    box-shadow: var(--shadow);
}
.cards { display: grid; gap: 16px; }
.cards.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cards.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cards.cols-4 { grid-template-columns: repeat(4, 1fr); }

.stat {
    padding: 18px 20px;
}
.stat .n { font-family: 'Fraunces', serif; font-size: 2.2rem; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.stat .label { font-family: 'Inter', sans-serif; font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); margin-top: 8px; }

/* ───── Reminder rows ───── */
.list { display: flex; flex-direction: column; gap: 10px; }
.row {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: 36px 1fr auto auto;
    gap: 14px;
    align-items: center;
    transition: border-color .15s;
}
.row:hover { border-color: #d4caa9; }
.row.done { opacity: .55; }
.row.done .row-title { text-decoration: line-through; }
.row-ico { font-size: 1.4rem; line-height: 1; text-align: center; }
.row-title { font-weight: 600; font-size: 1.02rem; }
.row-meta  { font-family: 'Inter', sans-serif; font-size: .85rem; color: var(--ink-soft); margin-top: 2px; }

.pill {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: .76rem; font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: .02em;
    background: var(--bg-soft); color: var(--ink-soft);
    white-space: nowrap;
}
.pill.ok      { background: var(--leaf-bg);   color: var(--leaf); }
.pill.near    { background: var(--bg-soft);   color: var(--ink); }
.pill.soon    { background: var(--warn-bg);   color: var(--warn); }
.pill.overdue { background: var(--danger-bg); color: var(--danger); }
.pill.done    { background: var(--leaf-bg);   color: var(--leaf); }

.cat-food     { color: #b87333; }
.cat-meds     { color: #8b3a52; }
.cat-vaccine  { color: #4b6a8a; }
.cat-grooming { color: #6b5e3a; }
.cat-walk     { color: #5a7a52; }
.cat-vet      { color: #a8392e; }
.cat-other    { color: var(--ink-soft); }

/* ───── Forms / buttons ───── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--accent); color: #fff;
    border: 0; border-radius: 10px;
    padding: 10px 18px;
    font-family: 'Inter', sans-serif;
    font-size: .95rem; font-weight: 600;
    cursor: pointer; transition: background .15s;
    text-decoration: none;
}
.btn:hover { background: var(--accent-h); color: #fff; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.tiny  { padding: 6px 12px; font-size: .82rem; border-radius: 8px; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #8a2e25; }
.btn.leaf  { background: var(--leaf); }
.btn.leaf:hover { background: #475e44; }
.btn-icon {
    background: transparent; border: 1px solid var(--line);
    width: 34px; height: 34px; border-radius: 8px;
    display:inline-flex; align-items:center; justify-content:center;
    cursor: pointer; color: var(--ink-soft);
}
.btn-icon:hover { background: var(--bg-soft); color: var(--ink); }

form.inline { display: inline; }

label { display: block; font-family: 'Inter', sans-serif; font-size: .85rem; font-weight: 600; color: var(--ink); margin: 14px 0 6px; letter-spacing: .01em; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number],
select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    font-family: 'Inter', sans-serif;
    font-size: .95rem;
    color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
textarea { min-height: 88px; resize: vertical; font-family: inherit; }

.field-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }

/* ───── Auth ───── */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(180deg, #f7f3ec 0%, #ebe2cf 100%);
}
.auth-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px -32px rgba(43, 33, 24, .35);
}
.auth-card h1 { margin-bottom: 6px; }
.auth-card .sub { color: var(--ink-soft); font-family: 'Inter', sans-serif; font-size: .92rem; margin-bottom: 18px; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 18px; }
.auth-foot { margin-top: 18px; font-family: 'Inter', sans-serif; font-size: .88rem; color: var(--ink-soft); text-align: center; }

.error {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 9px;
    font-family: 'Inter', sans-serif;
    font-size: .9rem;
    margin: 10px 0;
}
.notice {
    background: var(--leaf-bg);
    color: var(--leaf);
    padding: 10px 14px;
    border-radius: 9px;
    font-family: 'Inter', sans-serif;
    font-size: .9rem;
    margin: 10px 0;
}

/* ───── Pet cards ───── */
.pet-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    display: flex; flex-direction: column; gap: 8px;
    text-decoration: none; color: var(--ink);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.pet-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px -24px rgba(43,33,24,.35);
    border-color: #d4caa9;
    text-decoration: none;
}
.pet-emoji { font-size: 2.6rem; line-height: 1; }
.pet-name  { font-size: 1.25rem; font-weight: 600; font-family: 'Fraunces', serif; letter-spacing: -.01em; }
.pet-meta  { color: var(--ink-soft); font-family: 'Inter', sans-serif; font-size: .88rem; }

/* ───── Tables ───── */
table.t {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
}
table.t th, table.t td {
    text-align: left; padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    font-size: .92rem; vertical-align: middle;
}
table.t th {
    font-weight: 600; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .1em;
    color: var(--ink-soft);
}

/* ───── Утилиты ───── */
.flex { display: flex; align-items: center; gap: 10px; }
.flex.between { justify-content: space-between; }
.gap16 { gap: 16px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }
.text-right { text-align: right; }
.section-head { display:flex; align-items:end; justify-content:space-between; margin: 28px 0 14px; gap: 12px; }
.empty {
    text-align: center; padding: 50px 20px;
    color: var(--ink-soft); font-family: 'Inter', sans-serif;
}
.empty .ico { font-size: 2.6rem; margin-bottom: 10px; }

/* ───── Mobile ───── */
@media (max-width: 800px) {
    .body-app { grid-template-columns: 1fr; }
    .sidebar {
        position: static; height: auto; padding: 14px 18px;
        flex-direction: row; align-items: center; gap: 14px;
        overflow-x: auto; flex-wrap: nowrap;
    }
    .sidebar .brand { flex-shrink: 0; }
    .nav { flex-direction: row; gap: 4px; margin: 0; }
    .nav a { padding: 7px 10px; font-size: .88rem; white-space: nowrap; }
    .sidebar-foot { display: none; }
    .main { padding: 22px 18px 60px; }
    .cards.cols-2, .cards.cols-3, .cards.cols-4 { grid-template-columns: 1fr 1fr; }
    .field-row { grid-template-columns: 1fr; }
    .row { grid-template-columns: 32px 1fr auto; }
    .row .pill { grid-column: 2; margin-top: 4px; }
    h1 { font-size: 1.5rem; }
}
@media (max-width: 480px) {
    .cards.cols-2, .cards.cols-3, .cards.cols-4 { grid-template-columns: 1fr; }
}
