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

:root {
    --primary: #ff6a00;        /* Laranja Aura */
    --primary-dark: #e65c00;   /* Laranja mais escuro (hover) */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --secondary: #6b7280;
    --bg: #f9fafb;
    --bg-card: #ffffff;
    --text: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);

    /* Marca da empresa (sobrescritas por empresa em _marca_estilo.html) */
    --primary-text: #ffffff;
    --primary-ring: rgba(255, 106, 0, 0.15);
    --sidebar-bg: var(--bg-card);
    --sidebar-text: var(--text);
    --sidebar-muted: var(--text-muted);
    --sidebar-hover: var(--bg);
    --sidebar-active-text: var(--primary);
    --sidebar-border: var(--border);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px var(--shadow);
}

.login-box h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 2rem;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header{
    padding:18px 16px;
    border-bottom:1px solid var(--sidebar-border);
    display:flex;
    align-items:center;
    justify-content:center; /* CENTRALIZA O LOGO */
    position:relative; /* necessário para o botão */
}

.btn-toggle {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    display: block;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background 0.2s;
}

.nav-item:hover {
    background: var(--sidebar-hover);
}

.nav-item.active {
    background: var(--sidebar-hover);
    border-left: 3px solid var(--primary);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.nav-item .icon {
    margin-right: 12px;
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--sidebar-border);
}

.user-info {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.user-name {
    font-weight: 600;
}

.user-role {
    font-size: 0.875rem;
    color: var(--sidebar-muted);
}

.btn-logout {
    display: block;
    text-align: center;
    padding: 8px;
    background: var(--danger);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: opacity 0.2s;
}

.btn-logout:hover {
    opacity: 0.9;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    padding-bottom: 80px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Mobile Nav */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 10px 0;
    z-index: 1000;
}

.mobile-nav a {
    flex: 1;
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px;
}

.mobile-nav a.active {
    color: var(--primary);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 1px 3px var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 12px;
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
}

.stat-content h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-value.positive {
    color: var(--success);
}

.stat-value.negative {
    color: var(--danger);
}

.stat-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary); /* laranja do logo (ou cor da empresa) */
    color: var(--primary-text);
    border: none;
}

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


.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-group.flex-2 {
    grid-column: span 2;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.filters-form .form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.form-text-display {
    font-weight: 600;
    padding: 10px;
    background: var(--bg);
    border-radius: 6px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
}

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

.table tfoot {
    font-weight: 700;
    background: var(--bg);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-primary {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

.badge-secondary {
    background: rgba(107, 114, 128, 0.1);
    color: var(--secondary);
}

.badge-pendente {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-pago {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-atrasado {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-cancelado {
    background: rgba(107, 114, 128, 0.1);
    color: var(--secondary);
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: slideIn 0.3s;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info);
    border: 1px solid var(--info);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--text);
}

.modal-content h2 {
    margin-bottom: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

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

.positive {
    color: var(--success);
}

.negative {
    color: var(--danger);
}

/* Kanban Styles */
.kanban-boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.board-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.board-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px var(--shadow);
}

.board-card h3 {
    margin-bottom: 10px;
    color: var(--text);
}

.board-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 10px;
}

.board-client {
    color: var(--primary);
    font-size: 0.875rem;
    margin-bottom: 15px;
}

.board-actions {
    display: flex;
    gap: 10px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state p:first-child {
    font-size: 3rem;
    margin-bottom: 10px;
}

.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-picker label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
}

.color-picker label:hover {
    border-color: var(--primary);
    background: var(--bg);
}

.color-picker input[type="radio"] {
    width: auto;
    margin: 0;
}

.color-picker span {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Kanban Board */
.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.kanban-header-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.kanban-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.kanban-search-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.kanban-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0.65;
}

.kanban-search {
    width: 240px;
    padding: 8px 32px 8px 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s, width 0.2s;
}

.kanban-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
    width: 280px;
}

.kanban-search::-webkit-search-decoration,
.kanban-search::-webkit-search-cancel-button,
.kanban-search::-webkit-search-results-button,
.kanban-search::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.kanban-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.85;
    transition: opacity 0.2s, background 0.2s;
}

.kanban-search-clear:hover {
    opacity: 1;
    background: var(--danger);
}

.search-empty-msg {
    padding: 20px 8px;
    font-size: 0.85rem;
    font-style: italic;
}

.kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    min-height: 500px;
}

