/* ============================================================
   PETAGENDA — Design System
   Fork do design system Grajaú Notícias, adaptado para PetAgenda.
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    /* === Brand Colors (Pet-friendly: violet + teal) === */
    --color-brand-primary: #7C3AED;
    --color-brand-primary-dark: #5B21B6;
    --color-brand-primary-light: #A78BFA;
    --color-brand-accent: #14B8A6;
    --color-brand-accent-dark: #0D9488;
    --color-brand-accent-light: #5EEAD4;

    /* === Neutral Palette (Light Mode Default) === */
    --color-bg-primary: #F5F3FF;
    --color-bg-secondary: #FFFFFF;
    --color-bg-tertiary: #FAF5FF;
    --color-bg-card: #FFFFFF;
    --color-bg-card-hover: #F9F5FF;
    --color-bg-elevated: #FFFFFF;
    --color-bg-input: #FFFFFF;
    --color-bg-overlay: rgba(0, 0, 0, 0.4);
    --color-bg-sidebar: #FAFAFE;

    --color-border: #E9E5F5;
    --color-border-hover: #D8D2EA;
    --color-border-focus: var(--color-brand-primary);

    /* === Typography & Specifics (Light Mode Default) === */
    --color-text-primary: #1E1B4B;
    --color-text-secondary: #4C4577;
    --color-text-tertiary: #7C76A3;
    --color-text-inverse: #FFFFFF;
    --color-text-link: var(--color-brand-primary);
    --color-text-link-hover: var(--color-brand-primary-dark);
}

/* ============================================================
   DARK THEME VARIABLES
   ============================================================ */
[data-theme="dark"] {
    --color-bg-primary: #0C0A1D;
    --color-bg-secondary: #13112A;
    --color-bg-tertiary: #1A1736;
    --color-bg-card: #171433;
    --color-bg-card-hover: #1E1B42;
    --color-bg-elevated: #211E4A;
    --color-bg-input: #171433;
    --color-bg-overlay: rgba(0, 0, 0, 0.6);
    --color-bg-sidebar: #0F0D22;

    --color-border: rgba(124, 58, 237, 0.15);
    --color-border-hover: rgba(124, 58, 237, 0.25);
    
    --color-text-primary: #F0EDFF;
    --color-text-secondary: #A9A2D0;
    --color-text-tertiary: #6E679A;
    --color-text-inverse: #0C0A1D;
    --color-text-link: var(--color-brand-primary-light);
    --color-text-link-hover: var(--color-brand-primary);
}

:root {
    /* === Status Colors === */
    --color-status-pendente: #F59E0B;
    --color-status-confirmado: #3B82F6;
    --color-status-em-andamento: #8B5CF6;
    --color-status-concluido: #10B981;
    --color-status-cancelado: #EF4444;

    /* === Service Colors (for calendar) === */
    --svc-hospedagem: #7C3AED;
    --svc-daycare: #3B82F6;
    --svc-banho-tosa: #14B8A6;
    --svc-adestramento: #F59E0B;
    --svc-veterinario: #EF4444;
    --svc-passeio: #10B981;

    /* === Semantic Colors === */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #3B82F6;

    /* === Typography === */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-lg: 1.125rem;
    --text-xl: 1.3125rem;
    --text-2xl: 1.625rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3.25rem;

    --leading-tight: 1.2;
    --leading-snug: 1.35;
    --leading-normal: 1.6;

    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-black: 900;

    /* === Spacing === */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* === Border Radius === */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* === Shadows === */
    --shadow-sm: 0 1px 3px rgba(124, 58, 237, 0.08);
    --shadow-md: 0 4px 12px rgba(124, 58, 237, 0.12);
    --shadow-lg: 0 8px 30px rgba(124, 58, 237, 0.15);
    --shadow-xl: 0 16px 50px rgba(124, 58, 237, 0.2);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.3);
    --shadow-glow-accent: 0 0 20px rgba(20, 184, 166, 0.3);

    /* === Transitions === */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* === Layout === */
    --max-width: 1440px;
    --sidebar-width: 280px;
    --header-height: 64px;

    /* === Z-index === */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-sidebar: 250;
    --z-overlay: 300;
    --z-modal: 400;
    --z-toast: 500;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body:has(.modal-overlay.active),
