/* ============================================================
   Painel 9 — Design System Principal
   Fontes: Space Grotesk (títulos) + Inter (corpo)
   Inspirado em: Stripe, Notion, Linear, Vercel
   ============================================================ */

:root {
    --p9-blue:       #1a56e8;
    --p9-blue-light: #EEF3FF;
    --p9-blue-mid:   #3b70f2;
    --p9-blue-dark:  #1240c4;
    --p9-dark:       #0a0f1e;
    --p9-dark-2:     #1e293b;
    --p9-gray:       #64748b;
    --p9-gray-light: #94a3b8;
    --p9-border:     #e2e8f0;
    --p9-surface:    #F8FAFC;
    --p9-surface-2:  #F1F5F9;
    --p9-success:    #16a34a;
    --p9-warning:    #d97706;
    --p9-danger:     #dc2626;
    --radius-sm:     6px;
    --radius:        10px;
    --radius-lg:     16px;
    --radius-xl:     24px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow:        0 4px 16px rgba(0,0,0,.08);
    --shadow-lg:     0 8px 32px rgba(0,0,0,.12);
    --shadow-blue:   0 4px 20px rgba(26,86,232,.2);
}

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

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--p9-dark);
    background: #fff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

a { color: var(--p9-blue); text-decoration: none; transition: color .15s; }
a:hover { color: var(--p9-blue-mid); }

/* ── Navbar ──────────────────────────────────────────────── */
.p9-navbar {
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--p9-border);
    padding: 0;
    height: 64px;
}

.p9-navbar .container { height: 64px; }

.p9-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--p9-dark) !important;
}

.p9-logo-mark {
    width: 32px;
    height: 32px;
    background: var(--p9-blue);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.p9-navbar .nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--p9-gray) !important;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all .15s;
}

.p9-navbar .nav-link:hover,
.p9-navbar .nav-link.active {
    background: var(--p9-surface);
    color: var(--p9-dark) !important;
}

/* ── Botões ──────────────────────────────────────────────── */
.btn-primary-p9 {
    background: var(--p9-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary-p9:hover {
    background: var(--p9-blue-mid);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-blue);
}

.btn-ghost-p9 {
    background: none;
    border: 1px solid var(--p9-border);
    color: var(--p9-dark);
    border-radius: var(--radius);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all .15s;
}

.btn-ghost-p9:hover {
    background: var(--p9-surface);
    color: var(--p9-dark);
}

.btn-lg-p9 { padding: 14px 28px; font-size: 15px; }

/* ── Hero ────────────────────────────────────────────────── */
.p9-hero {
    padding: 96px 0 80px;
    background: linear-gradient(180deg, #fff 0%, var(--p9-surface) 100%);
    text-align: center;
}

.p9-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    background: var(--p9-blue-light);
    color: var(--p9-blue);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 24px;
}

.p9-hero-badge-dot {
    width: 6px;
    height: 6px;
    background: var(--p9-blue);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.p9-hero h1 {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    letter-spacing: -2px;
    color: var(--p9-dark);
    max-width: 780px;
    margin: 0 auto 20px;
}

.p9-hero h1 .highlight { color: var(--p9-blue); }

.p9-hero .lead {
    font-size: 18px;
    color: var(--p9-gray);
    max-width: 560px;
    margin: 0 auto 36px;
    line-height: 1.75;
}

/* ── Stats ───────────────────────────────────────────────── */
.p9-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--p9-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--p9-border);
}

.p9-stat-item {
    background: #fff;
    padding: 24px;
    text-align: center;
}

.p9-stat-num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--p9-dark);
    display: block;
}

.p9-stat-label {
    font-size: 13px;
    color: var(--p9-gray);
    margin-top: 4px;
}

/* ── Seções ──────────────────────────────────────────────── */
.p9-section { padding: 80px 0; }
.p9-section-sm { padding: 48px 0; }
.p9-section-alt { background: var(--p9-surface); }

.p9-section-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--p9-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.p9-section-title {
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--p9-dark);
    margin-bottom: 12px;
}

.p9-section-desc {
    font-size: 16px;
    color: var(--p9-gray);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.75;
}

/* ── Cards de Serviços ───────────────────────────────────── */
.p9-service-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--p9-border);
    background: #fff;
    transition: all .2s;
    height: 100%;
}

.p9-service-card:hover {
    border-color: var(--p9-blue);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.p9-service-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--p9-blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.p9-service-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--p9-dark);
}

.p9-service-card p {
    font-size: 14px;
    color: var(--p9-gray);
    line-height: 1.65;
    margin: 0;
}

/* ── Cards de Cases ──────────────────────────────────────── */
.p9-case-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--p9-border);
    overflow: hidden;
    transition: all .2s;
    height: 100%;
}

.p9-case-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.p9-case-img {
    height: 160px;
    background: linear-gradient(135deg, var(--p9-blue-light), #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.p9-case-body { padding: 20px; }

.p9-case-tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--p9-blue-light);
    color: var(--p9-blue);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 10px;
}

/* ── Blog Cards ──────────────────────────────────────────── */
.p9-blog-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--p9-border);
    overflow: hidden;
    transition: all .2s;
    height: 100%;
}

