/* ===================================================
   TaskFlow — RE/MAX JUNTUS Design System
   (identity extracted from React/Tailwind reference app)
   =================================================== */

/* ---------- CSS Variables ---------- */
:root {
    /* Surfaces */
    --bg-page:     #f8fafc;
    --bg-surface:  #ffffff;
    --bg-sidebar:  #ffffff;
    --bg-column:   #f1f5f9;
    --bg-hover:    #f1f5f9;
    --bg-active:   #e0e7ff;

    /* Text */
    --text-primary:   #0f172a;
    --text-secondary: #64748b;
    --text-muted:     #94a3b8;
    --text-brand:     #002975;

    /* Brand (RE/MAX JUNTUS) */
    --brand-primary: #002975;
    --brand-mid:     #003da5;
    --brand-light:   #b4c5ff;
    --brand-gradient: linear-gradient(135deg, #002975 0%, #003da5 100%);

    --accent:       var(--brand-primary);
    --accent-light: var(--brand-light);
    --accent-bg:    #e0e7ff;

    /* Status accents */
    --green:  #10b981;
    --orange: #f59e0b;
    --blue:   #3b82f6;
    --pink:   #ec4899;
    --yellow: #eab308;
    --teal:   #14b8a6;
    --gray:   #64748b;
    --red:    #ef4444;
    --purple: #a855f7;

    /* Borders */
    --border:       #e2e8f0;
    --border-light: #f1f5f9;

    /* Shadows */
    --shadow-sm:   0 1px 2px 0 rgba(15, 23, 42, .05);
    --shadow-md:   0 4px 6px -1px rgba(15, 23, 42, .08), 0 2px 4px -2px rgba(15, 23, 42, .04);
    --shadow-lg:   0 10px 15px -3px rgba(15, 23, 42, .08), 0 4px 6px -4px rgba(15, 23, 42, .05);
    --shadow-card: 0 1px 3px rgba(15, 23, 42, .06);
    --shadow-drag: 0 12px 36px rgba(0, 41, 117, .2);
    --shadow-cta:  0 10px 15px -3px rgba(0, 41, 117, .25);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Layout */
    --sidebar-width: 288px;
    --header-height: 72px;

    /* Typography */
    --tracking-tight:   -0.015em;
    --tracking-tighter: -0.035em;

    /* Transitions */
    --transition: .25s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Dark theme (RE/MAX JUNTUS navy) ---------- */
html[data-theme="dark"] {
    --bg-page:     #00142a;
    --bg-surface:  #162b43;
    --bg-sidebar:  #000f21;
    --bg-column:   #0b1f36;
    --bg-hover:    rgba(22, 43, 67, .6);
    --bg-active:   #162b43;

    --text-primary:   #ffffff;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;
    --text-brand:     #b4c5ff;

    --accent:       var(--brand-light);
    --accent-light: var(--brand-light);
    --accent-bg:    rgba(180, 197, 255, .1);

    --border:       rgba(255, 255, 255, .08);
    --border-light: rgba(255, 255, 255, .04);

    --shadow-sm:   0 1px 2px 0 rgba(0, 0, 0, .4);
    --shadow-md:   0 4px 6px -1px rgba(0, 0, 0, .5);
    --shadow-lg:   0 10px 15px -3px rgba(0, 0, 0, .6);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, .4);
    --shadow-drag: 0 12px 36px rgba(180, 197, 255, .15);
    --shadow-cta:  0 10px 15px -3px rgba(180, 197, 255, .2);

    color-scheme: dark;
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

input,
textarea,
select,
button {
    font-family: inherit;
    font-size: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
li {
    list-style: none;
}

.hidden {
    display: none !important;
}

/* ===================================================
   LOGIN SCREEN
   =================================================== */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at top left, rgba(180, 197, 255, .12) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(0, 61, 165, .18) 0%, transparent 50%),
        linear-gradient(135deg, #00142a 0%, #001a36 50%, #000f21 100%);
    padding: 20px;
}

.login-container {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    animation: slideUp .5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-bottom: 8px;
}

.login-logo h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: var(--tracking-tighter);
    text-transform: uppercase;
    color: var(--brand-primary);
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: .95rem;
}

/* Login tabs */
.login-tabs {
    display: flex;
    background: var(--bg-column);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
}

.login-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.login-tab.active {
    background: var(--bg-surface);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

/* Login form */
.login-form {
    display: none;
}

.login-form.active {
    display: block;
    animation: fadeIn .3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Color picker */
.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition);
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.selected {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--text-muted);
}

/* ===================================================
   FORMS (shared)
   =================================================== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.form-group textarea {
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn-primary {
    background: var(--brand-gradient);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: var(--radius-md);
    font-weight: 700;
    letter-spacing: var(--tracking-tight);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-cta);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 20px -4px rgba(0, 41, 117, .35);
}

.btn-primary:active {
    transform: scale(.97);
}

.btn-full {
    width: 100%;
}

.btn-outline {
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg);
}

.btn-ghost {
    background: none;
    border: none;
    color: var(--orange);
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-ghost:hover {
    background: #fef2f2;
}

.btn-small {
    background: var(--brand-gradient);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-cta);
}

/* ===================================================
   APP LAYOUT
   =================================================== */
.app {
    display: flex;
    height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
    transition: transform .3s ease;
    z-index: 30;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-title {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: var(--tracking-tighter);
    text-transform: uppercase;
    color: var(--text-brand);
}

.sidebar-nav {
    padding: 12px 14px;
    flex: 1;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-label {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding: 0 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    font-size: .9rem;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--brand-gradient);
    color: #ffffff;
    font-weight: 700;
    box-shadow: var(--shadow-cta);
}

.nav-item.active svg {
    color: #ffffff;
}

.nav-item svg {
    flex-shrink: 0;
}

/* Team members */
.team-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: .9rem;
}

.team-member:hover {
    background: var(--bg-hover);
}

.team-member .avatar {
    width: 28px;
    height: 28px;
    font-size: .7rem;
}

.btn-add-member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    width: 100%;
    margin-top: 6px;
    font-size: .85rem;
}

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