body:has(.sidebar-overlay.active) {
    overflow: hidden;
}

a {
    color: var(--color-text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-text-link-hover);
}

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

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: var(--leading-tight);
    font-weight: var(--weight-bold);
    color: var(--color-text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

.text-gradient {
    background: linear-gradient(135deg, var(--color-brand-primary-light), var(--color-brand-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================
   COMPONENTS: BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    line-height: 1;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    white-space: nowrap;
    text-decoration: none;
}

.btn--primary {
    background: linear-gradient(135deg, var(--color-brand-primary), var(--color-brand-primary-dark));
    color: #fff;
    box-shadow: var(--shadow-sm), 0 0 0 0 rgba(124, 58, 237, 0);
}

.btn--primary:hover {
    background: linear-gradient(135deg, var(--color-brand-primary-light), var(--color-brand-primary));
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: translateY(-1px);
    color: #fff;
}

.btn--secondary {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn--secondary:hover {
    background: var(--color-bg-elevated);
    border-color: var(--color-border-hover);
    transform: translateY(-1px);
}

.btn--accent {
    background: linear-gradient(135deg, var(--color-brand-accent), var(--color-brand-accent-dark));
    color: #fff;
}

.btn--accent:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--shadow-glow-accent);
    color: #fff;
}

.btn--danger {
    background: linear-gradient(135deg, var(--color-error), #DC2626);
    color: #fff;
}

.btn--danger:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 0 20px rgba(239, 68, 68, 0.3);
    color: #fff;
}

.btn--ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid transparent;
}

.btn--ghost:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

.btn--sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

.btn--lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
}

.btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
}

.btn--block {
    width: 100%;
}

/* ============================================================
   COMPONENTS: CARDS
   ============================================================ */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    background: var(--color-bg-card-hover);
    border-color: var(--color-border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card--static:hover {
    transform: none;
    box-shadow: none;
}

.card__body {
    padding: var(--space-5);
}

.card__title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    line-height: var(--leading-snug);
    margin-bottom: var(--space-2);
}

/* Stat card */
.stat-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-brand-primary), var(--color-brand-accent));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: var(--space-3);
}

.stat-card__value {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: var(--weight-black);
    line-height: 1;
    margin-bottom: var(--space-1);
}

.stat-card__label {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    font-weight: var(--weight-medium);
}

/* ============================================================
   COMPONENTS: BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

.badge--pendente { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.badge--confirmado { background: rgba(59, 130, 246, 0.15); color: #3B82F6; }
.badge--em-andamento { background: rgba(139, 92, 246, 0.15); color: #8B5CF6; }
.badge--concluido { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.badge--cancelado { background: rgba(239, 68, 68, 0.15); color: #EF4444; }

.badge--species {
    background: rgba(124, 58, 237, 0.1);
    color: var(--color-brand-primary);
    text-transform: none;
}

/* ============================================================
   COMPONENTS: FORMS
   ============================================================ */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-brand-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237C76A3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    margin-top: var(--space-1);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--color-error);
    margin-top: var(--space-1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Checkbox / Toggle */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    font-size: var(--text-sm);
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-brand-primary);
    cursor: pointer;
}

/* ============================================================
   COMPONENTS: TOAST / ALERTS
   ============================================================ */
.toast-container {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 420px;
    animation: toast-in var(--transition-spring) forwards;
}

.toast--success { border-left: 3px solid var(--color-success); }
.toast--error { border-left: 3px solid var(--color-error); }
.toast--warning { border-left: 3px solid var(--color-warning); }
.toast--info { border-left: 3px solid var(--color-info); }

.toast__message {
    flex: 1;
    font-size: var(--text-sm);
}

