/**
 * AC360 - Estilos Customizados
 *
 * Tema: Light (padrão) / Dark
 * Cores: Azul escuro (primária) + Amarelo (secundária)
 */

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

:root {
    /* Cores Primárias */
    --primary: #171e5c;
    --primary-hover: #111747;
    --primary-light: #242d7a;
    --primary-rgb: 23, 30, 92;

    /* Cores Secundárias */
    --secondary: #fdc200;
    --secondary-hover: #e5b000;
    --secondary-light: #ffdb4d;

    /* Fundos */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #171e5c;
    --bg-topbar: #ffffff;
    --bg-input: #ffffff;
    --bg-hover: #f1f5f9;

    /* 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 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

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

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

/* Tema Escuro */
[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-light: #93c5fd;

    --secondary: #fbbf24;
    --secondary-hover: #f59e0b;
    --secondary-light: #fcd34d;

    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #0f172a;
    --bg-topbar: #1e293b;
    --bg-input: #334155;
    --bg-hover: #334155;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #94a3b8;

    --border-color: #334155;
    --border-light: #475569;

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

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* 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: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-body);
    transition: var(--transition);
}

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.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-light);
    font-size: 20px;
    font-weight: 700;
}

.sidebar-brand:hover {
    color: var(--text-light);
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-sidebar);
}

.brand-icon.brand-icon-logo {
    background: #ffffff;
    padding: 4px;
}

.brand-icon .sidebar-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.btn-close-sidebar {
    background: none;
    border: none;
    color: var(--text-light);
    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.4);
    font-weight: 600;
}

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

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

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.sidebar-link.active {
    background: var(--secondary);
    color: var(--bg-sidebar);
}

.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.6);
    font-size: 13px;
    border-radius: 6px;
    margin: 2px 0;
}

.sidebar-submenu a:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

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

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

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

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

.avatar-initials {
    font-size: 14px;
    font-weight: 600;
    color: var(--bg-sidebar);
}

.user-info {
    flex: 1;
}

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

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

/* ===========================================
   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);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
}

.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 var(--border-color);
    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 var(--border-color);
    color: var(--text-secondary);
}

/* ===========================================
   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: var(--bg-hover);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 12px 16px;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    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: 80px;
    height: 80px;
    margin: 0 auto 16px;
    font-size: 24px;
    background: transparent;
}

.login-logo .brand-icon .logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.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;
}

/* ===========================================
   ANOTACOES PESSOAIS (NOTAS/LEMBRETES/TAREFAS)
   =========================================== */

/* Card de anotacao */
.nota-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
}

.nota-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.nota-card .card-body {
    min-height: 100px;
}

.nota-card .card-text {
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.nota-card .card-footer {
    background: transparent;
    border-top: none;
}

/* Cores preset para anotacoes */
.cor-preset {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.cor-preset:hover {
    transform: scale(1.15);
}

/* Ajustes para dark mode nas anotacoes */
[data-theme="dark"] .nota-card {
    color: #1f2937;
}

[data-theme="dark"] .nota-card .card-title,
[data-theme="dark"] .nota-card .card-text {
    color: #1f2937 !important;
}

[data-theme="dark"] .nota-card .badge {
    opacity: 0.9;
}

/* Toast container para notificacoes */
#toast-container {
    z-index: 9999;
}