/* ---------- Main Content ---------- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Top Header */
.top-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 9px 14px 9px 40px;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    background: var(--bg-column);
    transition: var(--transition);
    outline: none;
    font-size: .9rem;
}

.search-input:focus {
    border-color: var(--accent);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.header-actions {
    margin-left: auto;
    position: relative;
}

.current-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.current-user:hover {
    background: var(--bg-hover);
}

/* Avatar */
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: .85rem;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    z-index: 999;
    overflow: hidden;
    animation: dropdownIn .2s ease;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    font-size: .9rem;
    color: var(--text-primary);
}

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

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
}

/* ---------- Board Header ---------- */
.board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px 10px;
    flex-shrink: 0;
}

.board-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.board-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: var(--tracking-tight);
    color: var(--text-brand);
    outline: none;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    min-width: 100px;
}

.board-title:hover,
.board-title:focus {
    background: var(--bg-hover);
}

.board-star {
    font-size: 1.4rem;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.board-star:hover {
    transform: scale(1.2);
}

.board-star.starred {
    color: var(--yellow);
}

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

/* ===================================================
   KANBAN BOARD
   =================================================== */
.board {
    display: flex;
    gap: 18px;
    padding: 10px 28px 28px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    align-items: flex-start;
}

.board::-webkit-scrollbar {
    height: 8px;
}

.board::-webkit-scrollbar-track {
    background: transparent;
}

.board::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

/* ---------- Column ---------- */
.column {
    background: var(--bg-column);
    border-radius: var(--radius-lg);
    min-width: 300px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--header-height) - 110px);
    flex-shrink: 0;
    border: 1px solid var(--border-light);
    transition: box-shadow var(--transition);
}

.column.drag-over {
    box-shadow: 0 0 0 2px var(--accent), var(--shadow-md);
}

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

.column-title-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.column-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.column-name {
    font-weight: 700;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.column-count {
    background: var(--bg-hover);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 700;
}

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

.column-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.column-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.column-cards {
    padding: 10px 12px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 60px;
}

.column-cards::-webkit-scrollbar {
    width: 4px;
}

.column-cards::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

/* ---------- Task Card ---------- */
.task-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 14px 14px 14px 16px;
    cursor: grab;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: all var(--transition);
    position: relative;
    user-select: none;
}

.task-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border);
}

.task-card.dragging {
    opacity: .5;
    transform: rotate(2deg) scale(1.02);
    box-shadow: var(--shadow-drag);
}

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

.card-number {
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.card-title {
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: 6px;
    line-height: 1.35;
    color: var(--text-primary);
}

.card-desc {
    font-size: .82rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.tag {
    padding: 2px 10px;
    border-radius: 50px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .2px;
}

.tag-frontend {
    background: #dbeafe;
    color: #1d4ed8;
}

.tag-backend {
    background: #dcfce7;
    color: #15803d;
}

.tag-design {
    background: #fce7f3;
    color: #be185d;
}

.tag-bug {
    background: #fee2e2;
    color: #dc2626;
}

.tag-ui-ux,
.tag-uiux,
.tag-ui\/ux {
    background: #ede9fe;
    color: #6C5CE7;
}

.tag-marketing {
    background: #fef3c7;
    color: #b45309;
}

.tag-default {
    background: #f3f4f6;
    color: #4b5563;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .78rem;
    color: var(--text-muted);
}

.card-priority {
    display: flex;
    align-items: center;
    gap: 4px;
}

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.priority-high .priority-dot {
    background: var(--orange);
}

.priority-medium .priority-dot {
    background: var(--yellow);
}

.priority-low .priority-dot {
    background: var(--green);
}

.card-due {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-due.overdue {
    color: var(--orange);
    font-weight: 600;
}

.card-avatar {
    width: 26px;
    height: 26px;
    font-size: .65rem;
}

/* Subtask progress */
.card-subtasks {
    margin-bottom: 10px;
}

.subtask-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.subtask-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 10px;
    transition: width .3s ease;
}

.subtask-count {
    font-size: .72rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

/* ===================================================
   MODALS
   =================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .3);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn .2s ease;
}

.modal {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn .3s ease;
}

.modal-small {
    max-width: 400px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px 0;
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 20px 28px 28px;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 4px;
}

/* Subtask list in modal */
.subtasks-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-column);
    border-radius: var(--radius-sm);
}

.subtask-item input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.subtask-item span {
    flex: 1;
    font-size: .9rem;
}

.subtask-item span.done {
    text-decoration: line-through;
    color: var(--text-muted);
}

.subtask-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 2px;
    transition: var(--transition);
}

