/* =============================================================
   FTH Salon Standalone — Sistema de diseño visual
   Paleta: navy / cream / coral / teal / gold
   No frameworks. Vanilla CSS con prefijo fth-.
   ============================================================= */

/* ---------- Tipografía (Inter desde CDN, fallback sistema) ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Paleta principal */
    --fth-navy:   #1e293b;
    --fth-cream:  #faf7f2;
    --fth-coral:  #d96f5a;
    --fth-teal:   #007a8c;
    --fth-gold:   #b48a3a;

    /* Escala de grises */
    --fth-ink:    #1c2230;
    --fth-text:   #5b6577;
    --fth-muted:  #8a93a5;
    --fth-line:   #e6e8ef;
    --fth-card:   #ffffff;
    --fth-bg:     #f4f1ec;
    --fth-surface:#fafbfd;

    /* Semánticos */
    --fth-danger: #b03434;
    --fth-ok:     #1f7a3a;
    --fth-warn:   #8a6311;

    /* Acentos por módulo (derivados del teal) */
    --fth-accent-pos:         #007a8c;
    --fth-accent-appointments:#2a7a6e;
    --fth-accent-clients:     #5a7a9c;
    --fth-accent-inventory:   #7a6e2a;
    --fth-accent-reports:     #4a6b5a;

    /* Geometría */
    --fth-radius:    10px;
    --fth-radius-sm: 6px;
    --fth-radius-lg: 14px;
    --fth-shadow:    0 1px 2px rgba(28, 34, 48, .06), 0 4px 12px rgba(28, 34, 48, .04);
    --fth-shadow-md: 0 2px 4px rgba(28, 34, 48, .06), 0 8px 24px rgba(28, 34, 48, .06);
    --fth-shadow-lg: 0 4px 8px rgba(28, 34, 48, .08), 0 16px 48px rgba(28, 34, 48, .08);

    /* Espaciado */
    --fth-space-xs: 4px;
    --fth-space-sm: 8px;
    --fth-space-md: 14px;
    --fth-space-lg: 22px;
    --fth-space-xl: 32px;

    /* Tipografía */
    --fth-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --fth-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--fth-bg);
    color: var(--fth-ink);
    font-family: var(--fth-font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--fth-teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Topbar ---------- */
.fth-topbar {
    background: var(--fth-navy);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.fth-topbar__inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.fth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}
.fth-brand:hover { text-decoration: none; }
.fth-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--fth-gold);
    color: var(--fth-navy);
    border-radius: var(--fth-radius-sm);
    font-size: 13px;
    letter-spacing: .5px;
    font-weight: 700;
}
.fth-brand__name { font-size: 15px; letter-spacing: .3px; }