.p9-blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.p9-blog-img {
    height: 160px;
    background: linear-gradient(135deg, var(--p9-blue-light), #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    overflow: hidden;
}

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

.p9-blog-body { padding: 20px; }
.p9-blog-cat { font-size: 11px; font-weight: 700; color: var(--p9-blue); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.p9-blog-body h3 { font-size: 15px; font-weight: 600; line-height: 1.4; margin-bottom: 8px; color: var(--p9-dark); }
.p9-blog-meta { font-size: 12px; color: var(--p9-gray); display: flex; gap: 12px; }

/* ── CTA Banner ──────────────────────────────────────────── */
.p9-cta-banner {
    background: var(--p9-dark);
    color: #fff;
    padding: 64px 48px;
    border-radius: var(--radius-xl);
}

.p9-cta-banner h2 {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.p9-cta-banner p { color: #94a3b8; margin-bottom: 28px; font-size: 16px; }

/* ── Forms ───────────────────────────────────────────────── */
.p9-form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--p9-dark);
    margin-bottom: 6px;
    display: block;
}

.p9-form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--p9-border);
    border-radius: var(--radius);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--p9-dark);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}

.p9-form-control:focus {
    border-color: var(--p9-blue);
    box-shadow: 0 0 0 3px rgba(26,86,232,.1);
}

/* ── Badges ──────────────────────────────────────────────── */
.badge-p9-ativo    { background: #dcfce7; color: #16a34a; border-radius: 100px; font-size: 11px; padding: 3px 10px; font-weight: 600; }
.badge-p9-pendente { background: #fef3c7; color: #d97706; border-radius: 100px; font-size: 11px; padding: 3px 10px; font-weight: 600; }
.badge-p9-concluido{ background: #dbeafe; color: var(--p9-blue); border-radius: 100px; font-size: 11px; padding: 3px 10px; font-weight: 600; }
.badge-p9-dev      { background: #f3e8ff; color: #7c3aed; border-radius: 100px; font-size: 11px; padding: 3px 10px; font-weight: 600; }
.badge-p9-urgente  { background: #fee2e2; color: #dc2626; border-radius: 100px; font-size: 11px; padding: 3px 10px; font-weight: 600; }

/* ── Progress ────────────────────────────────────────────── */
.p9-progress { height: 6px; background: var(--p9-border); border-radius: 3px; overflow: hidden; }
.p9-progress-fill { height: 100%; background: var(--p9-blue); border-radius: 3px; transition: width .3s; }

/* ── Sidebar ─────────────────────────────────────────────── */
.p9-sidebar {
    width: 220px;
    min-height: 100%;
    background: var(--p9-surface);
    border-right: 1px solid var(--p9-border);
    padding: 16px 12px;
}

.p9-sidebar-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--p9-gray-light);
    text-transform: uppercase;
    letter-spacing: .8px;
    padding: 0 8px;
    margin: 16px 0 6px;
}

.p9-sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--p9-gray);
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
}

.p9-sidebar-item:hover { background: #fff; color: var(--p9-dark); }
.p9-sidebar-item.active { background: #fff; color: var(--p9-blue); box-shadow: var(--shadow-sm); }

/* ── Tabelas ─────────────────────────────────────────────── */
.p9-table-wrap { border: 1px solid var(--p9-border); border-radius: var(--radius-lg); overflow: hidden; }

.p9-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.p9-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--p9-gray);
    text-transform: uppercase;
    letter-spacing: .6px;
    background: var(--p9-surface);
    border-bottom: 1px solid var(--p9-border);
}

.p9-table td { padding: 13px 16px; border-bottom: 1px solid var(--p9-border); color: var(--p9-dark); }
.p9-table tbody tr:last-child td { border-bottom: none; }
.p9-table tbody tr:hover td { background: var(--p9-surface); }

/* ── Kanban ──────────────────────────────────────────────── */
.p9-kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 20px; }
.p9-kanban-col { background: var(--p9-surface); border-radius: var(--radius); padding: 12px; min-height: 400px; }
.p9-kanban-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.p9-kanban-title { font-size: 12px; font-weight: 700; color: var(--p9-dark); }
.p9-kanban-count { background: #fff; border: 1px solid var(--p9-border); color: var(--p9-gray); border-radius: 100px; font-size: 11px; font-weight: 600; padding: 1px 8px; }
.p9-kanban-card { background: #fff; border: 1px solid var(--p9-border); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; cursor: grab; transition: all .15s; }
.p9-kanban-card:hover { border-color: var(--p9-blue); box-shadow: var(--shadow); }

/* ── Footer ──────────────────────────────────────────────── */
.p9-footer {
    background: var(--p9-dark);
    color: #fff;
    padding: 56px 0 24px;
}

.p9-footer-brand {
    display: flex;
    align-items: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 18px;
}

.p9-footer-link {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
    transition: color .15s;
}

.p9-footer-link:hover { color: #fff; }

/* ── Flash alerts ────────────────────────────────────────── */
.flash-alert {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 9999;
    min-width: 320px;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
}

/* ── Responsivo ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .p9-stats { grid-template-columns: repeat(2, 1fr); }
    .p9-kanban { grid-template-columns: 1fr; }
    .p9-cta-banner { padding: 40px 24px; }
    .p9-hero h1 { font-size: 32px; letter-spacing: -1px; }
}

/* ── Utilitários ─────────────────────────────────────────── */
.text-p9-blue { color: var(--p9-blue); }
.bg-p9-surface { background: var(--p9-surface); }
.border-p9 { border: 1px solid var(--p9-border); }
.rounded-p9 { border-radius: var(--radius); }
.rounded-p9-lg { border-radius: var(--radius-lg); }
.shadow-p9 { box-shadow: var(--shadow); }
