﻿/* Fonte Inter carregada localmente (sem dependência externa) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-variable.woff2') format('woff2');
}

:root {
    --bs-primary: #7c4dff;
    --bs-primary-rgb: 124, 77, 255;
    --bs-primary-dark: #5a2fd8;
    --app-sidebar: #19152e;
    --app-sidebar-hover: rgba(255, 255, 255, 0.06);
    --app-sidebar-active-text: #fff;
    --app-sidebar-active-bg: linear-gradient(135deg, #7c4dff 0%, #5a2fd8 100%);
    --app-topbar: #ffffff;
    --app-bg: #f4f6fd;
    --app-card-border: #e8ecf5;
    --app-text: #2b2f45;
    --app-muted: #8a93ab;
    --app-shadow: 0 2px 6px rgba(38, 30, 80, 0.05), 0 1px 2px rgba(38, 30, 80, 0.03);
    --app-shadow-lg: 0 12px 40px rgba(38, 30, 80, 0.13);
    --app-radius: 18px;
    --app-radius-sm: 12px;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
    background: var(--app-bg);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--app-text);
    -webkit-font-smoothing: antialiased;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c9cfe0; border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- TOPBAR ---------- */
.app-navbar {
    background: var(--app-topbar);
    backdrop-filter: blur(12px);
    min-height: 68px;
    border-bottom: 1px solid var(--app-card-border);
    box-shadow: var(--app-shadow);
    padding-top: 0;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--app-text);
}
.navbar-brand .brand-icon-sm {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(124,77,255,.35);
}
.navbar-brand .brand-logo {
    height: 40px; max-width: 180px; object-fit: contain;
}
.navbar-brand .brand-name {
    letter-spacing: -0.02em;
    white-space: nowrap;
}
.company-badge {
    background: rgba(124, 77, 255, 0.1);
    color: var(--bs-primary);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
}
.user-avatar {
    width: 38px; height: 38px;
    border-radius: 50% !important;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 3px 8px rgba(124,77,255,.3);
}