.subtask-remove:hover {
    color: var(--orange);
}

.subtask-add {
    display: flex;
    gap: 6px;
}

.subtask-add input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition);
}

.subtask-add input:focus {
    border-color: var(--accent);
}

/* ===================================================
   TASK TEMPLATES & CUSTOM FIELDS
   =================================================== */

/* Template list in sidebar */
.template-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: .85rem;
    color: var(--text-secondary);
}

.template-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.template-item .tpl-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    flex-shrink: 0;
}

.template-item .tpl-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-item .tpl-edit-btn {
    opacity: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
    font-size: .8rem;
    transition: var(--transition);
}

.template-item:hover .tpl-edit-btn {
    opacity: 1;
}

.template-item .tpl-edit-btn:hover {
    color: var(--accent);
}

/* Form hint */
.form-hint {
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Template field builder (in template modal) */
.tpl-fields-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.tpl-field-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-column);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.tpl-field-item .field-type-badge {
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.field-type-badge.type-text {
    background: #dbeafe;
    color: #1d4ed8;
}

.field-type-badge.type-url {
    background: #dcfce7;
    color: #15803d;
}

.field-type-badge.type-checkbox {
    background: #fef3c7;
    color: #b45309;
}

.tpl-field-item .field-label {
    flex: 1;
    font-size: .85rem;
    font-weight: 500;
}

.tpl-field-item .field-placeholder {
    font-size: .75rem;
    color: var(--text-muted);
    font-style: italic;
}

.tpl-field-add {
    display: grid;
    grid-template-columns: auto 1fr 1fr auto;
    gap: 6px;
    align-items: center;
}

.tpl-field-add select {
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    font-size: .82rem;
    outline: none;
}

.tpl-field-add select:focus {
    border-color: var(--accent);
}

.tpl-field-add input {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition);
    font-size: .85rem;
}

.tpl-field-add input:focus {
    border-color: var(--accent);
}

/* Custom fields rendering in task modal */
.custom-fields-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-field-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.custom-field-item label {
    font-size: .8rem !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-field-item label .cf-type-icon {
    font-size: .7rem;
}

.custom-field-item input[type="text"],
.custom-field-item input[type="url"] {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
    background: var(--bg-surface);
}

.custom-field-item input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.custom-field-item .cf-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-column);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.custom-field-item .cf-checkbox-row input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.custom-field-item .cf-checkbox-row span {
    font-size: .9rem;
}

/* Custom fields display on task card */
.card-custom-fields {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-cf-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    color: var(--text-secondary);
    padding: 3px 0;
}

.card-cf-item .cf-icon {
    flex-shrink: 0;
    opacity: .6;
}

.card-cf-item .cf-label {
    font-weight: 600;
    color: var(--text-muted);
}

.card-cf-item .cf-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-cf-item a {
    color: var(--accent);
    text-decoration: none;
}

.card-cf-item a:hover {
    text-decoration: underline;
}

.card-cf-item .cf-check {
    color: var(--green);
}

.card-cf-item .cf-uncheck {
    color: var(--text-muted);
}

/* Template badge on card */
.card-template-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-bg);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 50px;
    font-size: .7rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Template assignee preset chips */
.tpl-assignees-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tpl-assignee-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    font-size: .85rem;
    background: var(--bg-surface);
    user-select: none;
}

.tpl-assignee-chip:hover {
    border-color: var(--accent);
}

.tpl-assignee-chip.selected {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.tpl-assignee-chip .chip-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: .6rem;
    flex-shrink: 0;
}

.tpl-assignee-chip .chip-check {
    font-size: .75rem;
    opacity: 0;
    transition: var(--transition);
}

.tpl-assignee-chip.selected .chip-check {
    opacity: 1;
}

.tpl-assignees-empty {
    color: var(--text-muted);
    font-size: .85rem;
    padding: 8px 0;
    font-style: italic;
}

/* ===================================================
   TOAST NOTIFICATIONS
   =================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    animation: toastIn .3s ease;
    min-width: 250px;
    border-left: 4px solid var(--accent);
}

.toast.success {
    border-left-color: var(--green);
}

.toast.error {
    border-left-color: var(--orange);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* ===================================================
   EMPTY COLUMN PLACEHOLDER
   =================================================== */
.column-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: .85rem;
    text-align: center;
    gap: 6px;
}

.column-empty svg {
    opacity: .4;
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-toggle {
        display: flex;
    }

    .board-header {
        padding: 14px 16px 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .board {
        padding: 10px 16px 28px;
    }

    .top-header {
        padding: 0 16px;
    }

    .column {
        min-width: 280px;
    }
}

/* ---- Permissions Matrix ---- */
.permissions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 8px;
}
.permissions-table th,
.permissions-table td {
    padding: 6px 10px;
    border: 1px solid var(--border);
    text-align: center;
}
.permissions-table th:first-child,
.permissions-table td:first-child {
    text-align: left;
    font-weight: 500;
}
.permissions-table thead th {
    background: var(--bg-secondary);
    font-weight: 600;
}
.permissions-table .perm-yes { color: var(--success); font-weight: 700; }
.permissions-table .perm-no  { color: var(--text-muted); }

