/* ================================================================
   STAMP PANEL — Painel de Estampas
   ================================================================
   Styles for the stamp (connection) panel, stamp items, filters,
   classification badges, governance status, and the add-stamp modal.

   Owner: .stamp-*, .governance-badge
   Must NOT define: .btn-* base, .modal-* base, .form-* base
   ================================================================ */

/* ----------------------------------------------------------------
   PANEL HEADER
   ---------------------------------------------------------------- */

.stamp-panel-header {
    padding: 12px;
    border-bottom: 1px solid var(--neutral-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stamp-element-name {
    font-weight: 600;
    font-size: 13px;
}

.stamp-element-family {
    font-size: 11px;
    color: var(--neutral-500);
    background: var(--neutral-100);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ----------------------------------------------------------------
   EMPTY STATE
   ---------------------------------------------------------------- */

.stamp-panel-empty-msg {
    color: var(--neutral-500);
    font-size: 11px;
    padding: 12px;
}

/* ----------------------------------------------------------------
   GOVERNANCE STATUS
   ---------------------------------------------------------------- */

.stamp-governance-status {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
}

.governance-badge {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--neutral-200);
    color: var(--neutral-600);
}

.governance-badge.active {
    background: var(--success-bg);
    color: var(--success);
}

/* ----------------------------------------------------------------
   CLASSIFICATION SUMMARY & BADGES
   ---------------------------------------------------------------- */

.stamp-classification-summary {
    display: flex;
    gap: 8px;
    padding: 6px 12px;
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
}

.stamp-class-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stamp-class-badge.passive {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.stamp-class-badge.active {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* ----------------------------------------------------------------
   CATEGORY FILTERS
   ---------------------------------------------------------------- */

.stamp-category-filters {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--neutral-200);
    overflow-x: auto;
}

.stamp-filter-btn {
    font-size: 10px;
    padding: 4px 8px;
    border: 1px solid var(--neutral-200);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    white-space: nowrap;
}

.stamp-filter-btn:hover {
    background: var(--neutral-100);
}

.stamp-filter-btn.active {
    background: var(--cat-color, var(--primary));
    color: white;
    border-color: transparent;
}

.stamp-filter-divider {
    width: 1px;
    background: var(--neutral-300);
    margin: 2px 4px;
}

.stamp-filter-passive.active {
    background: #dc2626 !important;
    color: white;
    border-color: transparent;
}

.stamp-filter-active.active {
    background: #16a34a !important;
    color: white;
    border-color: transparent;
}

/* ----------------------------------------------------------------
   CATEGORY SECTIONS
   ---------------------------------------------------------------- */

.stamp-category-section {
    margin: 8px;
}

.stamp-category-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--cat-color, var(--neutral-600));
    padding: 4px 0;
    border-bottom: 2px solid var(--cat-color, var(--neutral-300));
    margin-bottom: 8px;
}

/* ----------------------------------------------------------------
   STAMP LIST & ITEMS
   ---------------------------------------------------------------- */

.stamp-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stamp-item {
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: 6px;
    padding: 8px;
}

.stamp-item:hover {
    border-color: var(--primary);
}

.stamp-item-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.stamp-icon {
    font-size: 14px;
}

.stamp-name {
    font-weight: 500;
    font-size: 11px;
    flex: 1;
}

.stamp-remove-btn {
    width: 18px;
    height: 18px;
    border: none;
    background: var(--neutral-100);
    color: var(--neutral-500);
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.stamp-item-value {
    font-size: 10px;
    color: var(--neutral-700);
    line-height: 1.4;
}

.stamp-item-meta {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    font-size: 9px;
    color: var(--neutral-500);
}

.stamp-signed {
    color: var(--success);
}

/* ----------------------------------------------------------------
   EMPTY STATE (stamp list)
   ---------------------------------------------------------------- */

.stamp-empty {
    padding: 24px;
    text-align: center;
    color: var(--neutral-500);
    font-size: 11px;
}

/* ----------------------------------------------------------------
   QUICK ACTIONS (Passivo / Ativo buttons)
   ---------------------------------------------------------------- */

.stamp-quick-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--neutral-200);
}