/* ---------- Nav ---------- */
.fth-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.fth-nav a { color: #fff; opacity: .85; }
.fth-nav a:hover { opacity: 1; }
.fth-nav__link {
    color: rgba(255,255,255,.85);
    font-size: 13px;
    padding: 5px 10px;
    border-radius: var(--fth-radius-sm);
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.fth-nav__link:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.fth-nav__link--active { color: #fff; background: rgba(0, 122, 140, .45); }
.fth-nav__sep { color: rgba(255,255,255,.35); margin: 0 4px; font-size: 12px; }
.fth-nav__user { color: rgba(255,255,255,.65); font-size: 12px; margin: 0 4px; font-weight: 500; }
.fth-nav__logout { color: var(--fth-coral) !important; }

/* ---------- Main + Footer ---------- */
.fth-main {
    max-width: 1140px;
    margin: 0 auto;
    padding: 28px 20px 80px;
}
.fth-footer {
    border-top: 1px solid var(--fth-line);
    background: #fff;
    margin-top: auto;
}
.fth-footer__inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 16px 20px;
    color: var(--fth-muted);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- Flash messages ---------- */
.fth-flash {
    padding: 12px 16px;
    border-radius: var(--fth-radius);
    margin-bottom: 18px;
    font-size: 14px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}
.fth-flash::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
}
.fth-flash--error   { background: #fdecea; color: var(--fth-danger); border-color: #f5c2c0; }
.fth-flash--error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b03434' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
}
.fth-flash--success { background: #e8f5ec; color: var(--fth-ok);     border-color: #b6dfc1; }
.fth-flash--success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f7a3a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
.fth-flash--info    { background: #e8f0f6; color: #1e4d6b;             border-color: #bcd5e6; }
.fth-flash--info::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e4d6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E");
}

/* ---------- Cards / tiles / forms ---------- */
.fth-card {
    background: var(--fth-card);
    border: 1px solid var(--fth-line);
    border-radius: var(--fth-radius);
    box-shadow: var(--fth-shadow);
    padding: var(--fth-space-lg);
    transition: box-shadow .2s ease, transform .15s ease;
}
.fth-card:hover { box-shadow: var(--fth-shadow-md); }

/* Auth / Login */
.fth-auth { display: flex; justify-content: center; padding: 48px 16px; min-height: 70vh; align-items: center; }
.fth-auth__card { width: 100%; max-width: 400px; }
.fth-auth__title { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.fth-auth__sub   { margin: 0 0 22px; color: var(--fth-text); font-size: 14px; }

/* Forms */
.fth-form { display: flex; flex-direction: column; gap: var(--fth-space-md); }
.fth-form__label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--fth-text); font-weight: 500; }
.fth-form__label > span:first-child { color: var(--fth-ink); font-weight: 500; }
.fth-form__label input,
.fth-form__label select,
.fth-form__label textarea {
    padding: 10px 12px;
    border: 1px solid var(--fth-line);
    border-radius: var(--fth-radius-sm);
    font-size: 14px;
    background: #fff;
    color: var(--fth-ink);
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.fth-form__label input:focus,
.fth-form__label select:focus,
.fth-form__label textarea:focus {
    outline: none;
    border-color: var(--fth-teal);
    box-shadow: 0 0 0 3px rgba(0, 122, 140, .12);
}
.fth-form__label input::placeholder,
.fth-form__label textarea::placeholder { color: var(--fth-muted); }

.fth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--fth-radius-sm);
    border: 1px solid transparent;
    background: var(--fth-navy);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
    transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
}
.fth-btn:hover { background: #2c3e57; text-decoration: none; }
.fth-btn:active { transform: translateY(1px); }
.fth-btn--primary { background: var(--fth-teal); }
.fth-btn--primary:hover { background: #006676; }
.fth-btn--danger  { background: var(--fth-danger); }
.fth-btn--danger:hover { background: #8a2828; }
.fth-btn--ghost   { background: transparent; color: var(--fth-ink); border-color: var(--fth-line); }
.fth-btn--ghost:hover { background: var(--fth-surface); border-color: var(--fth-line); }
.fth-btn--gold { background: var(--fth-gold); color: #fff; }
.fth-btn--gold:hover { background: #9a7530; }
.fth-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Dashboard ---------- */
.fth-dashboard__header h1 { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -0.4px; }
.fth-dashboard__sub { margin: 0 0 24px; color: var(--fth-text); font-size: 14px; }
.fth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}
.fth-tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px;
    background: var(--fth-card);
    border: 1px solid var(--fth-line);
    border-radius: var(--fth-radius);
    color: var(--fth-ink);
    box-shadow: var(--fth-shadow);
    transition: transform .15s ease, border-color .15s ease, box-shadow .2s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.fth-tile:hover {
    transform: translateY(-2px);
    border-color: var(--fth-teal);
    box-shadow: var(--fth-shadow-md);
    text-decoration: none;
}
.fth-tile__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--fth-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.fth-tile__icon svg { width: 20px; height: 20px; }
.fth-tile__label { font-weight: 600; font-size: 15px; }
.fth-tile__hint  { color: var(--fth-text); font-size: 12px; line-height: 1.4; }

/* ---------- Page header + actions ---------- */
.fth-page__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 12px;
    flex-wrap: wrap;
}
.fth-page__title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.3px; }
.fth-page__sub   { margin: 6px 0 0; color: var(--fth-text); font-size: 13px; }
.fth-page__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fth-page__actions .fth-btn { padding: 8px 14px; font-size: 13px; }

/* ---------- Data tables ---------- */
.fth-table-wrap { border: 1px solid var(--fth-line); border-radius: var(--fth-radius); overflow: hidden; background: var(--fth-card); box-shadow: var(--fth-shadow); }
.fth-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.fth-table th, .fth-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--fth-line);
    vertical-align: top;
}
.fth-table th {
    background: var(--fth-surface);
    font-weight: 600;
    color: var(--fth-text);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}
.fth-table tbody tr { transition: background .1s ease; }
.fth-table tbody tr:hover { background: #f6f8fb; }
.fth-table tbody tr:last-child td { border-bottom: 0; }
.fth-table a { font-weight: 500; }

/* Empty state dentro de tabla */
.fth-table__empty {
    padding: 40px 28px;
    text-align: center;
    color: var(--fth-text);
    font-size: 14px;
    line-height: 1.6;
}
.fth-table__empty strong { color: var(--fth-ink); display: block; margin-bottom: 6px; font-size: 15px; }

/* ---------- Empty state standalone ---------- */
.fth-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--fth-text);
}
.fth-empty__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    color: var(--fth-muted);
}
.fth-empty__title { font-size: 16px; font-weight: 600; color: var(--fth-ink); margin: 0 0 6px; }
.fth-empty__text  { font-size: 14px; margin: 0 0 16px; max-width: 360px; margin-left: auto; margin-right: auto; }