/* ---- Template hours badge ---- */
.tpl-hours-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ---- Template form row ---- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row-flex {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.form-row-flex .form-group {
    flex: 1 1 200px;
    min-width: 0;
}

/* ===================== NEW VIEWS ===================== */

/* ---- View Panel base ---- */
.view-panel { padding: 0; }
#view-board  { padding: 0; }

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px 16px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}
.view-title { font-size: 1.3rem; font-weight: 700; margin: 0; }
.view-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.filter-select {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.88rem;
    cursor: pointer;
}

/* ---- Summary cards ---- */
.view-summary, .financeiro-summary {
    display: flex;
    gap: 14px;
    padding: 18px 28px;
    flex-wrap: wrap;
}
.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 20px;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.summary-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.summary-value { font-size: 1.3rem; font-weight: 700; }
.summary-credit .summary-value { color: #00B894; }
.summary-debit  .summary-value { color: #E17055; }
.summary-neutral .summary-value { color: var(--text-primary); }

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 48px 20px;
    font-size: 0.95rem;
}

/* ---- Nav badge ---- */
.nav-badge {
    background: #E17055;
    color: #fff;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    margin-left: auto;
}

/* ===================== AVISOS ===================== */
.avisos-list { display: flex; flex-direction: column; gap: 14px; padding: 20px 28px; }

.aviso-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.aviso-info    { border-left-color: #0984E3; }
.aviso-alerta  { border-left-color: #FDCB6E; }
.aviso-urgente { border-left-color: #E17055; }

.aviso-header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.aviso-tipo-badge { font-size: 0.75rem; font-weight: 600; padding: 2px 8px; background: var(--bg-secondary); border-radius: 10px; }
.aviso-titulo { font-size: 1rem; font-weight: 600; margin: 0; flex: 1; }
.aviso-meta { font-size: 0.78rem; color: var(--text-muted); margin-left: auto; white-space: nowrap; }
.aviso-corpo { font-size: 0.9rem; line-height: 1.6; color: var(--text-secondary); margin: 0; white-space: pre-wrap; }
.aviso-footer { display: flex; gap: 8px; }

/* ===================== ANGARIAÇÕES ===================== */
.angariações-pipeline {
    display: flex;
    gap: 14px;
    padding: 0 28px 28px;
    overflow-x: auto;
    min-height: 300px;
}

.angariao-col {
    min-width: 220px;
    max-width: 240px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.angariao-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.85rem;
    padding-bottom: 8px;
    border-bottom: 3px solid currentColor;
    margin-bottom: 4px;
}
.col-count {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.78rem;
}

.angariao-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.angariao-card:hover { box-shadow: var(--shadow-md); }
.angariao-card-top { display: flex; justify-content: space-between; align-items: center; }
.angariao-num { font-size: 0.72rem; color: var(--text-muted); }
.angariao-endereco { font-size: 0.88rem; font-weight: 500; }
.angariao-vals { font-size: 0.8rem; color: var(--text-muted); }
.angariao-resp { font-size: 0.78rem; color: var(--text-muted); }

/* Docs checklist */
.docs-checklist { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.doc-row { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.doc-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.doc-required { color: #E17055; font-weight: 700; }

/* Wide modal */
.modal-wide { max-width: 920px; }
.modal-sm   { max-width: 440px; }

/* ===================== FINANCEIRO ===================== */
.financeiro-extrato { padding: 0 28px 28px; overflow-x: auto; }

/* ---- Cashback Section ---- */
.financeiro-cashback { padding: 0 28px 20px; }
.cashback-section-title { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }
.cashback-summary { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cashback-card {
    flex: 1; min-width: 140px; padding: 14px 16px;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius); text-align: center;
}
.cashback-card-label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.cashback-card-value { font-size: 1.3rem; font-weight: 700; margin-top: 4px; }
.cb-positive .cashback-card-value { color: #00B894; }
.cb-zero .cashback-card-value { color: var(--text-muted); }
.cb-neutral .cashback-card-value { color: #0984E3; }
.cb-used .cashback-card-value { color: #E84393; }
.cb-expired .cashback-card-value { color: #B2BEC3; }
.cashback-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cashback-row {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 16px; border-bottom: 1px solid var(--border);
    font-size: .85rem;
}
.cashback-row:last-child { border-bottom: none; }
.cashback-row:nth-child(even) { background: var(--bg-hover, rgba(0,0,0,0.02)); }
.cashback-row-expired { opacity: 0.5; }
.cb-date { min-width: 80px; color: var(--text-muted); }
.cb-desc { flex: 1; }
.cb-valor { min-width: 100px; text-align: right; font-weight: 600; }
.cb-valor-received { color: #00B894; }
.cb-valor-used { color: #E84393; }
.cb-status { min-width: 130px; text-align: center; padding: 2px 8px; border-radius: 10px; font-size: .78rem; font-weight: 600; }
.cb-tag-active { background: #dcfce7; color: #15803d; }
.cb-tag-used { background: #fce4ec; color: #c2185b; }
.cb-tag-expired { background: #f0f0f0; color: #999; }
html[data-theme="dark"] .cb-tag-active { background: #166534; color: #bbf7d0; }
html[data-theme="dark"] .cb-tag-used { background: #880e4f; color: #f8bbd0; }
html[data-theme="dark"] .cb-tag-expired { background: #333; color: #777; }

.extrato-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.extrato-table th, .extrato-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.extrato-table thead th { background: var(--bg-secondary); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; }
.tx-credit td:nth-child(4) { color: #00B894; font-weight: 600; }
.tx-debit  td:nth-child(4) { color: #E17055; font-weight: 600; }
.pix-pago { color: #00B894; font-size: 0.78rem; }

/* PIX modal */
.pix-body { display: flex; flex-direction: column; gap: 14px; }
.pix-label { margin: 0; font-size: 0.9rem; }
.pix-code {
    font-family: monospace;
    font-size: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    resize: none;
    width: 100%;
    box-sizing: border-box;
    word-break: break-all;
}

/* ===================== PLANEJAMENTO ===================== */
.planejamento-funil {
    display: flex;
    gap: 14px;
    padding: 20px 28px;
    flex-wrap: wrap;
}

.funil-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    min-width: 160px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.funil-card-header { display: flex; align-items: center; gap: 8px; }
.funil-label { font-weight: 600; font-size: 0.92rem; }
.funil-nums { font-size: 0.88rem; }
.funil-realizado { font-size: 1.6rem; font-weight: 800; }
.funil-meta { color: var(--text-muted); font-size: 0.8rem; }
.funil-bar-wrap { height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; }
.funil-bar { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.funil-pct { font-size: 0.8rem; color: var(--text-muted); }

/* ---- Planejamento — Imóveis & Comissão ---- */
.planejamento-section { padding: 0 28px 20px; }

.plan-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 14px;
    padding-top: 4px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-summary-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.plan-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    flex: 1;
    min-width: 140px;
}
.plan-stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 4px; }
.plan-stat-value { font-size: 1.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 2px; }
.plan-stat-sub   { font-size: 0.75rem; color: var(--text-muted); }

.plan-sub-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 8px;
}

.plan-breakdown { display: flex; flex-direction: column; gap: 6px; }

.plan-breakdown-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.88rem;
}
.plan-tipo-icon    { font-size: 1rem; width: 22px; text-align: center; }
.plan-tipo-label   { flex: 1; font-weight: 600; }
.plan-tipo-count   { color: var(--text-muted); min-width: 64px; text-align: right; }
.plan-tipo-valor   { min-width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.plan-tipo-comissao{ min-width: 130px; text-align: right; color: var(--success, #00b894); font-weight: 600; font-variant-numeric: tabular-nums; }

.planejamento-comparativo { padding: 0 28px 28px; }
.comp-title { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }
.comp-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.comp-table th, .comp-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: center; }
.comp-table th:first-child, .comp-table td:first-child { text-align: left; }
.comp-table thead th { background: var(--bg-secondary); font-weight: 600; }
.comp-atingido { color: var(--success); font-weight: 600; }

/* ---- Settings Modal: Team List ---- */
.settings-team-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.settings-team-item:last-child { border-bottom: none; }
.stm-info { flex: 1; min-width: 0; }
.stm-name  { font-weight: 600; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stm-email { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-select {
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.82rem;
    cursor: pointer;
}
.stm-fin-row {
    display: flex;
    gap: 8px;
    width: 100%;
    padding-top: 4px;
    padding-left: 44px; /* align under name, past avatar */
}
.fee-select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    width: 90px;
}
.pix-input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.8rem;
}
.pix-input::placeholder { color: var(--text-muted); }

/* ---- 3-column form row variant ---- */
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.comp-atingido { color: #00B894; font-weight: 700; }

/* ===== Toggle Switch (Templates Locked) ===== */
.toggle-switch-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 500;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 22px;
    transition: var(--transition);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}
.tpl-inline-required {
    display: flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    font-size: .85rem;
    color: var(--text-muted);
    user-select: none;
    flex-shrink: 0;
    padding: 0 4px;
}
.tpl-inline-required input {
    accent-color: var(--danger, #e74c3c);
    width: 14px;
    height: 14px;
}
.tpl-inline-required span {
    color: var(--danger, #e74c3c);
    font-weight: 700;
    font-size: 1rem;
}
.required-badge {
    font-size: .65rem;
    font-weight: 700;
    color: var(--danger, #e74c3c);
    background: #fef2f2;
    padding: 1px 6px;
    border-radius: 50px;
    flex-shrink: 0;
}
.field-required-mark {
    color: var(--danger, #e74c3c);
    font-weight: 700;
    margin-left: 2px;
}
.task-field-locked input[readonly],
.task-field-locked textarea[readonly],
.task-field-locked select[disabled] {
    background: var(--bg-column);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}
.field-validation-error input,
.field-validation-error textarea,
.field-validation-error select {
    border-color: var(--danger, #e74c3c) !important;
}
.subtask-item .subtask-required-dot {
    color: var(--danger, #e74c3c);
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
}

/* ===== Attachments ===== */
.attachments-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-surface);
}
.attachments-dropzone:hover,
.attachments-dropzone.drag-over {
    border-color: var(--accent);
    background: var(--accent-bg);
}
.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.dropzone-icon {
    font-size: 1.5rem;
}
.dropzone-text {
    font-size: .85rem;
    color: var(--text-secondary);
}
.dropzone-hint {
    font-size: .75rem;
    color: var(--text-muted);
}
.attachments-progress {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    transition: width 0.2s;
}
#attachments-progress-text {
    font-size: .75rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}
.attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-column);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    font-size: .85rem;
}
.attachment-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}
.attachment-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-bg);
    border-radius: 4px;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.attachment-info {
    flex: 1;
    overflow: hidden;
}
.attachment-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.attachment-size {
    font-size: .75rem;
    color: var(--text-muted);
}
.attachment-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.attachment-actions a,
.attachment-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: .85rem;
    color: var(--text-muted);
    border-radius: 4px;
    transition: var(--transition);
    text-decoration: none;
}
.attachment-actions a:hover,
.attachment-actions button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.attachment-actions .btn-delete:hover {
    color: var(--danger, #e74c3c);
}
.cf-video-upload {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cf-video-status {
    font-size: .8rem;
    color: var(--text-muted);
}

/* ---------- Financial / Exemption Fields ---------- */
.exemption-input {
    padding: 5px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .82rem;
    outline: none;
    max-width: 140px;
}
.exemption-input:focus { border-color: var(--accent); }
.fee-day-input {
    padding: 5px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .82rem;
    outline: none;
    width: 80px;
}
.tx-expired { opacity: 0.5; }
.fee-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: .7rem;
    font-weight: 600;
}
.fee-status-badge.pending { background: #fef3c7; color: #b45309; }
.fee-status-badge.paid { background: #dcfce7; color: #15803d; }
.fee-pay-checkbox { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* ===== Boost / Impulsionamento ===== */
.boost-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.boost-calc {
    padding: 10px 14px;
    background: var(--accent-bg);
    border-radius: var(--radius-sm);
    font-size: .85rem;
    color: var(--accent);
    font-weight: 500;
}
.boost-admin-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.boost-status-display {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 500;
}
.boost-status-display.pendente { background: #fef3c7; color: #b45309; }
.boost-status-display.aprovado { background: #dcfce7; color: #15803d; }
.boost-status-display.previsao { background: #dbeafe; color: #1d4ed8; }
.boost-status-display.rejeitado { background: #fef2f2; color: #dc2626; }
.boost-status-display.confirmado { background: #dcfce7; color: #15803d; }
.card-boost-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
}
.card-boost-badge.pendente { background: #fef3c7; color: #b45309; }
.card-boost-badge.aprovado { background: #dcfce7; color: #15803d; }
.card-boost-badge.previsao { background: #dbeafe; color: #1d4ed8; }
.card-boost-badge.rejeitado { background: #fef2f2; color: #dc2626; }

/* ===== Diligence + Release ===== */
.diligence-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.diligence-status-badge.pendente { background: #f3f4f6; color: #6b7280; }
.diligence-status-badge.em_diligencia { background: #fef3c7; color: #b45309; }
.diligence-status-badge.devolutiva { background: #fef2f2; color: #dc2626; }
.diligence-status-badge.aprovado { background: #dcfce7; color: #15803d; }
.diligence-status-badge.liberacao { background: #dbeafe; color: #1d4ed8; }
.diligence-status-badge.publicado { background: #065f46; color: #fff; }
.diligence-checklist, .release-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.diligence-checklist-item, .release-checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-column);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    font-size: .85rem;
}
.diligence-checklist-item input[type="checkbox"],
.release-checklist-item input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}
.diligence-checklist-item.missing {
    border-color: var(--danger, #e74c3c);
    background: #fef2f2;
}
.devolutiva-header {
    font-weight: 600;
    color: var(--danger, #e74c3c);
    margin-bottom: 4px;
}
.diligence-devolutiva {
    padding: 10px 14px;
    background: #fef2f2;
    border-radius: var(--radius-sm);
    margin-top: 8px;
    font-size: .85rem;
}
.diligence-admin-actions, .release-admin-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.card-diligence-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
}
.card-diligence-badge.pendente { background: #f3f4f6; color: #6b7280; }
.card-diligence-badge.em_diligencia { background: #fef3c7; color: #b45309; }
.card-diligence-badge.devolutiva { background: #fef2f2; color: #dc2626; }
.card-diligence-badge.aprovado { background: #dcfce7; color: #15803d; }
.card-diligence-badge.liberacao { background: #dbeafe; color: #1d4ed8; }
.card-diligence-badge.publicado { background: #065f46; color: #fff; }
.notification-badge {
    background: var(--danger, #e74c3c);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    font-weight: 700;
}

/* ===== Avisos Banner + Popup ===== */
.home-banners {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.home-banner-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--accent-bg);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: .9rem;
}
.home-banner-item .banner-text { flex: 1; }
.home-banner-item .banner-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    padding: 4px;
}
.home-banner-item .banner-close:hover { color: var(--text-primary); }
.card-boost-badge.confirmado { background: #dcfce7; color: #15803d; }
/* ===== Dashboard ===== */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.dashboard-period-filter {
    display: flex;
    gap: 4px;
}
.dashboard-period-filter button {
    padding: 5px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    cursor: pointer;
    font-size: .85rem;
    transition: var(--transition);
}
.dashboard-period-filter button.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* KPI Cards Grid */
.dashboard-kpis-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.kpi-card {
    padding: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}
.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}
.kpi-label {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Charts */
.dashboard-charts-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}
.dashboard-chart-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.dashboard-chart-full { flex: 1; }
.dashboard-chart-half { flex: 1; }
.chart-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* Esteira de Contratos */
.dashboard-esteira-section { margin-top: 24px; }
.dashboard-esteira-section > h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.esteira-mes {
    margin-bottom: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.esteira-mes-header {
    padding: 10px 16px;
    background: var(--bg-elevated, var(--bg-surface));
    font-weight: 600;
    font-size: .9rem;
    text-transform: capitalize;
    border-bottom: 1px solid var(--border);
}
.esteira-contrato {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
}
.esteira-contrato:last-child { border-bottom: none; }
.esteira-contrato:nth-child(even) {
    background: var(--bg-hover, rgba(0,0,0,0.02));
}
.esteira-codigo { font-weight: 600; min-width: 120px; color: var(--text-muted); }
.esteira-titulo { flex: 1; }
.esteira-responsavel { min-width: 120px; color: var(--text-muted); }
.esteira-valor { min-width: 100px; text-align: right; font-weight: 600; }
.esteira-badge {
    min-width: 130px;
    text-align: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: .8rem;
    font-weight: 600;
}
.esteira-status-verde { background: #dcfce7; color: #15803d; }
.esteira-status-amarelo { background: #fef9c3; color: #a16207; }
.esteira-status-vermelho { background: #fecaca; color: #b91c1c; }

/* Responsive */
@media (max-width: 768px) {
    .dashboard-kpis-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-charts-row { flex-direction: column; }
    .esteira-contrato { flex-wrap: wrap; }
    .esteira-responsavel { display: none; }
}
@media (max-width: 480px) {
    .dashboard-kpis-grid { grid-template-columns: 1fr; }
}

/* Notification settings table */
.notif-settings-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.notif-settings-table th { text-align: left; padding: 8px; border-bottom: 2px solid var(--border); font-size: .75rem; text-transform: uppercase; color: var(--text-muted); }
.notif-settings-table td { padding: 8px; border-bottom: 1px solid var(--border-light); }
.notif-settings-table input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

/* ===================================================
   SIDEBAR — company logo
   =================================================== */
.sidebar-header { gap: 12px; }
.sidebar-logo-img {
    max-width: 220px;
    max-height: 64px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.sidebar-logo-img.hidden { display: none; }
.sidebar-title.hidden { display: none; }
.sidebar-header .logo-icon.hidden { display: none; }
.sidebar-header .logo-icon { color: var(--brand-primary); }
html[data-theme="dark"] .sidebar-header .logo-icon { color: var(--brand-light); }

/* ===================================================
   EMPRESA — logo upload
   =================================================== */
.empresa-logo-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: center;
}
.empresa-logo-preview {
    width: 220px;
    height: 140px;
    background: var(--bg-page);
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow: hidden;
}
.empresa-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.empresa-logo-placeholder {
    color: var(--text-muted);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    font-weight: 700;
}
.empresa-logo-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}
.empresa-logo-actions label.btn-outline {
    display: inline-flex;
    cursor: pointer;
}
.empresa-logo-hint {
    color: var(--text-muted);
    font-size: .78rem;
    margin: 0;
}

/* ===================================================
   SIDEBAR FOOTER — theme toggle
   =================================================== */
.sidebar-footer {
    margin-top: auto;
    padding: 12px 14px 18px;
    border-top: 1px solid var(--border-light);
}
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    transition: var(--transition);
}
.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    flex-shrink: 0;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ===================================================
   DARK THEME — component overrides
   =================================================== */
html[data-theme="dark"] body {
    background: var(--bg-page);
    color: var(--text-primary);
}
html[data-theme="dark"] .board-title,
html[data-theme="dark"] .view-title,
html[data-theme="dark"] .sidebar-title {
    color: var(--text-brand);
}
html[data-theme="dark"] .task-card,
html[data-theme="dark"] .angariao-card,
html[data-theme="dark"] .empresa-section,
html[data-theme="dark"] .ang-month-section,
html[data-theme="dark"] .ang-corretor-card:not(.ang-corretor-agency),
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .dashboard-chart-card,
html[data-theme="dark"] .esteira-mes,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .login-container {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-primary);
}
html[data-theme="dark"] .esteira-status-verde { background: #166534; color: #bbf7d0; }
html[data-theme="dark"] .esteira-status-amarelo { background: #854d0e; color: #fef08a; }
html[data-theme="dark"] .esteira-status-vermelho { background: #991b1b; color: #fecaca; }
html[data-theme="dark"] .kanban-column,
html[data-theme="dark"] .angariao-col {
    background: var(--bg-column);
    border-color: var(--border);
}
html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .empresa-section input,
html[data-theme="dark"] .empresa-section select,
html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .search-bar input {
    background: var(--bg-page);
    border-color: var(--border);
    color: var(--text-primary);
}
html[data-theme="dark"] .search-bar {
    background: var(--bg-page);
    border-color: var(--border);
}
html[data-theme="dark"] .top-header {
    background: var(--bg-sidebar);
    border-bottom-color: var(--border);
}
html[data-theme="dark"] .btn-outline {
    background: transparent;
    color: var(--text-primary);
}
html[data-theme="dark"] .view-tab {
    color: var(--text-secondary);
}
html[data-theme="dark"] .view-tab.active {
    background: var(--bg-sidebar);
    color: var(--text-brand);
}
html[data-theme="dark"] .view-tabs {
    background: var(--bg-page);
}
html[data-theme="dark"] .tag-backend,
html[data-theme="dark"] .tag-design,
html[data-theme="dark"] .tag-bug,
html[data-theme="dark"] .tag-ui-ux,
html[data-theme="dark"] .tag-marketing {
    opacity: .85;
}

/* ===================================================
   COMBOBOX — searchable dropdown
   =================================================== */
.combobox {
    position: relative;
}
.combobox select.combo-native {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.combobox .combo-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: var(--transition);
    font: inherit;
}
.combobox .combo-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(0, 41, 117, .12);
}
.combobox .combo-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    padding: 4px;
}
.combobox .combo-menu.hidden { display: none; }
.combobox .combo-option {
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: .9rem;
    color: var(--text-primary);
}
.combobox .combo-option:hover,
.combobox .combo-option.selected {
    background: var(--accent-bg);
    color: var(--brand-primary);
    font-weight: 600;
}
.combobox .combo-empty {
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem;
}
html[data-theme="dark"] .combobox .combo-option:hover,
html[data-theme="dark"] .combobox .combo-option.selected {
    background: rgba(180, 197, 255, .12);
    color: var(--brand-light);
}

/* ===================================================
   ANGARIAÇÕES — drag and drop
   =================================================== */
.angariao-card[draggable="true"] {
    cursor: grab;
}
.angariao-card.dragging {
    opacity: .4;
    cursor: grabbing;
    transform: scale(.98);
}
.angariao-col.drop-target {
    background: var(--bg-active);
    outline: 2px dashed var(--brand-mid);
    outline-offset: -4px;
    border-radius: var(--radius-md);
}
html[data-theme="dark"] .angariao-col.drop-target {
    background: rgba(180, 197, 255, .08);
}

/* ===================================================
   ANGARIAÇÕES — grouped views (Por Mês / Por Corretor)
   =================================================== */
.view-tabs {
    display: inline-flex;
    background: var(--bg-column);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 2px;
}
.view-tab {
    border: none;
    background: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.view-tab:hover { color: var(--text-primary); }
.view-tab.active {
    background: var(--bg-surface);
    color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

.angariacoes-group {
    padding: 0 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.angariacoes-group.hidden { display: none; }

.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
}

/* Por Mês */
.ang-month-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.ang-month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
    background: var(--bg-column);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.ang-month-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--brand-primary);
    text-transform: capitalize;
    letter-spacing: var(--tracking-tight);
    margin: 0;
}
.ang-month-stats {
    display: flex;
    gap: 22px;
    align-items: center;
    flex-wrap: wrap;
}
.ang-month-stats > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
.ang-month-stats span {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    font-weight: 600;
}
.ang-month-stats strong {
    font-size: .95rem;
    color: var(--text-primary);
    font-weight: 700;
}
.ang-month-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    padding: 18px 24px;
}

/* Por Corretor */
.ang-corretor-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 20px 24px;
}
.ang-corretor-card.ang-corretor-agency {
    background: var(--brand-gradient);
    border: none;
    box-shadow: var(--shadow-cta);
}
.ang-corretor-agency h3,
.ang-corretor-agency p,
.ang-corretor-agency span,
.ang-corretor-agency strong { color: #fff; }
.ang-corretor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.ang-corretor-info {
    display: flex;
    align-items: center;
    gap: 14px;
}
.ang-corretor-info h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 2px;
}
.ang-corretor-info p {
    font-size: .8rem;
    color: var(--text-muted);
    margin: 0;
}
.ang-corretor-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: .9rem;
    flex-shrink: 0;
}
.ang-corretor-stats {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}
.ang-corretor-stats > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 80px;
}
.ang-corretor-stats span {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    font-weight: 600;
}
.ang-corretor-stats strong {
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 800;
}

/* ===================================================
   EMPRESA (Admin company profile)
   =================================================== */
.empresa-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1100px;
}

.empresa-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 28px 20px;
    box-shadow: var(--shadow-card);
}

.empresa-section legend {
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--brand-primary);
    padding: 0 10px;
}

.empresa-section .form-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 4px;
}

.empresa-section .form-row + .form-row {
    margin-top: 6px;
}

.empresa-section .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.empresa-section .form-group.empresa-col-2 {
    grid-column: span 2;
}

.empresa-section .form-group label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.empresa-section input,
.empresa-section select {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: .95rem;
    transition: var(--transition);
}

.empresa-section input:focus,
.empresa-section select:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(0, 41, 117, .12);
}

@media (max-width: 960px) {
    .empresa-section .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .empresa-section .form-group.empresa-col-2 {
        grid-column: span 2;
    }
}

/* ===== Imovel Leads (Fase 7) ===== */
.imovel-lead-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
}
.imovel-lead-row:last-child { border-bottom: none; }
.lead-nome { flex: 1; font-weight: 500; }
.lead-status-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .75rem;
    font-weight: 600;
}
.lead-score { min-width: 60px; color: var(--text-muted); font-size: .8rem; }
.btn-sm { padding: 3px 10px; font-size: .78rem; }

/* Chat Viewer */
.chat-messages-container {
    max-height: 60vh;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: .85rem;
    line-height: 1.4;
}
.chat-user {
    align-self: flex-start;
    background: var(--bg-column, #f0f0f0);
    border-bottom-left-radius: 4px;
}
.chat-assistant {
    align-self: flex-end;
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}
.chat-content { word-wrap: break-word; }
.chat-time { font-size: .7rem; opacity: 0.6; margin-top: 4px; text-align: right; }
html[data-theme="dark"] .chat-user { background: var(--bg-elevated, #333); }
