/* ============================================
   AS REPROS Manager - Componentes
   ============================================ */

/* BUTTONS */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border: none; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all var(--transition); text-decoration: none; white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px var(--primary-glow); color: white; }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: rgba(0,200,83,0.15); color: var(--success); border: 1px solid rgba(0,200,83,0.35); }
.btn-success:hover { background: rgba(0,200,83,0.25); color: var(--success); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: none; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-secondary);
    transition: all var(--transition); cursor: pointer;
}
.btn-icon:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-icon.danger:hover { background: rgba(255,23,68,0.1); color: var(--danger); }
.btn-icon.small { width: 28px; height: 28px; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 500; color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-label-block {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.form-group-solucoes { margin-top: 4px; }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 11px 14px;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); color: var(--text-primary);
    transition: all var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-select { cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; display: block; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-group.full-width { grid-column: 1 / -1; }
.form-section { padding: 24px; margin-bottom: 20px; }
.form-actions { padding: 20px 0; }
.input-wrapper { position: relative; }
.input-wrapper .toggle-password {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); padding: 4px;
}
.input-wrapper .toggle-password:hover { color: var(--text-primary); }
.input-wrapper input { padding-right: 44px; }

.color-input-wrapper { display: flex; gap: 10px; align-items: center; }
.color-input-wrapper input[type="color"] {
    width: 48px; height: 40px; border: none; border-radius: var(--radius-sm);
    cursor: pointer; background: none; padding: 0;
}

/* CHECKBOX CARDS */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.checkbox-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}
.checkbox-card:hover { border-color: var(--border-hover); background: var(--bg-tertiary); }
.checkbox-card:has(input:checked) {
    border-color: var(--primary);
    background: rgba(214, 0, 0, 0.1);
    box-shadow: inset 0 0 0 1px rgba(214, 0, 0, 0.15);
}
.checkbox-card:has(input:checked) span { color: var(--primary); }
.checkbox-card input {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}
.checkbox-card span {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

/* RADIO CARDS */
.radio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.radio-card {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 16px; border-radius: var(--radius-sm);
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    cursor: pointer; transition: all var(--transition); font-size: 14px; font-weight: 500;
}
.radio-card:hover { border-color: var(--border-hover); }
.radio-card:has(input:checked) {
    border-color: var(--primary); background: rgba(214,0,0,0.08);
    color: var(--primary);
}
.radio-card input { accent-color: var(--primary); }

/* QUICK PICKS */
.quick-picks {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.quick-pick {
    padding: 5px 12px; border-radius: 20px; font-size: 12px;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    color: var(--text-secondary); cursor: pointer;
    transition: all var(--transition);
}
.quick-pick:hover {
    border-color: var(--primary); color: var(--primary);
    background: rgba(214,0,0,0.08);
}

/* COMBOBOX (pesquisa) */
.combobox {
    position: relative;
}
.combobox.is-open {
    z-index: 2;
}
.repro-form .form-section {
    position: relative;
    overflow: visible;
    z-index: 1;
}
.repro-form .form-section.has-open-combobox {
    z-index: 1000;
}
.combobox-input {
    width: 100%;
}
.combobox-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 10;
    max-height: 220px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}
.combobox-dropdown.is-open {
    display: block;
}
.combobox-dropdown[hidden] {
    display: none !important;
}
.combobox-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition);
}
.combobox-option:hover,
.combobox-option.is-active {
    background: rgba(214, 0, 0, 0.12);
    color: var(--primary);
}
.combobox-empty {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .radio-grid { grid-template-columns: 1fr; }
    .form-grid.cols-2 { grid-template-columns: 1fr; }
}


/* ALERTS */
.alert {
    display: none;
}

