/* ============================================================
   GUARINO TURISMO — Admin CSS
   Fonte: Jost (títulos) + Comfortaa (corpo) | Sidebar #080858 | Acentos dourados
   ============================================================ */

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

:root {
    --azul:       #080858;
    --azul-md:    #080858;
    --azul-cl:    #3d46b4;
    --dourado:    #c9a84c;
    --dourado-cl: #e8c97a;
    --branco:     #ffffff;
    --cinza-bg:   #f8f9ff;
    --cinza-bd:   #e2e4ef;
    --cinza-txt:  #6b7280;
    --texto:      #2d2d2d;
    --verde:      #16a34a;
    --vermelho:   #dc2626;
    --laranja:    #ea580c;
    --roxo:       #7c3aed;
    --ciano:      #0891b2;

    --sidebar-w:  260px;
    --topbar-h:   64px;
    --radius:     10px;
    --shadow:     0 4px 20px rgba(8,8,88,0.07);
    --shadow-md:  0 8px 32px rgba(8,8,88,0.12);
    --trans:      .2s ease;
}

html { font-size: 16px; }

body {
    font-family: 'Comfortaa', sans-serif;
    background: var(--cinza-bg);
    color: var(--texto);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.topbar__titulo, .card__titulo, .metric-card__valor,
.sidebar__logo-title, .login-card__titulo, .login-card__subtitulo {
    font-family: 'Jost', sans-serif;
}

a { color: var(--azul-md); text-decoration: none; }
a:hover { color: var(--azul); }
img { max-width: 100%; height: auto; display: block; }
code { font-family: 'Courier New', monospace; font-size: .85em; background: #eef; padding: 1px 5px; border-radius: 4px; }

/* ─── Layout principal ─────────────────────────────────────── */
.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--cinza-bg);
}

.admin-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--trans);
}

.admin-content {
    padding: 24px;
    flex: 1;
}

/* ─── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--azul);
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--trans);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

.sidebar__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.sidebar__logo-icon { font-size: 2rem; }

.sidebar__logo-title {
    display: block;
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .3px;
}

.sidebar__logo-sub {
    display: block;
    font-size: .72rem;
    color: var(--dourado-cl);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar__nav {
    padding: 12px 0;
    flex: 1;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: rgba(255,255,255,.7);
    font-size: .88rem;
    font-weight: 500;
    transition: background var(--trans), color var(--trans);
    position: relative;
}

.sidebar__link:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}

.sidebar__link--ativo {
    background: rgba(201,168,76,.15);
    color: var(--dourado-cl);
}

.sidebar__link--ativo::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 3px; height: 100%;
    background: var(--dourado);
    border-radius: 0 2px 2px 0;
}

.sidebar__link--sair { color: rgba(255,100,100,.7); }
.sidebar__link--sair:hover { color: #ff6b6b; background: rgba(255,0,0,.08); }

.sidebar__link-icon { font-size: 1.1rem; width: 22px; text-align: center; flex-shrink: 0; }

.sidebar__footer {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 8px 0;
    flex-shrink: 0;
}

/* ─── Topbar ───────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: var(--branco);
    border-bottom: 1px solid var(--cinza-bd);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.topbar__titulo {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--texto);
}

.topbar__menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.topbar__menu-btn span {
    display: block;
    width: 22px; height: 2px;
    background: var(--texto);
    border-radius: 2px;
}

.topbar__perfil {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar__nome { font-size: .85rem; font-weight: 500; color: var(--cinza-txt); }

.topbar__avatar {
    width: 36px; height: 36px;
    background: var(--azul);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
}

.topbar__nivel {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: .5px;
}
.topbar__nivel--super { background: var(--dourado); color: #1a1100; }
.topbar__nivel--admin { background: var(--azul-md); color: #fff; }

/* ─── Overlay mobile ───────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 199;
}

/* ─── Flash messages ───────────────────────────────────────── */
.flash-container { padding: 0 24px; }

.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: .9rem;
    font-weight: 500;
    transition: opacity .3s;
}

.flash__icon { font-size: 1rem; }

.flash__close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: .6;
    line-height: 1;
}
.flash__close:hover { opacity: 1; }