/* ---------- Status badges ---------- */
.fth-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1.3;
}
.fth-badge--scheduled  { background: #e8f0f6; color: #1e4d6b; border-color: #bcd5e6; }
.fth-badge--confirmed  { background: #e8f5ec; color: #1f7a3a; border-color: #b6dfc1; }
.fth-badge--in_progress{ background: #fff3d6; color: #8a6311; border-color: #f0d99a; }
.fth-badge--completed  { background: #ece8f5; color: #4a3272; border-color: #cfc4e0; }
.fth-badge--cancelled  { background: #f5e0e0; color: #8a2a2a; border-color: #e0bcbc; }
.fth-badge--no_show    { background: #ececec; color: #555;    border-color: #c8c8c8; }
.fth-badge--active     { background: #e8f5ec; color: #1f7a3a; border-color: #b6dfc1; }
.fth-badge--inactive   { background: #ececec; color: #777;    border-color: #c8c8c8; }
.fth-badge--on_leave   { background: #fff3d6; color: #8a6311; border-color: #f0d99a; }

/* ---------- Search bar ---------- */
.fth-search {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    align-items: center;
    flex-wrap: wrap;
}
.fth-search input,
.fth-search select {
    padding: 9px 12px;
    border: 1px solid var(--fth-line);
    border-radius: var(--fth-radius-sm);
    font-size: 14px;
    background: #fff;
    color: var(--fth-ink);
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.fth-search input:focus,
.fth-search select:focus { outline: none; border-color: var(--fth-teal); box-shadow: 0 0 0 3px rgba(0, 122, 140, .12); }
.fth-search input[type="text"] { flex: 1; min-width: 180px; max-width: 380px; }
.fth-search input[type="date"] { min-width: 140px; }

/* ---------- Form variants ---------- */
.fth-form--wide { max-width: 760px; }
.fth-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--fth-space-md); }
.fth-form__row--3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) {
    .fth-form__row, .fth-form__row--3 { grid-template-columns: 1fr; }
}
.fth-form__hint { font-size: 12px; color: var(--fth-text); margin-top: 2px; }
.fth-form__actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- Service / payment rows (POS, appointments) ---------- */
.fth-svc-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 1fr 32px;
    gap: 8px;
    align-items: end;
    margin-bottom: 8px;
    padding: 10px;
    background: var(--fth-surface);
    border: 1px solid var(--fth-line);
    border-radius: var(--fth-radius-sm);
}
.fth-svc-row input, .fth-svc-row select {
    padding: 7px 9px;
    border: 1px solid var(--fth-line);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    width: 100%;
}
.fth-svc-row__remove {
    background: transparent;
    border: 0;
    color: var(--fth-danger);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background .1s ease;
}
.fth-svc-row__remove:hover { background: #fdecea; }
.fth-svc-row__add {
    margin-top: 4px;
    background: transparent;
    border: 1px dashed var(--fth-line);
    border-radius: var(--fth-radius-sm);
    padding: 10px;
    color: var(--fth-text);
    cursor: pointer;
    font-size: 13px;
    width: 100%;
    font-weight: 500;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.fth-svc-row__add:hover { color: var(--fth-teal); border-color: var(--fth-teal); background: rgba(0,122,140,.03); }

/* ---------- Detail layout ---------- */
.fth-detail {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    align-items: start;
}
@media (max-width: 800px) {
    .fth-detail { grid-template-columns: 1fr; }
}
.fth-detail__section {
    background: var(--fth-card);
    border: 1px solid var(--fth-line);
    border-radius: var(--fth-radius);
    padding: 20px;
    box-shadow: var(--fth-shadow);
}
.fth-detail__section h3 {
    margin: 0 0 12px;
    font-size: 12px;
    color: var(--fth-text);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
}
.fth-detail__row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--fth-line); gap: 12px; }
.fth-detail__row:last-child { border-bottom: 0; }
.fth-detail__row dt { color: var(--fth-text); font-size: 13px; }
.fth-detail__row dd { margin: 0; font-size: 14px; font-weight: 500; text-align: right; }

/* ---------- KPI cards (reportes, resúmenes) ---------- */
.fth-kpi {
    background: var(--fth-card);
    border: 1px solid var(--fth-line);
    border-radius: var(--fth-radius);
    padding: 20px;
    box-shadow: var(--fth-shadow);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fth-kpi__label { font-size: 12px; color: var(--fth-text); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin: 0; }
.fth-kpi__value { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -0.5px; line-height: 1.2; }
.fth-kpi__hint  { font-size: 12px; color: var(--fth-muted); margin: 0; }

/* ---------- Sección con título ---------- */
.fth-section__title {
    font-size: 12px;
    color: var(--fth-text);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
    margin: 28px 0 10px;
}

/* ---------- Utilidades ---------- */
.fth-text-danger { color: var(--fth-danger); }
.fth-text-ok     { color: var(--fth-ok); }
.fth-text-muted  { color: var(--fth-muted); }
.fth-text-right  { text-align: right; }
.fth-mono        { font-family: var(--fth-font-mono); font-size: 12px; }
.fth-bg-surface  { background: var(--fth-surface); }
.fth-bg-ok-soft  { background: #e8f5ec; }
.fth-bg-warn-soft{ background: #fff3d6; }
.fth-bg-danger-soft { background: #fdecea; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .fth-main { padding: 18px 14px 60px; }
    .fth-page__header { flex-direction: column; align-items: flex-start; }
    .fth-page__actions { width: 100%; }
    .fth-page__actions .fth-btn { flex: 1; }
    .fth-grid { grid-template-columns: 1fr 1fr; }
    .fth-search input[type="text"] { max-width: 100%; width: 100%; }
    .fth-topbar__inner { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
    .fth-nav { gap: 2px; width: 100%; justify-content: flex-start; }
    .fth-table th, .fth-table td { padding: 9px 10px; font-size: 13px; }
    .fth-detail { grid-template-columns: 1fr; }
    .fth-svc-row { grid-template-columns: 1fr 1fr 60px; }
}
@media (max-width: 420px) {
    .fth-grid { grid-template-columns: 1fr; }
    .fth-svc-row { grid-template-columns: 1fr; }
}

/* ---------- Scrollbar sutil ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(28,34,48,.18); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(28,34,48,.28); }

/* ---------- Print ---------- */
@media print {
    .fth-topbar, .fth-footer, .fth-nav, .fth-page__actions { display: none !important; }
    .fth-main { padding: 0; max-width: 100%; }
    .fth-card, .fth-detail__section { box-shadow: none; border-color: #ddd; }
}