/* STAT CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px; margin-bottom: 28px;
    min-width: 0;
}
.stats-grid.small { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.stat-card {
    padding: 20px; display: flex; align-items: flex-start; gap: 16px;
    position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0; transition: opacity var(--transition);
}
.stat-card:hover::before { opacity: 1; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card.highlight { border-color: rgba(214,0,0,0.2); }
.stat-card.wide { grid-column: span 2; }

.stat-icon {
    width: 48px; height: 48px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon.red { background: rgba(214,0,0,0.12); color: var(--primary); }
.stat-icon.green { background: rgba(0,200,83,0.12); color: var(--success); }
.stat-icon.orange { background: rgba(255,171,0,0.12); color: var(--warning); }
.stat-icon.blue { background: rgba(0,176,255,0.12); color: var(--info); }
.stat-icon.purple { background: rgba(156,39,176,0.12); color: #ce93d8; }
.stat-icon.cyan { background: rgba(0,188,212,0.12); color: #4dd0e1; }
.stat-icon.yellow { background: rgba(255,235,59,0.12); color: #fff176; }

.stat-info { flex: 1; min-width: 0; }
.stat-label { display: block; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.stat-label-normal { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.stat-value { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.5px; white-space: nowrap; }
.stat-value.small { font-size: 16px; }
.stat-value.stat-value-count { white-space: normal; }
.stat-detail { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* TABLES */
.table-wrapper { padding: 0; overflow: hidden; transition: opacity 0.2s ease; }
.table-wrapper.is-loading { opacity: 0.55; pointer-events: none; }
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
    padding: 14px 16px; text-align: left; font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted); background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color); white-space: nowrap;
}
.data-table th a { color: var(--text-muted); }
.data-table th a:hover { color: var(--primary); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-color); }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.table-actions { display: flex; gap: 4px; align-items: center; }
.inline-form { display: inline; }

.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; padding: 16px; border-top: 1px solid var(--border-color);
}
.pagination-info { font-size: 13px; color: var(--text-muted); }

/* FILTERS */
.filters-bar { padding: 16px 20px; margin-bottom: 20px; }
.filter-search {
    position: relative; margin-bottom: 12px;
}
.filter-search svg {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted);
}
.filter-search input {
    width: 100%; padding: 11px 14px 11px 42px;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); color: var(--text-primary);
}
.filter-search input:focus { outline: none; border-color: var(--primary); }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-row .form-input, .filter-row .form-select { flex: 1; min-width: 120px; }
.filter-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    min-width: 0;
}
.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.filter-field-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1;
}
.filter-date {
    display: block;
    width: 100%;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    padding: 0 12px;
    box-sizing: border-box;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    line-height: 44px;
    color-scheme: dark;
    -webkit-appearance: none;
    appearance: none;
}
.filter-date:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.filter-date::-webkit-date-and-time-value {
    text-align: left;
    line-height: 44px;
}
.filter-date::-webkit-datetime-edit {
    padding: 0;
    line-height: 44px;
}
.filter-date::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}
.filter-date::-webkit-calendar-picker-indicator {
    opacity: 0.65;
    cursor: pointer;
}
.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* CHARTS */
.charts-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 28px;
}
.chart-card { padding: 24px; }
.chart-card.full-width { grid-column: 1 / -1; }
.chart-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.chart-container { position: relative; height: 280px; }
.chart-container.tall { height: 360px; }
.dashboard-charts-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 28px;
    min-width: 0;
}
.dashboard-charts-row .chart-card { min-width: 0; }
.dashboard-charts-row .chart-container { height: 200px; min-width: 0; }

/* RANKINGS */
.rankings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ranking-card { padding: 24px; }
.ranking-list { display: flex; flex-direction: column; gap: 8px; }
.ranking-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}
.ranking-item:last-child { border-bottom: none; }
.rank-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: var(--text-muted); flex-shrink: 0;
}
.ranking-item:first-child .rank-num { background: var(--primary); color: white; }
.rank-info { flex: 1; min-width: 0; }
.rank-info small { display: block; color: var(--text-muted); font-size: 12px; }
.rank-value { font-weight: 600; color: var(--primary); white-space: nowrap; }
.rank-bar { flex: 1; height: 4px; background: var(--bg-tertiary); border-radius: 2px; overflow: hidden; }
.rank-bar-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width 0.8s ease; }

/* DETAIL */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 28px; }
.repro-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-card {
    padding: 22px 24px;
    background: var(--bg-secondary);
}
.detail-card--obs { margin-bottom: 28px; }
.detail-card--obs .obs-text { margin-top: 16px; }
.detail-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}
.detail-title svg { color: var(--primary); flex-shrink: 0; opacity: 0.9; }
.detail-rows { display: flex; flex-direction: column; padding-top: 4px; }
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 11px 0;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.detail-row span { color: var(--text-muted); flex-shrink: 0; }
.detail-row strong {
    text-align: right;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.35;
}
.detail-row--tags {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}
.detail-row--tags strong { text-align: left; }
.detail-row--tags .tags-list { justify-content: flex-start; }

.repro-view-header { display: flex; align-items: center; gap: 16px; }
.repro-view-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    background: rgba(214, 0, 0, 0.12);
    border: 1px solid rgba(214, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}
