/* ============================================================
   Petstats — main.css
   Paleta cálida · Poppins · Componentes base
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    /* Colores principales */
    --color-primary:       #FF8C42;   /* naranja cálido */
    --color-primary-dark:  #E0722E;
    --color-primary-light: #FFB07A;
    --color-primary-bg:    #FFF4EC;

    --color-secondary:     #4ECDC4;   /* teal amigable */
    --color-secondary-dark:#3BA8A0;
    --color-secondary-bg:  #EDFAF9;

    --color-accent:        #FF6B6B;   /* coral para alertas/peligro */
    --color-accent-bg:     #FFEAEA;

    --color-success:       #6BCB77;
    --color-success-bg:    #EDFAEF;
    --color-warning:       #FFD166;
    --color-warning-bg:    #FFF9E6;

    /* Neutros */
    --color-bg:            #FAF8F5;   /* fondo general cálido */
    --color-surface:       #FFFFFF;
    --color-surface-2:     #F5F2EE;
    --color-border:        #EDE9E3;
    --color-border-strong: #D4CEC6;

    --color-text:          #2D2A26;
    --color-text-muted:    #8A8179;
    --color-text-light:    #B5B0A8;

    /* Sidebar */
    --sidebar-bg:          #1F1B18;
    --sidebar-text:        #C8C4BE;
    --sidebar-active-bg:   rgba(255, 140, 66, 0.15);
    --sidebar-active-text: #FF8C42;
    --sidebar-width:       240px;
    --sidebar-collapsed:   64px;

    /* Layout */
    --header-height:       60px;
    --radius-sm:           6px;
    --radius-md:           12px;
    --radius-lg:           20px;
    --radius-xl:           28px;

    /* Sombras */
    --shadow-xs:  0 1px 3px rgba(0,0,0,.06);
    --shadow-sm:  0 2px 8px rgba(0,0,0,.08);
    --shadow-md:  0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.12);

    /* Transiciones */
    --transition: .2s cubic-bezier(.4,0,.2,1);
    --transition-slow: .35s cubic-bezier(.4,0,.2,1);

    /* Categorías de notas */
    --cat-general:        #8B8FA8;
    --cat-medicina:       #FF6B6B;
    --cat-salud:          #6BCB77;
    --cat-tratamiento:    #4ECDC4;
    --cat-comportamiento: #FFD166;
    --cat-sintomatologia: #FF8C42;
    --cat-alimentacion:   #A78BFA;
    --cat-vacunas:        #60A5FA;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Poppins', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-dark); }

img { max-width: 100%; display: block; }

/* ── Tipografía ─────────────────────────────────────────────── */
h1 { font-size: 2rem;   font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem;   font-weight: 600; }

.text-muted  { color: var(--color-text-muted); }
.text-sm     { font-size: .875rem; }
.text-xs     { font-size: .75rem; }
.text-center { text-align: center; }
.font-semibold { font-weight: 600; }

/* ── Layout App ─────────────────────────────────────────────── */
.app-body {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-slow);
    min-height: 100vh;
}

.app-main {
    flex: 1;
    padding: 24px;
    padding-top: calc(var(--header-height) + 24px);
}

.module-container {
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeUp .3s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ─────────────────────────────────────────────────── */
.app-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    z-index: 201;
    transition: left var(--transition-slow);
    box-shadow: var(--shadow-xs);
}

.header__left  { display: flex; align-items: center; gap: 12px; }
.header__right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text);
}
.logo-paw  { font-size: 1.3rem; }
.logo-text { display: none; }

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.sidebar-toggle:hover { background: var(--color-surface-2); }
.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.header__breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .875rem;
    color: var(--color-text-muted);
}
.header__breadcrumb a { color: var(--color-text-muted); }
.header__breadcrumb a:hover { color: var(--color-primary); }
.bc-current { color: var(--color-text); font-weight: 500; }
.bc-sep { opacity: .5; }

.header-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    transition: background var(--transition), color var(--transition);
}
.header-btn:hover { background: var(--color-surface-2); color: var(--color-text); }