.flash--sucesso { background: #d1fae5; color: #065f46; border-left: 4px solid var(--verde); }
.flash--erro    { background: #fee2e2; color: #7f1d1d; border-left: 4px solid var(--vermelho); }
.flash--aviso   { background: #fef3c7; color: #78350f; border-left: 4px solid var(--laranja); }
.flash--info    { background: #dbeafe; color: #1e3a8a; border-left: 4px solid var(--azul-md); }

/* ─── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--branco);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--cinza-bd);
}

.card__titulo {
    font-size: 1rem;
    font-weight: 600;
    color: var(--texto);
}

/* ─── Dashboard grid ───────────────────────────────────────── */
.dashboard-grid { display: flex; flex-direction: column; gap: 0; }

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--branco);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    border-left: 4px solid transparent;
}

.metric-card--azul   { border-left-color: var(--azul); }
.metric-card--dourado{ border-left-color: var(--dourado); }
.metric-card--verde  { border-left-color: var(--verde); }
.metric-card--roxo   { border-left-color: var(--roxo); }
.metric-card--laranja{ border-left-color: var(--laranja); }
.metric-card--ciano  { border-left-color: var(--ciano); }

.metric-card__icon { font-size: 2rem; }

.metric-card__valor {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--texto);
    line-height: 1;
}

.metric-card__label {
    display: block;
    font-size: .78rem;
    color: var(--cinza-txt);
    font-weight: 500;
    margin-top: 2px;
}

/* ─── Tabelas ──────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

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

.table th {
    background: var(--cinza-bg);
    color: var(--cinza-txt);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 10px 16px;
    text-align: left;
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--cinza-bd);
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table--hover tr:hover td { background: #fafafa; }

.row--destaque td { background: rgba(201,168,76,.05); }

/* ─── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .73rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    background: var(--azul-md);
}

.badge--ok    { background: var(--verde); }
.badge--off   { background: #9ca3af; }
.badge--info  { background: var(--azul-md); }
.badge--super { background: var(--dourado); color: #1a1100; }

/* ─── Botões ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background var(--trans), color var(--trans), border-color var(--trans), box-shadow var(--trans);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn--primary { background: var(--dourado); color: #1a1100; }
.btn--primary:hover { background: var(--dourado-cl); color: #1a1100; }

.btn--outline { background: transparent; border-color: var(--cinza-bd); color: var(--texto); }
.btn--outline:hover { background: var(--cinza-bg); border-color: var(--azul); color: var(--azul); }

.btn--ghost { background: transparent; color: var(--cinza-txt); }
.btn--ghost:hover { background: var(--cinza-bg); color: var(--texto); }

.btn--danger { background: transparent; border-color: #fca5a5; color: var(--vermelho); }
.btn--danger:hover { background: #fee2e2; }

.btn--sm  { padding: 6px 12px; font-size: .82rem; }
.btn--lg  { padding: 12px 28px; font-size: .95rem; }
.btn--xs  { padding: 4px 8px; font-size: .78rem; border-radius: 6px; }
.btn--block { width: 100%; justify-content: center; }

/* ─── Formulários ──────────────────────────────────────────── */
.form-grid { padding: 24px; display: flex; flex-direction: column; gap: 0; }

.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
}

.form-group--inline {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.form-label {
    font-size: .83rem;
    font-weight: 600;
    color: var(--texto);
    margin-bottom: 5px;
}

.form-label--req::after {
    content: ' *';
    color: var(--vermelho);
}

.form-control {
    padding: 9px 13px;
    border: 1.5px solid var(--cinza-bd);
    border-radius: 8px;
    font-size: .9rem;
    font-family: inherit;
    color: var(--texto);
    background: var(--branco);
    transition: border-color var(--trans), box-shadow var(--trans);
    outline: none;
    width: 100%;
}

.form-control:focus {
    border-color: var(--azul-md);
    box-shadow: 0 0 0 3px rgba(8,8,88,.12);
}

.form-control:disabled { background: #f9fafb; color: var(--cinza-txt); cursor: not-allowed; }

.form-control--sm { padding: 6px 10px; font-size: .83rem; }

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

select.form-control { cursor: pointer; }

.form-hint {
    font-size: .78rem;
    color: var(--cinza-txt);
    margin-top: 4px;
}

.form-col-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-col-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; }

.form-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--cinza-bd);
}

.filtro-bar {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--cinza-bd);
}

