/**
 * Clinic Manager - Estilos Customizados
 *
 * Tema: Light (padrão) / Dark
 * Cores: Rosa claro (primária) + Lilás (secundária)
 * Paleta acolhedora para clínicas de saúde
 */

/* ===========================================
   VARIÁVEIS DE TEMA
   =========================================== */

:root {
    /* Tipografia - Fontes */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Cores Primárias - Rosa (igual landing page) */
    --primary: #305696;
    --primary-hover: #1E3A6B;
    --primary-light: #5277B8;
    --primary-dark: #1E3A6B;
    --primary-rgb: 48, 86, 150;
    --primary-pale: #EEF2FA;

    /* Cores Secundárias - Lilás (igual landing page) */
    --secondary: #63B982;
    --secondary-hover: #3F7D58;
    --secondary-light: #8DD0A6;
    --secondary-dark: #3F7D58;
    --secondary-pale: #EAF5EE;

    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-soft: linear-gradient(135deg, var(--primary-pale) 0%, var(--secondary-pale) 100%);

    /* Fundos */
    --bg-body: #FAF8F4;
    --bg-card: #FFFFFF;
    --bg-sidebar: linear-gradient(180deg, #305696 0%, #63B982 100%);
    --bg-sidebar-solid: #305696;
    --bg-topbar: #FFFFFF;
    --bg-input: #FFFFFF;
    --bg-hover: #EAF5EE;

    /* Textos */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-light: #ffffff;

    /* Bordas */
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;

    /* Status */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    /* Sombras (mais suaves como landing page) */
    --shadow-sm: 0 2px 8px rgba(48, 86, 150, 0.08);
    --shadow: 0 4px 12px rgba(48, 86, 150, 0.1);
    --shadow-md: 0 8px 24px rgba(48, 86, 150, 0.12);
    --shadow-lg: 0 16px 48px rgba(99, 185, 130, 0.15);

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;

    /* Transições */
    --transition: all 0.3s ease;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
}

/* Tema Escuro */
[data-theme="dark"] {
    /* Rosa mais suave para dark mode */
    --primary: #5277B8;
    --primary-hover: #305696;
    --primary-light: #7A98C7;
    --primary-dark: #1E3A6B;
    --primary-pale: rgba(48, 86, 150, 0.15);

    /* Lilás mais suave para dark mode */
    --secondary: #8DD0A6;
    --secondary-hover: #63B982;
    --secondary-light: #A6DDB8;
    --secondary-dark: #3F7D58;
    --secondary-pale: rgba(99, 185, 130, 0.15);

    /* Gradientes dark */
    --gradient-primary: linear-gradient(135deg, #5277B8 0%, #8DD0A6 100%);
    --gradient-soft: linear-gradient(135deg, rgba(48, 86, 150, 0.1) 0%, rgba(99, 185, 130, 0.1) 100%);

    /* Fundos escuros */
    --bg-body: #1a1a2e;
    --bg-card: #16213e;
    --bg-sidebar: linear-gradient(180deg, #1E3A6B 0%, #3F7D58 100%);
    --bg-sidebar-solid: #1E3A6B;
    --bg-topbar: #16213e;
    --bg-input: #1f3460;
    --bg-hover: #1f3460;

    /* Textos claros */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #94a3b8;

    /* Bordas escuras */
    --border-color: #334155;
    --border-light: #475569;

    /* Status dark */
    --success-light: #064e3b;
    --warning-light: #78350f;
    --danger-light: #7f1d1d;
    --info-light: #1e3a8a;

    /* Sombras mais fortes */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* Sobrescrever classes Bootstrap para tema escuro */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] .h1,
[data-theme="dark"] .h2,
[data-theme="dark"] .h3,
[data-theme="dark"] .h4,
[data-theme="dark"] .h5,
[data-theme="dark"] .h6 {
    color: var(--text-primary);
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .text-secondary {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .card-header,
[data-theme="dark"] .card-title,
[data-theme="dark"] .modal-title {
    color: var(--text-primary);
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] label,
[data-theme="dark"] li,
[data-theme="dark"] td,
[data-theme="dark"] th,
[data-theme="dark"] div {
    color: var(--text-primary);
}

[data-theme="dark"] small,
[data-theme="dark"] .small {
    color: var(--text-secondary);
}

[data-theme="dark"] .list-unstyled li {
    color: var(--text-primary);
}

/* Modal no tema escuro */
[data-theme="dark"] .modal-content {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-header {
    background-color: var(--bg-card);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .modal-footer {
    background-color: var(--bg-card);
    border-top-color: var(--border-color);
}

[data-theme="dark"] .modal-body {
    background-color: var(--bg-card);
}

[data-theme="dark"] .modal-content .bg-light {
    background-color: var(--bg-input) !important;
    color: var(--text-primary);
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* SweetAlert no tema escuro */
[data-theme="dark"] .swal2-popup {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .swal2-title {
    color: var(--text-primary);
}

[data-theme="dark"] .swal2-html-container {
    color: var(--text-secondary);
}

/* ===========================================
   RESET E BASE
   =========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    transition: var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Tipografia - Títulos com Fraunces */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-primary);
}

.font-display {
    font-family: var(--font-display) !important;
}

.font-body {
    font-family: var(--font-body) !important;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* ===========================================
   LAYOUT PRINCIPAL
   =========================================== */

.wrapper {
    display: flex;
    min-height: 100vh;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
}

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

/* ===========================================
   SIDEBAR
   =========================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
}

.sidebar-brand:hover {
    color: #f3e8ff;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    backdrop-filter: blur(4px);
}

.btn-close-sidebar {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-divider {
    padding: 12px 20px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.sidebar-item {
    margin: 2px 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #ffffff;
    border-radius: 8px;
    transition: var(--transition);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-link .badge {
    margin-left: auto;
}

/* Submenu */
.has-submenu .submenu-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: var(--transition);
}

.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.has-submenu.open .sidebar-submenu {
    max-height: 500px;
}

.sidebar-submenu a {
    display: block;
    padding: 10px 16px 10px 48px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    border-radius: 6px;
    margin: 2px 0;
}

.sidebar-submenu a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

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

.avatar-initials {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.user-info {
    flex: 1;
}

.user-name {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #ffffff;
}

.user-role {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* ===========================================
   TOPBAR / NAVBAR
   =========================================== */

.topbar {
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

#sidebarToggle {
    color: var(--text-secondary);
    font-size: 20px;
    padding: 8px;
}

#sidebarToggle:hover {
    color: var(--primary);
}

.user-dropdown {
    display: flex;
    align-items: center;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials-small {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
}

.badge-counter {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 10px;
    padding: 2px 6px;
}

.notifications-dropdown {
    min-width: 300px;
}

.notification-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notification-item i {
    font-size: 16px;
    margin-top: 2px;
}

.notification-item div {
    flex: 1;
}

.notification-item span {
    display: block;
    font-size: 13px;
}

.notification-item small {
    font-size: 11px;
}

.notification-icon {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    flex-grow: 0;
}

.notification-icon i {
    font-size: 16px !important;
    margin: 0 !important;
    width: auto !important;
}

/* ===========================================
   CARDS
   =========================================== */

.card {
    background: var(--bg-card) !important;
    border: 1px solid #e9d5ff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: #ede9fe;
    border-bottom: 1px solid #ddd6fe;
    padding: 16px 20px;
    font-weight: 600;
    color: #1f2937;
}

.card-header h5,
.card-header h6,
.card-header .card-title,
.card-title {
    color: #1f2937 !important;
    font-weight: 600;
}

.page-title,
h1, h2, h3, h4, h5, h6 {
    color: #1f2937;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
}

/* Card de estatística */
.card-stats {
    border-left: 4px solid var(--primary);
}

.card-stats .card-body {
    padding: 20px;
}

.card-stats h6 {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.card-stats h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.card-stats small {
    font-size: 12px;
}

.icon-shape {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* ===========================================
   FORMULÁRIOS
   =========================================== */

.form-control,
.form-select {
    background: var(--bg-input);
    border: 1px solid #e9d5ff;
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 8px;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-input);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.input-group-text {
    background: var(--bg-hover);
    border: 1px solid #e9d5ff;
    color: var(--text-secondary);
}

/* List Group */
.list-group-item {
    background: var(--bg-card);
    border-color: #e9d5ff;
}

.list-group-item:hover {
    background: var(--bg-hover);
}

/* Modal e Dropdown */
.modal-content {
    background: var(--bg-card);
    border: 1px solid #e9d5ff;
}

.modal-header {
    background: #ede9fe;
    border-bottom: 1px solid #e9d5ff;
}

.modal-footer {
    background: var(--bg-card);
    border-top: 1px solid #e9d5ff;
}

.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid #e9d5ff;
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

/* ===========================================
   BOTÕES
   =========================================== */

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #1a1a1a;
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    border-color: var(--secondary-hover);
    color: #1a1a1a;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--text-light);
}

/* ===========================================
   TABELAS
   =========================================== */

.table {
    color: var(--text-primary);
}

.table thead th {
    background: #f3e8ff;
    border-bottom: 2px solid #e9d5ff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: #6b21a8;
    padding: 12px 16px;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f3e8ff;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

/* DataTables customização */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 6px 12px;
}

/* ===========================================
   BADGES
   =========================================== */

.badge {
    padding: 5px 10px;
    font-weight: 500;
    font-size: 11px;
    border-radius: 6px;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ===========================================
   PROGRESS BAR
   =========================================== */

.progress {
    background: var(--bg-hover);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
}

/* ===========================================
   FOOTER
   =========================================== */

.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    margin-top: auto;
}

/* ===========================================
   ALERTAS
   =========================================== */

.alert {
    border: none;
    border-radius: 10px;
    padding: 14px 20px;
    border-left: 4px solid;
}

.alert-success {
    background: var(--success-light);
    border-left-color: var(--success);
    color: var(--success);
}

.alert-danger {
    background: var(--danger-light);
    border-left-color: var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    border-left-color: var(--warning);
    color: var(--warning);
}

.alert-info {
    background: var(--info-light);
    border-left-color: var(--info);
    color: var(--info);
}

/* ===========================================
   KANBAN
   =========================================== */

.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.kanban-column {
    min-width: 300px;
    max-width: 300px;
    background: var(--bg-hover);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    padding: 16px;
    border-bottom: 2px solid;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-column-header h6 {
    margin: 0;
    font-weight: 600;
}

.kanban-column-count {
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.kanban-column-body {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 300px);
}

.kanban-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: grab;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
}

.kanban-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.kanban-card-title {
    font-weight: 500;
    margin-bottom: 8px;
}

.kanban-card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.kanban-column-title {
    font-weight: 600;
    font-size: 14px;
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.kanban-card-title {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    line-height: 1.4;
}

.kanban-card-title:hover {
    color: var(--primary);
}

.kanban-card-actions {
    opacity: 0;
    transition: var(--transition);
}

.kanban-card:hover .kanban-card-actions {
    opacity: 1;
}

.kanban-card-client,
.kanban-card-project {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.kanban-card-progress {
    margin-bottom: 8px;
}

.kanban-card-progress .progress {
    height: 4px;
    margin-bottom: 4px;
}

.kanban-card-subtasks {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.kanban-card-assignee {
    display: flex;
    align-items: center;
}

.kanban-card-priority {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 8px 0 0 8px;
}

.kanban-card {
    position: relative;
    overflow: hidden;
}

.kanban-card.border-danger {
    border-left: 3px solid var(--danger);
}

.kanban-card-ghost {
    opacity: 0.4;
    background: var(--info-light);
}

.kanban-card-drag {
    box-shadow: var(--shadow-lg);
    transform: rotate(2deg);
}

/* Avatar pequeno para Kanban */
.avatar-initials.small {
    width: 28px;
    height: 28px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary);
    color: var(--bg-sidebar);
    border-radius: 50%;
    font-weight: 600;
}

.avatar-initials.tiny {
    width: 20px;
    height: 20px;
    font-size: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--text-light);
    border-radius: 50%;
    font-weight: 600;
}

/* Avatar padrão */
.avatar-sm {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-sm .avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary);
    color: var(--bg-sidebar);
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
}

/* ===========================================
   SIDEBAR COLAPSADA (Desktop)
   =========================================== */

@media (min-width: 992px) {
    .sidebar.collapsed {
        width: var(--sidebar-collapsed-width);
    }

    .sidebar.collapsed .brand-text,
    .sidebar.collapsed .sidebar-link span,
    .sidebar.collapsed .sidebar-divider,
    .sidebar.collapsed .user-info,
    .sidebar.collapsed .submenu-arrow,
    .sidebar.collapsed .sidebar-submenu,
    .sidebar.collapsed .badge {
        display: none;
    }

    .sidebar.collapsed .sidebar-header {
        padding: 20px 15px;
        justify-content: center;
    }

    .sidebar.collapsed .sidebar-brand {
        justify-content: center;
    }

    .sidebar.collapsed .sidebar-link {
        justify-content: center;
        padding: 12px;
    }

    .sidebar.collapsed .sidebar-link i {
        font-size: 18px;
        width: auto;
    }

    .sidebar.collapsed .sidebar-item {
        margin: 2px 8px;
    }

    .sidebar.collapsed .sidebar-footer {
        padding: 12px;
    }

    .sidebar.collapsed .sidebar-user {
        justify-content: center;
    }

    .sidebar.collapsed .user-avatar {
        width: 36px;
        height: 36px;
    }

    /* Ajustar content quando sidebar esta colapsada */
    .wrapper.sidebar-collapsed .content {
        margin-left: var(--sidebar-collapsed-width);
    }

    /* Tooltip nos itens quando colapsado */
    .sidebar.collapsed .sidebar-link {
        position: relative;
    }

    .sidebar.collapsed .sidebar-link:hover::after {
        content: attr(data-title);
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        background: var(--bg-sidebar);
        color: var(--text-light);
        padding: 8px 12px;
        border-radius: 6px;
        white-space: nowrap;
        margin-left: 10px;
        font-size: 13px;
        box-shadow: var(--shadow-md);
        z-index: 1001;
    }

    /* Expandir temporariamente ao passar mouse */
    .sidebar.collapsed.hover-expand {
        width: var(--sidebar-width);
    }

    .sidebar.collapsed.hover-expand .brand-text,
    .sidebar.collapsed.hover-expand .sidebar-link span,
    .sidebar.collapsed.hover-expand .sidebar-divider,
    .sidebar.collapsed.hover-expand .user-info,
    .sidebar.collapsed.hover-expand .submenu-arrow,
    .sidebar.collapsed.hover-expand .badge {
        display: block;
    }

    .sidebar.collapsed.hover-expand .sidebar-header {
        padding: 20px;
        justify-content: space-between;
    }

    .sidebar.collapsed.hover-expand .sidebar-brand {
        justify-content: flex-start;
    }

    .sidebar.collapsed.hover-expand .sidebar-link {
        justify-content: flex-start;
        padding: 12px 16px;
    }

    .sidebar.collapsed.hover-expand .sidebar-item {
        margin: 2px 12px;
    }

    .sidebar.collapsed.hover-expand .sidebar-footer {
        padding: 16px;
    }

    .sidebar.collapsed.hover-expand .sidebar-user {
        justify-content: flex-start;
    }

    .sidebar.collapsed.hover-expand .user-avatar {
        width: 40px;
        height: 40px;
    }

    .sidebar.collapsed.hover-expand .sidebar-link:hover::after {
        display: none;
    }
}

/* ===========================================
   RESPONSIVO
   =========================================== */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar.show ~ .sidebar-overlay {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .main-content {
        padding: 16px;
    }

    .card-stats h2 {
        font-size: 24px;
    }
}

/* ===========================================
   UTILITÁRIOS
   =========================================== */

.text-primary { color: var(--primary) !important; }
.text-secondary-custom { color: var(--secondary) !important; }
.bg-primary-custom { background: var(--primary) !important; }
.bg-secondary-custom { background: var(--secondary) !important; }

.border-primary { border-color: var(--primary) !important; }
.border-secondary-custom { border-color: var(--secondary) !important; }

/* Scrollbar customizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-hover);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===========================================
   PÁGINA DE LOGIN
   =========================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .brand-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    font-size: 24px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.login-logo p {
    color: var(--text-secondary);
    margin-top: 4px;
}

.login-form .form-control {
    padding: 14px 16px;
}

.login-form .btn-primary {
    padding: 14px;
    font-size: 16px;
}

/* ============================================
   HIERARQUIA DE TAREFAS
   ============================================ */

/* Indicadores no Kanban */
.kanban-card-children,
.kanban-card-parent {
    font-size: 11px;
    margin-top: 6px;
    padding: 2px 0;
}

.kanban-card-parent {
    color: var(--text-muted);
    font-style: italic;
}

.kanban-card-children {
    color: var(--info);
}

/* Indicador de tarefa filha na listagem */
.task-is-child {
    opacity: 0.9;
}

.task-is-child td:first-child {
    position: relative;
}

/* Badge de contagem de filhas */
.badge-children {
    font-size: 0.7em;
    vertical-align: middle;
}

/* Lista de sub tarefas no formulário */
.child-tasks-list .list-group-item {
    border-left: 3px solid var(--primary);
    transition: all 0.2s ease;
}

.child-tasks-list .list-group-item:hover {
    background-color: var(--bg-hover);
    border-left-color: var(--secondary);
}

/* Tarefa filha concluída */
.child-task-completed {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Toggle de mostrar filhas no kanban */
#show-children + label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===========================================
   SUBTAREFAS NA PAGINA DE PROJETO
   =========================================== */

/* Container de subtarefas colapsável */
.subtasks-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.subtasks-container.show {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

/* Item de tarefa */
.task-item {
    transition: background-color 0.2s ease;
}

.task-item:hover {
    background-color: var(--bg-hover);
}

.task-item.has-subtasks {
    border-left: 3px solid var(--primary);
}

/* Toggle de subtarefas */
.toggle-subtasks {
    transition: transform 0.2s ease;
}

.toggle-subtasks i {
    transition: transform 0.2s ease;
}

/* Item de subtarefa */
.subtask-item {
    border-left: 2px solid var(--secondary) !important;
    transition: all 0.2s ease;
}

.subtask-item:hover {
    background-color: #f1f5f9 !important;
}

/* Metadados de tarefa */
.task-meta {
    line-height: 1.4;
}

/* Botão de toggle global */
#toggle-all-subtasks {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

#toggle-all-subtasks:hover {
    opacity: 1;
}

/* ===========================================
   PAINEL DE ATENDIMENTOS (KANBAN)
   =========================================== */

/* Cores customizadas - Roxo */
.bg-purple {
    background-color: #8b5cf6 !important;
}

.text-purple {
    color: #8b5cf6 !important;
}

.border-purple {
    border-color: #8b5cf6 !important;
}

.btn-purple {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
    color: #fff;
}

.btn-purple:hover {
    background-color: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}

/* Cards de atendimento */
.attendance-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 8px;
    transition: var(--transition);
}

.attendance-card:hover {
    box-shadow: var(--shadow);
}

.attendance-card.completed {
    opacity: 0.8;
}

.attendance-card.absent {
    opacity: 0.6;
}

.attendance-card.absent .fw-semibold {
    text-decoration: line-through;
}

.attendance-column {
    min-height: 200px;
}

/* Badges pequenos */
.badge-sm {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}