/* Avatar usuario */
.user-menu { position: relative; }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border: none;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition), box-shadow var(--transition);
}
.user-avatar:hover { transform: scale(1.05); box-shadow: 0 0 0 3px var(--color-primary-bg); }

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    overflow: hidden;
    animation: dropDown .15s ease;
}
@keyframes dropDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.user-dropdown__header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: .875rem;
}
.user-dropdown__item {
    display: block;
    padding: 10px 16px;
    font-size: .875rem;
    color: var(--color-text);
    transition: background var(--transition);
}
.user-dropdown__item:hover { background: var(--color-surface-2); color: var(--color-text); }
.user-dropdown__item--danger { color: var(--color-accent); }
.user-dropdown__item--danger:hover { background: var(--color-accent-bg); }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-slow), width var(--transition-slow);
    overflow: hidden;
}

.sidebar__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 0;
}

/* Scrollbar del sidebar */
.sidebar__inner::-webkit-scrollbar { width: 4px; }
.sidebar__inner::-webkit-scrollbar-track { background: transparent; }
.sidebar__inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* Logo en sidebar */
.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}
.sidebar__brand-icon { font-size: 1.4rem; }

.sidebar__nav {
    list-style: none;
    flex: 1;
    padding: 0 8px;
}

.sidebar__separator {
    padding: 16px 16px 6px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.3);
}
.sidebar__separator span { white-space: nowrap; }

.sidebar__item { border-radius: var(--radius-md); overflow: hidden; margin-bottom: 2px; }

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-size: .875rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.sidebar__link:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}
.sidebar__item.active .sidebar__link {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
}

.sidebar__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar__footer {
    padding: 12px 8px 0;
    border-top: 1px solid rgba(255,255,255,.07);
    margin-top: auto;
}
.sidebar__logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: rgba(255,255,255,.4);
    font-size: .8rem;
    transition: background var(--transition), color var(--transition);
}
.sidebar__logout:hover { background: rgba(255,255,255,.07); color: var(--color-accent); }

/* Overlay mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}
.sidebar-overlay.visible { opacity: 1; pointer-events: auto; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: 24px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-sm); }

.card--flat { box-shadow: none; }
.card--highlight { border-color: var(--color-primary); border-width: 2px; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* Stat cards */
.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-card__icon--orange { background: var(--color-primary-bg); }
.stat-card__icon--teal   { background: var(--color-secondary-bg); }
.stat-card__icon--red    { background: var(--color-accent-bg); }
.stat-card__icon--green  { background: var(--color-success-bg); }

.stat-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}
.stat-card__label { font-size: .8rem; color: var(--color-text-muted); }

/* ── Botones ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    line-height: 1;
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn--primary {
    background: var(--color-primary);
    color: #fff;
}
.btn--primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
    box-shadow: 0 4px 12px rgba(255,140,66,.35);
}

.btn--secondary {
    background: var(--color-surface-2);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.btn--secondary:hover:not(:disabled) { background: var(--color-border); }

.btn--teal {
    background: var(--color-secondary);
    color: #fff;
}
.btn--teal:hover:not(:disabled) { background: var(--color-secondary-dark); }

.btn--danger {
    background: var(--color-accent-bg);
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}
.btn--danger:hover:not(:disabled) { background: var(--color-accent); color: #fff; }

.btn--sm { padding: 6px 14px; font-size: .8rem; }
.btn--full { width: 100%; }
.btn--icon { padding: 8px; border-radius: var(--radius-sm); }

.btn.loading .btn__text::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    margin-left: 8px;
    animation: spin .7s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Formularios ─────────────────────────────────────────────── */
.field-group { margin-bottom: 18px; }

.field-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.field-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 12px;
    font-size: 1rem;
    pointer-events: none;
    line-height: 1;
}

.field-input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: .9rem;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.field-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255,140,66,.15);
}
.field-input::placeholder { color: var(--color-text-light); }

/* Sin ícono izquierdo */
.field-input.no-icon { padding-left: 12px; }

select.field-input { cursor: pointer; }