.repro-view-subtitle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.repro-view-client-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}
.repro-view-client-link:hover { color: var(--primary); }
.repro-view-sep { color: var(--text-muted); }
.repro-view-id { color: var(--text-muted); font-size: 13px; }

.repro-client-block {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
}
.repro-client-block:hover {
    border-color: var(--primary);
    background: rgba(214, 0, 0, 0.06);
}
.repro-client-block .client-avatar {
    width: 44px;
    height: 44px;
    font-size: 15px;
    flex-shrink: 0;
}
.repro-client-block-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.repro-client-block-info strong {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.repro-client-block-info small { font-size: 13px; color: var(--text-muted); }

.detail-card--finance {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.07) 0%, var(--bg-secondary) 55%);
    border-color: rgba(0, 200, 83, 0.18);
}
.detail-card--finance .detail-title svg { color: var(--success); }

.finance-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 16px; }
.finance-item {
    text-align: center;
    padding: 14px 10px;
    border-right: 1px solid var(--border-color);
}
.finance-item:last-child { border-right: none; }
.finance-item--lucro .finance-value { color: var(--success); }
.finance-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.finance-value { font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--text-primary); }

.tags-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(214, 0, 0, 0.12);
    border: 1px solid rgba(214, 0, 0, 0.2);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.tag.small { padding: 2px 8px; font-size: 11px; }

/* FILES */
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.file-category { padding: 16px; }
.file-category h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; }
.file-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 13px;
    transition: all var(--transition); margin-bottom: 4px;
}
.file-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.file-item small { margin-left: auto; color: var(--text-muted); }
.file-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 20px;
    background: var(--bg-tertiary); font-size: 12px; color: var(--text-secondary);
    margin: 2px; transition: all var(--transition);
}
.file-chip:hover { background: rgba(214,0,0,0.1); color: var(--primary); }

/* UPLOAD */
.upload-group { margin-bottom: 16px; }
.upload-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.file-drop-zone {
    border: 2px dashed var(--border-color); border-radius: var(--radius);
    padding: 24px; text-align: center; cursor: pointer;
    transition: all var(--transition); position: relative;
}
.file-drop-zone:hover, .file-drop-zone.dragover {
    border-color: var(--primary); background: rgba(214,0,0,0.04);
}
.file-drop-zone .file-input {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.drop-content p { color: var(--text-muted); font-size: 13px; margin-top: 8px; }
.drop-content svg { color: var(--text-muted); }
.existing-files { margin-bottom: 8px; }

.margin-preview {
    margin-top: 12px; padding: 12px; border-radius: var(--radius-sm);
    background: var(--bg-tertiary); font-size: 14px; color: var(--text-secondary);
}

/* CLIENTS */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.filters-bar-compact {
    max-width: 420px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.filters-bar-compact .filter-search { margin-bottom: 0; }
.client-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
}
.client-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: inherit; }
.client-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.client-name {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.client-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px; color: white; flex-shrink: 0;
}
.client-avatar.large { width: 64px; height: 64px; font-size: 22px; }
.client-info { flex: 1; min-width: 0; }
.client-info h3 { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.client-contact { font-size: 13px; color: var(--text-muted); }
.client-arrow { color: var(--text-muted); flex-shrink: 0; opacity: 0.6; }
.client-card:hover .client-arrow { opacity: 1; color: var(--primary); }
.client-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.client-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3px;
    min-width: 0;
}
.client-stat strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.client-stat small {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    line-height: 1.2;
}
.client-stat-lucro strong { color: var(--success); }
.client-stat-lucro small { color: var(--success); opacity: 0.85; }
.client-empty-stats {
    margin: 0;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}
.client-last {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: auto;
}
.client-contact-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.client-contact-sep { color: var(--text-muted); }
.client-header-info { display: flex; align-items: center; gap: 16px; }

.client-detail-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.client-detail-stats .stat-card-vertical { min-height: 108px; }

/* QUICK ACTIONS */
.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.action-card {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 24px 16px; text-align: center; text-decoration: none;
    color: var(--text-primary); transition: all var(--transition);
}
.action-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--text-primary); }
.action-card span { font-size: 13px; font-weight: 500; }

/* PERIOD TABS */
.period-tabs { display: flex; gap: 4px; margin-bottom: 20px; }
.period-tab {
    padding: 10px 24px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
    transition: all var(--transition); text-decoration: none;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
}
.period-tab:hover { color: var(--text-primary); border-color: var(--border-hover); }
.period-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