.toast__close {
    font-size: var(--text-lg);
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.toast__close:hover {
    opacity: 1;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.toast--out {
    animation: toast-out var(--transition-base) forwards;
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ============================================================
   COMPONENTS: SKELETON LOADING
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg,
        var(--color-bg-tertiary) 25%,
        var(--color-bg-elevated) 50%,
        var(--color-bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton--text {
    height: 14px;
    margin-bottom: var(--space-2);
}

.skeleton--title {
    height: 24px;
    width: 80%;
    margin-bottom: var(--space-3);
}

/* ============================================================
   COMPONENTS: MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-bg-overlay);
    backdrop-filter: blur(6px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-spring);
}

.modal__body,
.modal > form {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.modal > form {
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.modal__title {
    font-size: var(--text-xl);
}

.modal__close {
    font-size: var(--text-xl);
    opacity: 0.5;
    transition: opacity var(--transition-fast);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.modal__close:hover {
    opacity: 1;
    background: var(--color-bg-tertiary);
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-border);
}

/* Mobile: bottom-sheet entrance animation (override desktop scale) */
@media (max-width: 768px) {
    .modal {
        transform: translateY(100%);
        transition: transform var(--transition-spring);
    }

    .modal-overlay.active .modal {
        transform: translateY(0);
    }
}


/* ============================================================
   COMPONENTS: TABLE
   ============================================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-3) var(--space-4);
    border-bottom: 2px solid var(--color-border);
}

.data-table td {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: var(--color-bg-card-hover);
}

.data-table__actions {
    display: flex;
    gap: var(--space-2);
}

/* ============================================================
   COMPONENTS: PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-8);
}

.pagination__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-3);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.pagination__btn:hover {
    background: var(--color-bg-elevated);
    color: var(--color-text-primary);
    border-color: var(--color-border-hover);
}

.pagination__btn.active {
    background: var(--color-brand-primary);
    color: #fff;
    border-color: var(--color-brand-primary);
}

.pagination__btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}

.pagination__info {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    padding: 0 var(--space-2);
    white-space: nowrap;
}

/* ============================================================
   COMPONENTS: SEARCH BAR
   ============================================================ */
.search-bar {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-bar__input {
    width: 100%;
    padding: var(--space-3) var(--space-4) var(--space-3) 40px;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    color: var(--color-text-primary);
    transition: all var(--transition-fast);
    font-size: var(--text-sm);
}

.search-bar__input:focus {
    outline: none;
    border-color: var(--color-brand-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.search-bar__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-tertiary);
    font-size: 14px;
    pointer-events: none;
}

/* ============================================================
   COMPONENTS: EMPTY STATE
   ============================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-16) var(--space-8);
    text-align: center;
}

.empty-state__icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state__title {
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-2);
}

.empty-state__desc {
    color: var(--color-text-tertiary);
    font-size: var(--text-sm);
    max-width: 360px;
    margin-bottom: var(--space-6);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }

.font-bold { font-weight: var(--weight-bold); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-medium { font-weight: var(--weight-medium); }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.hidden { display: none !important; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-bg-elevated);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-tertiary);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.animate-fade-in { animation: fadeIn var(--transition-base) forwards; }
.animate-slide-up { animation: slideUp var(--transition-slow) forwards; }
.animate-slide-left { animation: slideInLeft var(--transition-slow) forwards; }

/* ============================================================
   ACESSIBILIDADE — Foco visível por teclado (WCAG 2.1 AA)
   :focus-visible garante outline apenas para navegação por teclado,
   sem impactar a estética de usuários que utilizam mouse/touch.
   ============================================================ */

/* Remove outline padrão do browser em TODOS os elementos */
*:focus {
    outline: none;
}

/* Reaplica outline APENAS quando navegado pelo teclado */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--color-brand-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.18);
}

/* Casos especiais: botões já têm background — usar ring interno */
.btn:focus-visible {
    outline: 3px solid var(--color-brand-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(124, 58, 237, 0.22);
}

/* Sidebar e bottom nav — foco mais sutil */
.sidebar-nav__item:focus-visible,
.mobile-bottom-nav__item:focus-visible {
    outline: 2px solid var(--color-brand-primary-light);
    outline-offset: 1px;
    border-radius: var(--radius-md);
}

/* Inputs já têm estilo de foco — apenas reforça o outline visível */
.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--color-brand-primary);
    outline-offset: 0;
}