.toggle-pass {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
    line-height: 1;
    opacity: .5;
    transition: opacity var(--transition);
}
.toggle-pass:hover { opacity: 1; }

.form-error {
    background: var(--color-accent-bg);
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: .85rem;
    margin-bottom: 14px;
    animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.form-success {
    background: var(--color-success-bg);
    color: #3a8f44;
    border: 1px solid var(--color-success);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: .85rem;
    margin-bottom: 14px;
    animation: fadeIn .2s ease;
}

/* ── Tablas ──────────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

thead th {
    background: var(--color-surface-2);
    padding: 12px 16px;
    text-align: left;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--color-primary-bg); }

tbody td {
    padding: 12px 16px;
    vertical-align: middle;
}

/* Paginación */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-top: 1px solid var(--color-border);
    gap: 12px;
    flex-wrap: wrap;
}
.pagination__info { font-size: .8rem; color: var(--color-text-muted); }
.pagination__controls { display: flex; gap: 4px; align-items: center; }
.page-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: .8rem;
    font-family: inherit;
    transition: background var(--transition), border-color var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.page-btn:hover:not(:disabled) { background: var(--color-primary-bg); border-color: var(--color-primary); }
.page-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

.per-page-select {
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .8rem;
    cursor: pointer;
}

/* ── Tags / Badges ───────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Categorías de notas */
.badge--general        { background: rgba(139,143,168,.15); color: #5c5f75; }
.badge--medicina       { background: rgba(255,107,107,.15); color: #c0392b; }
.badge--salud          { background: rgba(107,203,119,.15); color: #27ae60; }
.badge--tratamiento    { background: rgba(78,205,196,.15);  color: #16a085; }
.badge--comportamiento { background: rgba(255,209,102,.15); color: #b7860b; }
.badge--sintomatologia { background: rgba(255,140,66,.15);  color: #c0632e; }
.badge--alimentacion   { background: rgba(167,139,250,.15); color: #7c3aed; }
.badge--vacunas        { background: rgba(96,165,250,.15);  color: #1d4ed8; }

/* ── Sección header ──────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.section-header__title h2 { font-size: 1.4rem; }
.section-header__title p  { font-size: .875rem; color: var(--color-text-muted); margin-top: 2px; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--color-text-muted);
}
.empty-state__icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state__title { font-size: 1.1rem; font-weight: 600; color: var(--color-text); margin-bottom: 8px; }
.empty-state__text  { font-size: .875rem; margin-bottom: 20px; }

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    font-size: .875rem;
    font-weight: 500;
    z-index: 9999;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
    opacity: 0;
    white-space: nowrap;
}
.toast--show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast--success { border-color: var(--color-success); }
.toast--error   { border-color: var(--color-accent); }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn .2s ease;
}
.modal {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: scaleIn .2s cubic-bezier(.34,1.56,.64,1);
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(.92); }
    to   { opacity: 1; transform: scale(1); }
}
.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal__title  { font-size: 1.1rem; font-weight: 600; }
.modal__close  {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--color-text-muted);
    padding: 4px;
    transition: color var(--transition);
}
.modal__close:hover { color: var(--color-accent); }
.modal__footer { margin-top: 20px; display: flex; gap: 10px; justify-content: flex-end; }

/* ── Utilidades ──────────────────────────────────────────────── */
.hidden { display: none !important; }
.mt-4   { margin-top: 16px; }
.mt-6   { margin-top: 24px; }
.mb-4   { margin-bottom: 16px; }
.gap-2  { gap: 8px; }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

/* Spinner standalone */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 24px auto;
}

/* ── Sidebar colapsable (desktop) ───────────────────────────── */
body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}
body.sidebar-collapsed .app-shell {
    margin-left: 0;
}
body.sidebar-collapsed .app-header {
    left: 0;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay { display: block; }

    .app-shell {
        margin-left: 0;
    }
    .app-header {
        left: 0;
    }
    .app-main { padding: 16px; padding-top: calc(var(--header-height) + 16px); }

    .card-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .card-grid { grid-template-columns: 1fr; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .pagination { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 769px) {
    .logo-text { display: inline; }
}

/* ── Dashboard ───────────────────────────────────────────────── */
.dashboard-greeting {
    margin-bottom: 24px;
}
.dashboard-greeting h2 { font-size: 1.5rem; }

.stat-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

@keyframes shimmer {
    from { background-position: -400px 0; }
    to   { background-position: 400px 0; }
}
.stat-card--skeleton .stat-card__value {
    width: 48px; height: 28px; border-radius: 6px;
    background: linear-gradient(90deg, #f0ece8 25%, #e8e3de 50%, #f0ece8 75%);
    background-size: 400px 100%;
    animation: shimmer 1.2s infinite;
}

/* Mascotas grid */
.pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.pet-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: box-shadow var(--transition), transform var(--transition);
}
.pet-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }

.pet-card__avatar {
    width: 48px; height: 48px;
    background: var(--color-primary-bg);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}
.pet-card__info { flex: 1; min-width: 0; }
.pet-card__name { font-weight: 600; font-size: .95rem; }
.pet-card__weight { text-align: right; flex-shrink: 0; }
.pet-card__weight-val { display: block; font-weight: 700; font-size: 1rem; color: var(--color-primary); }

/* Dashboard bottom grid */
.dashboard-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Activity items */
.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}
.activity-item:last-child { border-bottom: none; }

.activity-item__avatar {
    width: 36px; height: 36px;
    background: var(--color-primary-bg);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.activity-item__body { flex: 1; min-width: 0; }
.activity-item__title {
    font-size: .875rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.activity-item__meta { margin-top: 2px; }
.activity-item__value { font-weight: 700; font-size: .95rem; color: var(--color-secondary-dark); white-space: nowrap; }

/* Quick access */
.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.quick-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
    text-decoration: none;
    color: var(--color-text);
}
.quick-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
    border-color: var(--color-primary);
    color: var(--color-text);
}
.quick-card__icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.quick-card__body { flex: 1; }
.quick-card__title { font-weight: 600; font-size: .9rem; }
.quick-card__sub   { font-size: .78rem; color: var(--color-text-muted); margin-top: 2px; }
.quick-card__arrow { font-size: 1.3rem; color: var(--color-text-light); transition: transform var(--transition); }
.quick-card:hover .quick-card__arrow { transform: translateX(3px); color: var(--color-primary); }

@media (max-width: 768px) {
    .dashboard-bottom { grid-template-columns: 1fr; }
    .quick-access-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .quick-access-grid { grid-template-columns: 1fr; }
}

/* ── Módulo Mascotas ─────────────────────────────────────────── */
.mascotas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.mascota-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow var(--transition), transform var(--transition);
}
.mascota-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.mascota-card--archived { opacity: .6; }

.mascota-card__avatar {
    width: 56px; height: 56px;
    background: var(--color-primary-bg);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}
.mascota-card__body { flex: 1; min-width: 0; }
.mascota-card__name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.mascota-card__meta {
    display: flex; flex-wrap: wrap; gap: 6px;
    font-size: .78rem; color: var(--color-text-muted);
}
.mascota-card__meta span::after { content: '·'; margin-left: 6px; }
.mascota-card__meta span:last-child::after { content: ''; }

.mascota-card__actions {
    display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
}

/* Formulario en dos columnas */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.required { color: var(--color-accent); }

@media (max-width: 480px) {
    .field-row { grid-template-columns: 1fr; }
    .mascota-card { flex-wrap: wrap; }
    .mascota-card__actions { flex-direction: row; width: 100%; }
}

/* ── Módulo Peso ─────────────────────────────────────────────── */
.filters-bar__inner {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}

.range-tabs {
    display: flex;
    gap: 4px;
    background: var(--color-surface-2);
    border-radius: var(--radius-md);
    padding: 4px;
}
.range-tab {
    padding: 5px 12px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}
.range-tab[aria-pressed="true"] {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-xs);
}
.range-tab:hover:not([aria-pressed="true"]) { color: var(--color-text); }

textarea.field-input { padding-top: 10px; line-height: 1.5; }

/* ── Módulo Notas ────────────────────────────────────────────── */
.notas-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    min-height: 28px;
}

.notas-timeline { display: flex; flex-direction: column; gap: 24px; }

.timeline-group {}

.timeline-date-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-text-muted);
    margin-bottom: 10px;
    padding-left: 4px;
}

.timeline-items { display: flex; flex-direction: column; gap: 10px; }

/* Nota card */
.nota-card {
    display: flex;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}
.nota-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.nota-card__accent {
    width: 4px;
    flex-shrink: 0;
    border-radius: 4px 0 0 4px;
}
.nota-accent--general        { background: var(--cat-general); }
.nota-accent--medicina       { background: var(--cat-medicina); }
.nota-accent--salud          { background: var(--cat-salud); }
.nota-accent--tratamiento    { background: var(--cat-tratamiento); }
.nota-accent--comportamiento { background: var(--cat-comportamiento); }
.nota-accent--sintomatologia { background: var(--cat-sintomatologia); }
.nota-accent--alimentacion   { background: var(--cat-alimentacion); }
.nota-accent--vacunas        { background: var(--cat-vacunas); }

.nota-card__body { flex: 1; padding: 16px; }

.nota-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.nota-pet-tag {
    font-size: .72rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    padding: 2px 8px;
}
.nota-pet-tag--general { opacity: .6; }

.nota-card__title {
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text);
}