.kanban-list {
    flex: 0 0 300px;
    background: var(--bg);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 250px);
}

.list-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.list-header h3 {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    cursor: text;
    margin: 0;
}

.card-count {
    background: var(--secondary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 4px;
}

.btn-icon:hover {
    opacity: 1;
}

.cards-container {
    flex: 1;
    overflow-y: auto;
    min-height: 100px;
    padding: 5px;
    border-radius: 8px;
    transition: background 0.2s;
}

.cards-container.drag-over {
    background: rgba(59, 130, 246, 0.1);
    border: 2px dashed var(--primary);
}

.kanban-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px var(--shadow);
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.kanban-card:active {
    cursor: grabbing;
}

.card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.card-label {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    display: inline-block;
}

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

.card-header-mini strong {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text);
}

.card-actions-mini {
    display: flex;
    gap: 4px;
}

.btn-icon-mini {
    background: none;
    border: none;
    font-size: 0.875rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 2px;
}

.btn-icon-mini:hover {
    opacity: 1;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.4;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-user {
    background: var(--bg);
    padding: 4px 8px;
    border-radius: 4px;
}

.card-due {
    background: var(--bg);
    padding: 4px 8px;
    border-radius: 4px;
}

.btn-add-card {
    width: 100%;
    padding: 10px;
    background: none;
    border: 2px dashed var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
    font-size: 0.875rem;
}

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

/* Etiquetas */
.etiquetas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.etiqueta-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.etiqueta-preview-large {
    padding: 15px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    text-align: center;
    font-size: 1.1rem;
}

.etiqueta-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.etiqueta-actions {
    display: flex;
    gap: 10px;
}

.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.color-picker-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border: 2px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
}

.color-picker-grid label:hover {
    border-color: var(--primary);
    background: var(--bg);
}

.color-picker-grid input[type="radio"] {
    width: auto;
    margin: 0;
}