/* ---------- SIDEBAR ---------- */
.app-sidebar-wrapper {
    position: fixed;
    top: 68px;
    bottom: 0;
    left: 0;
    width: 252px;
    overflow-y: auto;
    background: linear-gradient(180deg, #1b1731 0%, #16122a 100%);
    z-index: 1020;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}
.app-sidebar-wrapper::-webkit-scrollbar { width: 6px; }
.app-sidebar-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

.app-nav { min-height: 100%; padding: 6px 10px 14px; display: flex; flex-direction: column; gap: 1px; }
.app-nav-section {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 800;
    padding: 12px 10px 4px;
}
.app-nav-section-toggle {
    cursor: pointer;
    user-select: none;
    padding: 12px 10px 4px;
    transition: color 0.14s;
}
.app-nav-section-toggle:hover { color: rgba(255,255,255,0.7); }
.app-nav-section-toggle .section-caret {
    font-size: 0.72rem;
    transition: transform 0.18s;
    opacity: 0.6;
}
.app-nav-section-toggle.open .section-caret { transform: rotate(90deg); }
.app-nav-items { display: none; }
.app-nav-items.open { display: block; }
.app-nav-link {
    color: rgba(255, 255, 255, 0.78) !important;
    border-radius: 9px;
    margin: 1px 0;
    font-size: 0.94rem;
    font-weight: 600;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.2;
    transition: background 0.14s, color 0.14s;
}
.app-nav-link i {
    font-size: 1.2rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.55);
    transition: color 0.16s;
}
.app-nav-link:hover {
    color: #fff !important;
    background: var(--app-sidebar-hover);
}
.app-nav-link:hover i { color: #fff; }
.app-nav-link.active,
.app-nav-link.active i {
    color: #fff !important;
    background: var(--app-sidebar-active-bg);
    box-shadow: 0 5px 16px rgba(124, 77, 255, 0.4);
}
.app-nav-link.active i { color: #fff; }
.app-nav-link .nav-badge {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 800;
}

.app-nav-footer {
    color: rgba(255, 255, 255, 0.32);
    font-size: 0.72rem;
    padding: 14px 12px 8px;
    margin-top: auto;
}
.app-nav-footer .version {
    font-weight: 700;
    color: rgba(255,255,255,.5);
}

/* offcanvas mobile */
.offcanvas-start { background: linear-gradient(180deg, #1b1731, #16122a); width: 280px !important; }
.offcanvas-start .app-nav-link { color: rgba(255,255,255,.72) !important; }
.offcanvas-title { color: #fff; font-weight: 800; }
.offcanvas.offcanvas-start .app-nav-section { color: rgba(255,255,255,.4) !important; }

/* ---------- MAIN ---------- */
.app-main { margin-left: 252px; min-height: calc(100vh - 68px); padding-bottom: 60px; }
.app-body { padding-top: 68px; }

@media (max-width: 991.98px) {
    .app-main { margin-left: 0; }
    .app-sidebar-wrapper { display: none; }
}

/* ---------- PAGE HEADER ---------- */
.page-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 24px; }
.page-header h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; font-size: 1.5rem; }
.page-header h4 i { margin-right: 10px; }
.page-header .subtitle { color: var(--app-muted); font-size: 0.9rem; margin-top: 3px; }

/* ---------- CARDS ---------- */
.app-card {
    border: 1px solid var(--app-card-border) !important;
    border-radius: var(--app-radius) !important;
    box-shadow: var(--app-shadow);
    transition: box-shadow 0.2s, transform 0.2s;
    background: #fff;
}
.app-card-hover:hover { box-shadow: var(--app-shadow-lg); transform: translateY(-3px); }
.app-card .card-header {
    background: #fff;
    border-bottom: 1px solid var(--app-card-border);
    border-radius: var(--app-radius) var(--app-radius) 0 0 !important;
    padding: 16px 20px;
}
.app-card .card-header strong { font-weight: 700; font-size: 1rem; color: var(--app-text); }
.app-card .card-body { padding: 20px; }
.app-card .card-body.p-0 .table th:first-child { padding-left: 20px; }
.app-card .card-body.p-0 .table td:first-child { padding-left: 20px; }
.app-card .card-body.p-0 .table th:last-child, .table td:last-child { padding-right: 20px; }

/* ---------- STAT CARDS ---------- */
.stat-card { position: relative; overflow: hidden; }
.stat-card::after {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 90px; height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124,77,255,.08), transparent 70%);
}
.stat-card .stat-icon {
    width: 54px; height: 54px;
    border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}
.stat-card .stat-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.stat-card .stat-label { color: var(--app-muted); font-size: 0.82rem; font-weight: 600; margin-top: 3px; }

/* ---------- SOFT COLORS ---------- */
.bg-primary-soft { background: rgba(124,77,255,.12) !important; color: #6a3ce8 !important; }
.bg-success-soft { background: rgba(40,167,69,.13) !important; color: #1f9d50 !important; }
.bg-info-soft    { background: rgba(23,162,184,.13) !important; color: #0e9aab !important; }
.bg-warning-soft { background: rgba(255,193,7,.18) !important; color: #b57e00 !important; }
.bg-danger-soft  { background: rgba(220,53,69,.12) !important; color: #d9233a !important; }
.bg-secondary-soft { background: rgba(108,117,125,.13) !important; color: #5b6370 !important; }
.bg-dark-soft    { background: rgba(52,58,64,.13) !important; color: #343a40 !important; }
.bg-gradient-primary { background: var(--app-sidebar-active-bg); }

.text-primary { color: var(--bs-primary) !important; }

/* ---------- BOTÕES ---------- */
.btn { border-radius: 11px; font-weight: 600; font-size: 0.92rem; padding: 0.5rem 1rem; }
.btn-sm { border-radius: 9px; padding: 0.38rem 0.75rem; font-size: 0.82rem; }
.btn-lg { border-radius: 13px; }
.btn-gradient {
    background: linear-gradient(135deg, #7c4dff, #5a2fd8) !important;
    border: 0 !important;
    color: #fff !important;
    box-shadow: 0 5px 16px rgba(124,77,255,.35);
}
.btn-gradient:hover { filter: brightness(1.07); color: #fff !important; transform: translateY(-1px); }
.btn-primary {
    --bs-btn-bg: #7c4dff;
    --bs-btn-border-color: #7c4dff;
    --bs-btn-hover-bg: #6a3ce8;
    --bs-btn-hover-border-color: #6a3ce8;
    --bs-btn-active-bg: #5a2fd8;
    --bs-btn-active-border-color: #5a2fd8;
}
.btn-outline-primary {
    --bs-btn-color: #7c4dff;
    --bs-btn-border-color: #7c4dff;
    --bs-btn-hover-bg: #7c4dff;
    --bs-btn-hover-border-color: #7c4dff;
}

/* ---------- FORM ---------- */
.form-control, .form-select {
    border-radius: 11px;
    border-color: #dfe4f0;
    font-size: 0.94rem;
    padding: 0.5rem 0.85rem;
}
.form-control:focus, .form-select:focus {
    border-color: #b28cff;
    box-shadow: 0 0 0 0.25rem rgba(124,77,255,.15);
}
.form-label { font-weight: 700; font-size: 0.85rem; color: #454b6b; margin-bottom: 6px; }
.form-control-sm, .form-select-sm { border-radius: 9px; }
.input-group-text { border-radius: 11px; }

/* ---------- TABELAS ---------- */
.table { --bs-table-hover-bg: rgba(124,77,255,.05); }
.table thead th {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-muted);
    font-weight: 800;
    border-bottom-width: 1px;
    padding: 13px 16px;
    white-space: nowrap;
}
.table tbody td { padding: 13px 16px; vertical-align: middle; }
.table-light, .table-light td, .table-light th { background-color: #f7f8fd !important; }

/* ---------- BADGES ---------- */
.badge { font-weight: 700; border-radius: 7px; padding: 5px 10px; font-size: 0.75rem; }
.badge.bg-soft-primary { background: rgba(124,77,255,.13) !important; color: #7c4dff !important; }
.badge.bg-soft-success { background: rgba(40,167,69,.15) !important; color: #1f9d50 !important; }
.badge.bg-soft-danger  { background: rgba(220,53,69,.13) !important; color: #d9233a !important; }
.badge.bg-soft-warning { background: rgba(255,193,7,.2) !important; color: #b57e00 !important; }
.badge.bg-soft-info    { background: rgba(23,162,184,.15) !important; color: #0e9aab !important; }
.badge.bg-soft-secondary { background: rgba(108,117,125,.15) !important; color: #5b6370 !important; }
.badge.bg-soft-dark    { background: rgba(52,58,64,.15) !important; color: #343a40 !important; }

/* ---------- NAV PILLS / TABS ---------- */
.nav-pills .nav-link {
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--app-muted);
    padding: 8px 18px;
}
.nav-pills .nav-link.active {
    background: var(--app-sidebar-active-bg);
    color: #fff;
    box-shadow: 0 4px 12px rgba(124,77,255,.3);
}
.nav-tabs .nav-link { color: var(--app-muted); font-weight: 700; }
.nav-tabs .nav-link.active { color: var(--bs-primary); }

/* ---------- ALERTS ---------- */
.alert { border-radius: 13px; border: 0; }
.alert-success { background: rgba(40,167,69,.1); color: #1a8743; }
.alert-danger  { background: rgba(220,53,69,.09); color: #c81f35; }
.alert-warning { background: rgba(255,193,7,.15); color: #a26b00; }
.alert-info    { background: rgba(23,162,184,.12); color: #0c8698; }

/* ---------- AGENDA ---------- */
.agenda-bar { border-radius: 11px; padding: 10px 14px; margin-bottom: 9px; cursor: pointer; transition: transform .15s; }
.agenda-bar:hover { transform: translateX(3px); }

/* ---------- AGENDA GRID (drag & drop) ---------- */
.agenda-grid .agenda-slot { border: 1px dashed transparent; transition: background .12s, border-color .12s; }
.agenda-grid .agenda-slot.slot-hover { border-color: var(--bs-primary); background: rgba(124,77,255,.12); }
.agenda-grid .agenda-bar.draggable { cursor: grab; }
.agenda-grid .agenda-bar.dragging { opacity: .5; }
.agenda-grid .agenda-bar:active { cursor: grabbing; }

/* ---------- LISTAS ---------- */
.list-group-item { border-color: var(--app-card-border); }

/* ---------- LOGIN ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(900px 500px at 15% 10%, rgba(124,77,255,.55) 0%, transparent 55%),
        radial-gradient(800px 600px at 85% 90%, rgba(90,47,216,.5) 0%, transparent 55%),
        #16122a;
}
.login-card {
    width: 100%;
    max-width: 440px;
    border: 0;
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(0,0,0,.5);
    padding: 40px 36px;
}
.login-card .brand-icon {
    width: 72px; height: 72px;
    border-radius: 22px;
    background: var(--app-sidebar-active-bg);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 18px;
    box-shadow: 0 10px 24px rgba(124,77,255,.4);
}
.login-card .login-title {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    text-align: center;
}
.login-card .login-subtitle { color: var(--app-muted); text-align: center; font-size: 0.9rem; margin-bottom: 26px; }
.login-wrap .btn-primary { width: 100%; padding: 0.7rem; font-size: 1rem; border-radius: 12px; }
.login-wrap .form-control { padding: 0.65rem 0.9rem; font-size: 0.98rem; }

/* ---------- MISC ---------- */
.text-muted { color: var(--app-muted) !important; }
h1,h2,h3,h4,h5,h6 { letter-spacing: -0.02em; }
code { background: #f1f1f6; border-radius: 6px; padding: 2px 6px; font-size: .85em; }
.dropdown-menu { border-radius: 13px; box-shadow: var(--app-shadow-lg); border-color: var(--app-card-border); padding: 8px; }
.dropdown-item { border-radius: 8px; padding: 9px 12px; font-weight: 500; font-size: 0.9rem; }
.dropdown-item:hover, .dropdown-item:focus { background: rgba(124,77,255,.08); }
.dropdown-item.text-danger:hover { background: rgba(220,53,69,.1); }
.modal-content { border: 0; border-radius: var(--app-radius); box-shadow: var(--app-shadow-lg); }

/* ---------- DARK MODE ---------- */
body.dark-mode {
    --app-topbar: #171b26;
    --app-bg: #0f1219;
    --app-card-border: #232a38;
    --app-text: #e6eaf2;
    --app-muted: #8f98ad;
    --app-shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
    --app-shadow-lg: 0 12px 40px rgba(0,0,0,.55);
    background: var(--app-bg);
    color: var(--app-text);
}
body.dark-mode .app-navbar {
    background: #171b26;
    border-bottom-color: var(--app-card-border);
}
body.dark-mode .navbar-brand,
body.dark-mode .app-navbar .fa, body.dark-mode .app-navbar { color: var(--app-text); }
body.dark-mode .app-card {
    background: #171b26;
    border-color: var(--app-card-border);
}
body.dark-mode .app-card .card-header { background: #171b26; border-bottom-color: var(--app-card-border); }
body.dark-mode .app-card .card-header strong { color: var(--app-text); }
body.dark-mode .table { color: var(--app-text); --bs-table-hover-bg: rgba(124,77,255,.08); }
body.dark-mode .table-light, body.dark-mode .table-light td, body.dark-mode .table-light th { background-color: #12161f !important; color: var(--app-text) !important; }
body.dark-mode .form-control, body.dark-mode .form-select {
    background: #12161f;
    border-color: var(--app-card-border);
    color: var(--app-text);
}
body.dark-mode .form-control:focus, body.dark-mode .form-select:focus {
    background: #12161f;
    color: var(--app-text);
}
body.dark-mode .form-label { color: #b9c1d4; }
body.dark-mode .dropdown-menu { background: #1a1f2b; border-color: var(--app-card-border); }
body.dark-mode .dropdown-item { color: var(--app-text); }
body.dark-mode .dropdown-item:hover { background: rgba(255,255,255,.06); }
body.dark-mode .dropdown-item.text-danger:hover { background: rgba(220,53,69,.2); }
body.dark-mode .text-muted, body.dark-mode .subtitle { color: var(--app-muted) !important; }
body.dark-mode .list-group-item { background: #171b26; border-color: var(--app-card-border); color: var(--app-text); }
body.dark-mode .modal-content { background: #171b26; color: var(--app-text); }
body.dark-mode code { background: #1d2330; color: #d7dce8; }
body.dark-mode .page-header h4, body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 { color: var(--app-text); }
body.dark-mode .navbar-nav .dropdown-toggle, body.dark-mode .btn-link { color: var(--app-text) !important; }
body.dark-mode .bg-light { background: #12161f !important; }




/* ---------- BANNER MODO DEMONSTRAÇÃO ---------- */
.demo-banner {
    position: fixed;
    top: 68px;
    left: 252px;
    right: 0;
    z-index: 1040;
    background: linear-gradient(135deg, #ffb347, #ff8c00);
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    text-align: center;
    padding: 8px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.demo-banner + .app-main { padding-top: 48px; }
@media (max-width: 991.98px) {
    .demo-banner { left: 0; }
}