.nota-card__content {
    line-height: 1.6;
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.nota-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.nota-card__actions { display: flex; gap: 6px; }

@media (max-width: 480px) {
    .nota-card__footer { flex-direction: column; align-items: flex-start; }
    .filters-bar__inner { flex-direction: column; }
}

/* ── Módulo Glucosa / Insulina ───────────────────────────────── */
.gi-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.gi-chart-label { margin-bottom: 12px; }

.gi-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: .78rem;
    font-weight: 600;
}
.gi-badge--glucose { background: rgba(255,140,66,.15); color: #c0632e; }
.gi-badge--insulin { background: rgba(78,205,196,.15);  color: #16a085; }

.gi-value { font-weight: 600; font-size: .9rem; }
.gi-value--glucose { color: var(--color-primary-dark); }
.gi-value--insulin { color: var(--color-secondary-dark); }
.gi-value small    { font-weight: 400; font-size: .75rem; color: var(--color-text-muted); }

@media (max-width: 768px) {
    .gi-charts-grid { grid-template-columns: 1fr; }
}


/* ── Medicamentos / Vacunas ────────────────────────────── */
.badge--suplemento     { background: var(--color-success-bg); color: var(--color-success); }
.badge--medicamento    { background: var(--color-primary-bg); color: var(--color-primary-dark); }
.badge--desparasitante { background: var(--color-secondary-bg); color: var(--color-secondary-dark); }
.badge--overdue        { background: var(--color-accent-bg); color: var(--color-accent); }
.badge--upcoming       { background: var(--color-warning-bg); color: #b45309; }

/* ── Pet Detail ─────────────────────────────────────────── */
.pet-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
    padding: 28px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}
.pet-hero__avatar {
    width: 96px; height: 96px;
    border-radius: 50%;
    background: var(--color-primary-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.8rem;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}
.pet-hero__avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.pet-hero__avatar-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.4);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
    font-size: .7rem; color: #fff; font-weight: 600;
}
.pet-hero__avatar:hover .pet-hero__avatar-overlay { opacity: 1; }
.pet-hero__info { flex: 1; }
.pet-hero__name { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.pet-hero__meta { color: var(--color-text-muted); font-size: .875rem; }

/* Tabs */
.pet-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--color-border); }
.pet-tab {
    padding: 10px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: .875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color var(--transition), border-color var(--transition);
}
.pet-tab:hover { color: var(--color-text); }
.pet-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.pet-tab-panel { display: none; }
.pet-tab-panel.active { display: block; }

/* Mascota card clickable */
.mascota-card { cursor: pointer; transition: box-shadow var(--transition), transform var(--transition); }
.mascota-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