.color-picker-grid span {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.etiquetas-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.etiqueta-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.etiqueta-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.etiqueta-preview {
    padding: 4px 10px;
    border-radius: 4px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Histórico */
.card-transfer-name {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.modal-large {
    max-width: 700px;
}

.historico-timeline {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -30px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--bg-card);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 17px;
    bottom: -20px;
    width: 2px;
    background: var(--border);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-content {
    background: var(--bg);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.timeline-header strong {
    color: var(--text);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-body {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Comentários */
.comentarios-section {
    margin-top: 0;
}

.comentarios-lista {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
}

.comentario-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--bg-card);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.comentario-item:last-child {
    margin-bottom: 0;
}

.comentario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.comentario-header strong {
    color: var(--text);
    font-size: 0.85rem;
}

.comentario-data {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.comentario-texto {
    color: var(--text);
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.comentario-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.comentario-input-wrapper textarea {
    flex: 1;
    resize: vertical;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
}

.comentario-input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.comentario-input-wrapper .btn {
    height: fit-content;
    white-space: nowrap;
}

/* Anexos do card */
.anexos-lista {
    max-height: 220px;
    overflow-y: auto;
    padding: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
}

.anexo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--bg-card);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.anexo-item:last-child {
    margin-bottom: 0;
}

.anexo-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.anexo-nome {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    word-break: break-all;
}

.anexo-nome:hover {
    text-decoration: underline;
}

.anexo-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.anexo-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 4px;
}

.anexo-input-wrapper input[type="file"] {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text);
}

.anexo-input-wrapper .btn {
    white-space: nowrap;
}

/* Mini editor de formatação */
.fmt-toolbar {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.fmt-btn {
    min-width: 30px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.2;
}

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

/* Mini-editor WYSIWYG do Kanban (caixa contenteditable no lugar do textarea) */
.mini-editor {
    min-height: 90px;
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text);
    font: inherit;
    line-height: 1.5;
    white-space: pre-wrap;   /* \n vira quebra de linha visível */
    word-wrap: break-word;
    outline: none;
}
.mini-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.mini-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted, #9ca3af);
}
.mini-editor ul {
    margin: 4px 0;
    padding-left: 20px;
    list-style: disc;
}
.mini-editor .mention-highlight { /* menções ficam literais no editor, sem realce */
    background: none;
    color: inherit;
    font-weight: inherit;
}
/* Caixa de comentário: o editor divide o espaço com o botão Enviar (flex) */
.comentario-input-wrapper .mini-editor {
    flex: 1;
    min-height: 40px;
}

.fmt-lista {
    margin: 2px 0;
    padding-left: 22px;
}

.fmt-lista li {
    white-space: normal;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 999;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .btn-toggle {
        display: block;
    }

    .btn-open-sidebar {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .mobile-nav {
        display: flex;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-group.flex-2 {
        grid-column: span 1;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }

    .kanban-header-actions {
        width: 100%;
        flex-wrap: nowrap;
    }

    .kanban-search-wrapper {
        flex: 1 1 auto;
        min-width: 0;
    }

    .kanban-search {
        width: 100%;
    }

    .kanban-search:focus {
        width: 100%;
    }

    .kanban-header-actions .btn-primary {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .kanban-board {
        flex-direction: column;
    }
    
    .kanban-list {
        flex: 1;
        max-height: none;
    }
    
    .kanban-boards-grid {
        grid-template-columns: 1fr;
    }

    .kanban-header-actions .btn-primary {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
}
/* ============================
MODAL GRANDE DO CARD
============================ */

.modal-large {
  width: min(1200px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
}

/* Corpo do modal */
.card-view-body {
    margin-top: 15px;
}

/* Seção interna */
.card-view-section h4 {
    margin-bottom: 8px;
    font-weight: 600;
}

/* Texto do card */
.card-view-text {
    white-space: pre-wrap;   /* mantém quebra de linha */
    line-height: 1.6;
    padding: 16px;

    border-radius: 12px;
    border: 1px solid #e5e7eb;

    background-color: #fafafa;

    min-height: 250px;
}

/* ============================
MELHORIA UX — CARD CLICÁVEL
============================ */

.kanban-card {
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.kanban-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* evita efeito hover enquanto arrasta */
.kanban-card.dragging {
    cursor: grabbing;
    transform: none;
    box-shadow: none;
}

.login-logo{
    width: 220px;
    margin-bottom: 10px;
}

.login-box{
    text-align: center;
}

.sidebar-logo{
    width:64px;
    height:auto;
    display:block;
}


/* Sidebar collapsed (desktop) */
@media (min-width: 769px) {
  .sidebar {
    transition: width 0.3s ease, transform 0.3s ease;
  }
  .sidebar.collapsed {
    width: 0;
    overflow: hidden;
    border-right: none;
  }
  .main-content {
    transition: margin-left 0.3s ease;
  }
  .sidebar.collapsed ~ .main-content {
    margin-left: 0;
  }
}

/* Botão flutuante para reabrir sidebar quando oculta */
.btn-open-sidebar {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: opacity 0.3s;
}
.btn-open-sidebar:hover {
    background: var(--bg);
}
.btn-open-sidebar.visible {
    display: block;
}
/* Observações do cliente (maior + redimensionável) */
.obs-textarea {
  min-height: 480px;     /* 3x maior (ajuste se quiser mais/menos) */
  resize: vertical;      /* pode aumentar/diminuir (vertical) */
  line-height: 1.4;
}

/* ============================
   NOTIFICAÇÕES
============================ */
.notificacoes-wrapper {
    position: relative;
    margin-bottom: 8px;
    text-align: center;
}

.btn-notificacoes {
    background: none;
    color: inherit;
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
    width: 100%;
}

.btn-notificacoes:hover {
    background: var(--sidebar-hover);
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    padding: 0 4px;
}

.notificacoes-dropdown {
    position: fixed;
    width: 340px;
    max-height: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 9999;
    overflow: hidden;
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.btn-marcar-todas {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
}

.btn-marcar-todas:hover {
    text-decoration: underline;
}

.notif-dropdown-body {
    max-height: 340px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

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

.notif-item.nao-lida {
    background: #fff7ed;
    border-left: 3px solid var(--primary);
}

.notif-item.executada {
    opacity: 0.6;
}

.notif-item-content {
    flex: 1;
    min-width: 0;
}

.notif-item .notif-msg {
    font-size: 0.82rem;
    color: var(--text);
    margin-bottom: 2px;
}

.notif-item .notif-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.notif-item-actions {
    flex-shrink: 0;
}

.btn-executada {
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.btn-executada:hover {
    background: #059669;
}

.notif-executada-label {
    font-size: 0.68rem;
    color: var(--success);
    font-weight: 600;
    white-space: nowrap;
}

/* ============================
   AUTOCOMPLETE @MENÇÃO
============================ */
.mention-dropdown {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 3000;
    max-height: 180px;
    overflow-y: auto;
    min-width: 200px;
}

.mention-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.1s;
}

.mention-item:hover,
.mention-item.active {
    background: var(--primary);
    color: #fff;
}

/* Destaque visual de @menção no texto renderizado */
.mention-highlight {
    color: var(--primary);
    font-weight: 600;
}
/* =========================
   PAINEL DO SUPER-ADMIN
   ========================= */
.superadmin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.superadmin-header nav {
    display: flex;
    gap: 18px;
}

.superadmin-header nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.superadmin-header nav a:hover {
    color: var(--primary);
}

.superadmin-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

.superadmin-login {
    max-width: 420px;
    margin: 60px auto;
}

.superadmin-login h1 {
    margin-bottom: 4px;
}

.senha-gerada {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Nome da empresa em texto quando não há logo */
.sidebar-marca-nome {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--sidebar-text);
    text-align: center;
    padding: 0 28px;
    line-height: 1.3;
}

.login-marca-nome {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

/* Tela de aparência */
.cor-campo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cor-campo input[type="color"] {
    width: 56px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    cursor: pointer;
}

.previa-marca {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 6px 0 22px;
}

.previa-login {
    padding: 14px 22px;
    border-radius: 10px;
    color: var(--primary-text);
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.imagem-atual {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}

.imagem-atual img {
    max-height: 56px;
    max-width: 180px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px;
    background: #ffffff;
}

/* =========================
   ESTOQUE
   ========================= */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 9px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-qtd {
    display: inline-block;
    min-width: 22px;
    padding: 0 6px;
    margin-left: 4px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    text-align: center;
}

.estoque-nav {
    margin-top: -6px;
}

.stat-link {
    text-decoration: none;
    color: inherit;
}

.stat-link:hover {
    box-shadow: 0 4px 12px var(--shadow);
}

.table .num {
    text-align: right;
    white-space: nowrap;
}

.saldo-baixo {
    color: var(--danger);
    font-weight: 700;
}

.mov-positivo {
    color: var(--success);
    font-weight: 600;
}

.mov-negativo {
    color: var(--danger);
    font-weight: 600;
}

.mov-corrigida td {
    opacity: 0.7;
}

.estoque-acoes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.inline-form {
    display: inline;
}

details.corrigir summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
}

details.corrigir form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    min-width: 200px;
}

.campo-contagem {
    max-width: 140px;
}

.receita-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

details.editar-receita {
    margin-top: 16px;
}

details.editar-receita summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
}

.linha-receita {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px;
    gap: 10px;
    margin-bottom: 8px;
}

.lista-erros {
    margin: 0 0 12px 20px;
    color: var(--danger);
}

.subtitulo-ajuda {
    margin: 22px 0 8px;
    font-size: 1rem;
}

.ajuda-importacao {
    margin-left: 20px;
    color: var(--text-muted);
}

.ajuda-importacao li {
    margin-bottom: 4px;
}
