﻿/* ============================================================
   Cloudy — Base (mobile-first)
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--cl-font);
    font-size: var(--cl-fs-md);
    line-height: 1.5;
    color: var(--cl-text);
    background: var(--cl-bg);
    overflow-x: hidden;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 0.75rem;
}

h1 {
    font-size: 1.5rem;
}

h2 {
    font-size: 1.3rem;
}

h3 {
    font-size: 1.15rem;
}

h4 {
    font-size: 1.05rem;
}

h5 {
    font-size: 0.95rem;
}

a {
    color: var(--cl-brand-500);
    text-decoration: none;
    transition: color var(--cl-t);
}

    a:hover {
        color: var(--cl-brand-600);
    }

/* Tipografía fluida en desktop */
@media (min-width: 992px) {
    body {
        font-size: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }
}

/* Utilidades de texto */
small, .small {
    font-size: var(--cl-fs-sm);
}

.text-muted {
    color: var(--cl-text-muted) !important;
}

/* Botones — touch targets cómodos en móvil */
.btn {
    min-height: var(--cl-touch);
    padding: 0.5rem 1rem;
    border-radius: var(--cl-radius-sm);
    font-weight: 500;
    transition: transform var(--cl-t-fast), box-shadow var(--cl-t-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

    .btn:active {
        transform: scale(0.98);
    }

.btn-sm {
    min-height: 34px;
    padding: 0.35rem 0.75rem;
    font-size: var(--cl-fs);
}

.btn-lg {
    min-height: 48px;
    padding: 0.7rem 1.4rem;
    font-size: var(--cl-fs-md);
}

/* Formularios — altura táctil */
.form-control, .form-select {
    min-height: var(--cl-touch);
    border-radius: var(--cl-radius-sm);
    font-size: var(--cl-fs);
    border: 1px solid var(--cl-border);
    transition: border-color var(--cl-t), box-shadow var(--cl-t);
}

    .form-control:focus, .form-select:focus {
        border-color: var(--cl-brand-500);
        box-shadow: 0 0 0 3px rgba(13,110,253,0.12);
    }

.form-control-sm, .form-select-sm {
    min-height: 34px;
    font-size: var(--cl-fs-sm);
}

.form-label {
    font-size: var(--cl-fs-sm);
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.2rem;
}

.form-text {
    font-size: var(--cl-fs-xs);
    color: var(--cl-text-muted);
}

/* Focus accesible sin reventar el look */
:focus-visible {
    outline: 2px solid var(--cl-brand-500);
    outline-offset: 2px;
    border-radius: var(--cl-radius-xs);
}

/* Scrollbar sutil en desktop */
@media (min-width: 992px) {
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    ::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

        ::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

    ::-webkit-scrollbar-track {
        background: transparent;
    }
}

/* Respeto a reduce-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
/* ============================================================
   Cloudy — Botones (estilo Fluent / Azure)
   ============================================================ */

.btn {
    font-family: var(--cl-font);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.005em;
    padding: 0.45rem 0.9rem;
    min-height: 36px;
    border-radius: 6px;
    border: 1px solid transparent;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    line-height: 1;
    transition: background-color var(--cl-t-fast), border-color var(--cl-t-fast), color var(--cl-t-fast), box-shadow var(--cl-t-fast), transform var(--cl-t-fast);
}

    .btn:active {
        transform: translateY(1px);
    }

    .btn:focus-visible {
        outline: 2px solid var(--cl-brand-500);
        outline-offset: 2px;
    }

.btn-sm {
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
    min-height: 32px;
    border-radius: 6px;
}

.btn-lg {
    font-size: 0.95rem;
    padding: 0.6rem 1.2rem;
    min-height: 44px;
    border-radius: 8px;
}

/* Primary */
.btn-primary {
    background: var(--cl-brand-500);
    border-color: var(--cl-brand-500);
    color: #fff;
    box-shadow: 0 1px 2px rgba(13,110,253,0.18);
}

    .btn-primary:hover {
        background: var(--cl-brand-600);
        border-color: var(--cl-brand-600);
        color: #fff;
        box-shadow: 0 4px 12px rgba(13,110,253,0.22);
    }

/* Secondary (outline) */
.btn-outline-secondary,
.btn-secondary {
    background: #fff;
    border: 1px solid var(--cl-border);
    color: var(--cl-text);
}

    .btn-outline-secondary:hover,
    .btn-secondary:hover {
        background: var(--cl-surface-2);
        border-color: #cbd5e1;
        color: var(--cl-text);
    }

/* Outline primary */
.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--cl-brand-500);
    color: var(--cl-brand-500);
}

    .btn-outline-primary:hover {
        background: var(--cl-brand-50);
        color: var(--cl-brand-600);
        border-color: var(--cl-brand-600);
    }

/* Outline danger */
.btn-outline-danger {
    background: transparent;
    border: 1px solid #fecaca;
    color: var(--cl-danger);
}

    .btn-outline-danger:hover {
        background: #fef2f2;
        border-color: var(--cl-danger);
        color: #b91c1c;
    }

/* Outline warning */
.btn-outline-warning {
    background: transparent;
    border: 1px solid #fde68a;
    color: #92400e;
}

    .btn-outline-warning:hover {
        background: #fffbeb;
        border-color: var(--cl-warning);
        color: #78350f;
    }

/* Outline success */
.btn-outline-success {
    background: transparent;
    border: 1px solid #bbf7d0;
    color: var(--cl-success);
}

    .btn-outline-success:hover {
        background: #f0fdf4;
        border-color: var(--cl-success);
        color: #14532d;
    }

/* Light (útil en headers) */
.btn-light {
    background: #fff;
    border: 1px solid var(--cl-border);
    color: var(--cl-text);
}

    .btn-light:hover {
        background: var(--cl-surface-2);
        border-color: #cbd5e1;
        color: var(--cl-text);
    }

/* Quitar el redondeo pill que sobra en botones de toolbar */
.btn.rounded-pill {
    border-radius: var(--cl-radius-pill) !important;
}

/* Botón icon-only (acciones de tabla) */
.btn-icon-only {
    padding: 0;
    width: 32px;
    height: 32px;
    min-height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .btn-icon-only i {
        font-size: 0.95rem;
    }