/* ─── Input group ──────────────────────────────────────────── */
.input-group {
    display: flex;
    gap: 0;
}
.input-group .form-control { border-radius: 8px 0 0 8px; }
.input-group__btn {
    padding: 9px 13px;
    background: var(--cinza-bg);
    border: 1.5px solid var(--cinza-bd);
    border-left: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: .9rem;
    transition: background var(--trans);
}
.input-group__btn:hover { background: #e8e9f0; }

/* ─── Switch toggle ────────────────────────────────────────── */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }

.switch__slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 24px;
    cursor: pointer;
    transition: background var(--trans);
}

.switch__slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--trans);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.switch input:checked + .switch__slider { background: var(--dourado); }
.switch input:checked + .switch__slider::before { transform: translateX(18px); }

/* ─── Checkbox grid (serviços) ─────────────────────────────── */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    padding: 14px;
    background: var(--cinza-bg);
    border-radius: 8px;
    border: 1.5px solid var(--cinza-bd);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: var(--branco);
    border-radius: 6px;
    cursor: pointer;
    font-size: .85rem;
    border: 1.5px solid var(--cinza-bd);
    transition: border-color var(--trans);
}

.checkbox-item:hover { border-color: var(--dourado); }
.checkbox-item input { accent-color: var(--dourado); }

/* ─── Star rating ──────────────────────────────────────────── */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    gap: 4px;
}

.star-rating input { display: none; }

.star-rating label {
    font-size: 2rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color var(--trans);
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: var(--dourado);
}

/* Estrelas na listagem */
.stars { color: var(--dourado); font-size: 1rem; }
.stars--off { color: #d1d5db; }

/* ─── Imagem preview e thumb ───────────────────────────────── */
.imagem-preview {
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid var(--cinza-bd);
    max-width: 240px;
}

.imagem-preview img { width: 100%; height: 140px; object-fit: cover; display: block; }

.thumb {
    width: 56px; height: 40px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--cinza-bd);
    background: var(--cinza-bg);
}

.thumb img { width: 100%; height: 100%; object-fit: cover; }

.thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--cinza-txt);
}

/* ─── Avatar ───────────────────────────────────────────────── */
.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--azul);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 32px; height: 32px; font-size: .85rem; }

/* ─── Cor preview ──────────────────────────────────────────── */
.cor-preview {
    display: inline-block;
    width: 18px; height: 18px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 6px;
    border: 1px solid rgba(0,0,0,.1);
}

/* ─── Misc ─────────────────────────────────────────────────── */
.acoes { white-space: nowrap; }
.empty-state { text-align: center; color: var(--cinza-txt); padding: 40px 16px; font-size: .9rem; }
.text-muted { color: var(--cinza-txt); }
.text-destaque { color: var(--azul); font-weight: 700; }
.d-block { display: block; }

/* ─── Login page ───────────────────────────────────────────── */
.login-body {
    background: var(--azul);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-bg__pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 30%, rgba(201,168,76,.12) 0%, transparent 60%),
                      radial-gradient(circle at 80% 80%, rgba(8,8,88,.3) 0%, transparent 50%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--branco);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 48px rgba(8,8,88,.25);
}

.login-card__logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-card__logo-icon { font-size: 3rem; display: block; margin-bottom: 8px; }
.login-card__titulo { font-size: 1.4rem; font-weight: 800; color: var(--azul); margin-bottom: 4px; }
.login-card__slogan { font-size: .85rem; color: var(--cinza-txt); }
.login-card__subtitulo { font-size: .95rem; font-weight: 700; color: var(--texto); text-align: center; margin-bottom: 24px; }
.login-card__voltar { text-align: center; margin-top: 20px; font-size: .82rem; color: var(--cinza-txt); }

.login-form { display: flex; flex-direction: column; gap: 4px; }
.login-form .form-group { margin-bottom: 14px; }

/* ─── Responsivo ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-w)));
        box-shadow: var(--shadow-md);
    }

    .sidebar--aberta {
        transform: translateX(0);
    }

    .sidebar-overlay--ativo { display: block; }

    .admin-main { margin-left: 0; }

    .topbar__menu-btn { display: flex; }
    .topbar__nome { display: none; }

    .admin-content { padding: 16px; }

    .form-col-2,
    .form-col-3 {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filtro-bar {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .login-card { padding: 28px 20px; }
    .card__header { padding: 16px; flex-wrap: wrap; gap: 10px; }
    .form-grid { padding: 16px; }
}