/* FINANCEIRO */
.finance-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 24px;
}
.finance-toolbar .period-tabs { margin-bottom: 0; }
.finance-filter { margin-bottom: 0; }
.finance-filter .form-input,
.finance-filter .form-select {
    width: auto;
    min-width: 160px;
    max-width: 220px;
    margin: 0;
}

.finance-stats {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.stat-card-vertical {
    flex-direction: column;
    align-items: stretch;
    padding: 20px 22px;
}
.stat-card-vertical .stat-info { width: 100%; }
.stat-card-vertical .stat-label { margin-bottom: 6px; }
.stat-card-vertical .stat-period {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    margin-left: 6px;
}
.stat-card-vertical .stat-detail {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.stat-card-vertical .stat-value {
    font-size: 26px;
    line-height: 1.2;
}
.stat-card-vertical.highlight .stat-value { color: var(--success); }

.table-wrapper .section-title {
    padding: 20px 20px 0;
    margin-bottom: 0;
}
.table-wrapper .data-table { margin-top: 12px; }

/* NOTES */
.notes-section { padding: 20px; }
.note-form { display: flex; gap: 8px; margin-bottom: 16px; align-items: flex-end; }
.note-form textarea { flex: 1; }
.note-item {
    padding: 14px 0; border-bottom: 1px solid var(--border-color);
}
.note-item p { font-size: 14px; margin-bottom: 6px; }
.note-meta { display: flex; align-items: center; justify-content: space-between; }
.note-meta small { color: var(--text-muted); font-size: 12px; }

/* SETTINGS */
.settings-form { max-width: 1100px; }
.settings-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 16px;
    align-items: stretch;
}
.settings-card {
    padding: 18px 20px;
    margin-bottom: 0;
}
.settings-card .section-title {
    margin-bottom: 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
}
.settings-fields { gap: 12px; }
.settings-fields .form-group { margin-bottom: 0; }
.settings-logo-row {
    display: flex;
    align-items: center;
    gap: 20px;
}
.settings-logo-upload { flex: 1; min-width: 0; margin-bottom: 0; }
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.logo-preview {
    margin: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    max-width: 180px;
    min-height: 72px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.logo-preview img {
    max-width: 100%;
    max-height: 64px;
    width: auto;
    object-fit: contain;
}
.settings-security { grid-column: 1 / -1; }
.settings-security-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.settings-security .section-title { margin-bottom: 4px; }
.settings-security-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}
.settings-actions {
    padding: 16px 0 0;
    margin-top: 16px;
}

/* EMPTY STATE */
.empty-state {
    text-align: center; padding: 48px 24px; color: var(--text-muted);
    grid-column: 1 / -1;
}
.empty-state svg { margin-bottom: 16px; opacity: 0.4; }
.empty-state p { margin-bottom: 16px; }

.obs-text { font-size: 14px; line-height: 1.7; color: var(--text-secondary); }

/* AGENDA */
.agenda-layout {
    display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start;
}
.agenda-calendar { padding: 24px; }
.calendar-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.calendar-title { font-size: 20px; font-weight: 700; text-align: center; flex: 1; }
.calendar-today { margin: 0 auto 16px; display: block; }
.calendar-weekdays {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px;
    margin-bottom: 8px; text-align: center;
    font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-day {
    min-height: 80px; min-width: 0; width: 100%; box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); background: var(--bg-tertiary);
    display: flex; flex-direction: column; align-items: stretch;
    gap: 4px; cursor: pointer; transition: all var(--transition); color: var(--text-primary);
    padding: 6px 4px; position: relative; text-align: left;
    -webkit-appearance: none; appearance: none; font-family: inherit;
}
.cal-day.empty { background: transparent; border-color: transparent; cursor: default; min-height: 0; }
.cal-day:hover:not(.empty) { border-color: var(--primary); background: rgba(214,0,0,0.06); }
.cal-day.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.cal-day.selected { background: rgba(214,0,0,0.12); border-color: var(--primary); }
.cal-num {
    font-size: 13px; font-weight: 700; text-align: center;
    line-height: 1; flex-shrink: 0;
}
.cal-previews {
    display: flex; flex-direction: column; gap: 2px;
    width: 100%; flex: 1; min-height: 0; overflow: hidden;
}
.cal-preview {
    display: block; font-size: 9px; line-height: 1.25;
    padding: 3px 4px; border-radius: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: rgba(214,0,0,0.22); color: var(--text-primary);
}
.cal-preview.marcacao { background: rgba(214,0,0,0.22); }
.cal-preview.trabalho { background: rgba(0,200,83,0.15); color: var(--success); }
.cal-preview-more { font-size: 9px; color: var(--text-muted); text-align: center; padding: 1px 0; }
.cal-dots { display: none; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; }
.cal-dot.marcacao { background: var(--primary); }
.cal-dot.trabalho { background: var(--success); }
.calendar-legend {
    display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 20px;
    font-size: 12px; color: var(--text-muted);
}
.calendar-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-marcacao { background: var(--primary); }
.dot-trabalho { background: var(--success); }

.agenda-sidebar { display: flex; flex-direction: column; gap: 16px; }
.agenda-day-panel, .agenda-upcoming { padding: 20px; }
.day-panel-content { display: flex; flex-direction: column; gap: 10px; }
.day-event {
    padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-color);
    background: var(--bg-secondary); text-decoration: none; color: inherit; display: block;
    position: relative; transition: all var(--transition);
}
.day-event.marcacao { border-left: 3px solid var(--primary); background: var(--bg-tertiary); }
.day-event-highlight {
    box-shadow: 0 0 0 2px rgba(214, 0, 0, 0.45);
    animation: notifPulse 1.2s ease 2;
}
@keyframes notifPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(214, 0, 0, 0.45); }
    50% { box-shadow: 0 0 0 4px rgba(214, 0, 0, 0.25); }
}
.day-event.trabalho {
    border-left: 3px solid var(--success);
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.06) 0%, var(--bg-secondary) 55%);
}
.day-event.trabalho:hover {
    border-color: rgba(0, 200, 83, 0.45);
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.1) 0%, var(--bg-secondary) 55%);
    transform: translateX(2px);
}
.day-event-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.day-event.marcacao .day-event-head { align-items: center; }
.day-event-titulo { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35; }
.day-event-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.day-event.marcacao .day-event-actions {
    position: static;
    display: flex;
    gap: 2px;
}
.day-event p { font-size: 13px; color: var(--text-secondary); margin: 0; line-height: 1.45; }
.day-event-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.trabalho-cliente { font-size: 15px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.trabalho-veiculo { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.event-time { font-size: 12px; color: var(--primary); font-weight: 600; flex-shrink: 0; white-space: nowrap; line-height: 1; }
.event-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; background: rgba(0,200,83,0.15); color: var(--success); }
.event-badge--success {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(0, 200, 83, 0.22);
    color: #b9f6ca;
    border: 1px solid rgba(0, 200, 83, 0.4);
    white-space: nowrap;
    line-height: 1.25;
}
.day-event-head--trabalho { margin-bottom: 0; }
.trabalho-valores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}
.trabalho-valor { display: flex; flex-direction: column; gap: 3px; }
.trabalho-valor-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    font-weight: 600;
}
.trabalho-valor-num { font-size: 15px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.trabalho-valor-num.text-success { color: var(--success); }
.day-event-footer { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.day-event-footer .btn-primary { flex-shrink: 0; }
.day-event-actions { display: flex; gap: 2px; flex-shrink: 0; }

.upcoming-list { display: flex; flex-direction: column; gap: 8px; }
.upcoming-item {
    text-align: left; padding: 12px; border-radius: var(--radius-sm);
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    cursor: pointer; transition: all var(--transition); color: inherit;
    display: flex; flex-direction: column; gap: 2px;
}
.upcoming-item:hover { border-color: var(--primary); }
.upcoming-date { font-size: 11px; color: var(--primary); font-weight: 600; }
.upcoming-item strong { font-size: 14px; }
.upcoming-item small { font-size: 12px; color: var(--text-muted); }

.modal-overlay {
    position: fixed; inset: 0; z-index: 5000;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card { width: 100%; max-width: 520px; padding: 24px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

@media (max-width: 1024px) {
    .agenda-layout { grid-template-columns: 1fr; }
    .cal-day { min-height: 68px; }
    .cal-preview { font-size: 8px; }
    .checkbox-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .repro-detail-grid { grid-template-columns: 1fr; }
    .finance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .finance-item { border-right: none; border-bottom: 1px solid var(--border-color); }
    .finance-item:nth-child(odd) { border-right: 1px solid var(--border-color); }
    .finance-item:nth-last-child(-n+2) { border-bottom: none; }
}

/* FILES LIST */
.files-list { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