.stamp-quick-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 2px solid;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.stamp-quick-btn.passive {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.stamp-quick-btn.passive:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.stamp-quick-btn.active {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #16a34a;
}

.stamp-quick-btn.active:hover {
    background: #16a34a;
    color: white;
    border-color: #16a34a;
}

/* ----------------------------------------------------------------
   ACTIONS (bottom bar)
   ---------------------------------------------------------------- */

.stamp-actions {
    padding: 12px;
    border-top: 1px solid var(--neutral-200);
}

/* ----------------------------------------------------------------
   ADD-STAMP MODAL
   ---------------------------------------------------------------- */

.stamp-modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--neutral-200);
}

.stamp-modal-header h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.stamp-modal-header p {
    margin: 0;
    font-size: 12px;
    color: var(--neutral-600);
}

.stamp-back-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    margin-bottom: 8px;
}

.stamp-category-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--cat-color, var(--neutral-200));
    color: white;
    margin-top: 8px;
}

/* ----------------------------------------------------------------
   TYPE GRID (stamp type selector in modal)
   ---------------------------------------------------------------- */

.stamp-type-grid {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.stamp-type-category-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--cat-color);
    margin-bottom: 8px;
}

.stamp-type-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.stamp-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 1px solid var(--neutral-200);
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

.stamp-type-btn:hover {
    border-color: var(--primary);
    background: var(--neutral-50);
}

.stamp-type-icon {
    font-size: 20px;
}

.stamp-type-name {
    font-size: 10px;
    text-align: center;
}

/* ----------------------------------------------------------------
   STAMP FORM (fields inside modal)
   ---------------------------------------------------------------- */

.stamp-form {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.stamp-form .form-group {
    margin-bottom: 12px;
}

.stamp-form .form-label {
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
}

.stamp-form .required {
    color: var(--danger);
}

.stamp-form .form-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--neutral-200);
    border-radius: 4px;
    font-size: 12px;
}

/* ----------------------------------------------------------------
   MODAL ACTIONS (Cancel / Save buttons)
   ---------------------------------------------------------------- */

.stamp-modal-actions {
    padding: 12px 16px;
    border-top: 1px solid var(--neutral-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ----------------------------------------------------------------
   CLASSIFICATION TOGGLE (radio buttons in form)
   ---------------------------------------------------------------- */

.stamp-classification-toggle {
    display: flex;
    gap: 0;
    border: 2px solid var(--neutral-200);
    border-radius: 6px;
    overflow: hidden;
}

.stamp-class-option {
    display: flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
    font-size: 12px;
    flex: 1;
}

.stamp-class-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.stamp-class-label {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    transition: all 0.15s;
}

.stamp-class-label.passive {
    color: #dc2626;
    background: white;
}

.stamp-class-label.active {
    color: #16a34a;
    background: white;
}

.stamp-class-option input[type="radio"]:checked + .stamp-class-label.passive {
    background: #dc2626;
    color: white;
}

.stamp-class-option input[type="radio"]:checked + .stamp-class-label.active {
    background: #16a34a;
    color: white;
}

/* ----------------------------------------------------------------
   CLASSIFICATION SELECTOR (in type-picker screen)
   ---------------------------------------------------------------- */

.stamp-class-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
}

.stamp-class-selector-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--neutral-600);
}

.stamp-class-select-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 4px;
    border: 2px solid var(--neutral-200);
    background: white;
    cursor: pointer;
    transition: all 0.15s;
}

.stamp-class-select-btn.passive {
    color: #dc2626;
}

.stamp-class-select-btn.active {
    color: #16a34a;
}

.stamp-class-select-btn.passive.selected {
    background: #fef2f2;
    border-color: #dc2626;
}

.stamp-class-select-btn.active.selected {
    background: #f0fdf4;
    border-color: #16a34a;
}
