/* ── Cards & Grids ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: 10px; padding: 18px; border: 1px solid var(--border); }
.stat-card .value { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-card.accent .value { color: var(--accent); }
.stat-card.success .value { color: var(--success); }
.stat-card.danger .value { color: var(--danger); }
.stat-card.warning .value { color: var(--warning); }

.card { background: white; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 20px; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 14px; font-weight: 700; color: var(--primary); }
.card-body { padding: 20px; }

/* ── Table ── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: var(--bg); padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* ── Badges ── */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-active    { background: #dcfce7; color: #16a34a; }
.badge-review    { background: #fef9c3; color: #a16207; }
.badge-pending   { background: #fde8d8; color: #c2410c; }
.badge-destroyed { background: #f1f5f9; color: #64748b; }
.badge-hold      { background: #fce7f3; color: #9d174d; }
.badge-pub       { background: #e0f2fe; color: #0369a1; }
.badge-res       { background: #fef3c7; color: #92400e; }
.badge-conf      { background: #fde8d8; color: #9a3412; }
.badge-sec       { background: #fee2e2; color: #991b1b; }
.badge-admin     { background: #ede9fe; color: #6d28d9; }
.badge-approved  { background: #dcfce7; color: #166534; }
.badge-rejected  { background: #fee2e2; color: #991b1b; }
.badge-executed  { background: #f1f5f9; color: #475569; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; text-decoration: none; }
.btn-primary   { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-danger    { background: var(--danger); color: white; }
.btn-danger:hover  { background: #b91c1c; }
.btn-success   { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }
.btn-warning   { background: var(--warning); color: white; }
.btn-sm        { padding: 4px 10px; font-size: 12px; }
.btn-outline   { background: white; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* ── Forms ── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-row.single { grid-template-columns: 1fr; }
.form-row.triple { grid-template-columns: 1fr 1fr 1fr; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: 7px; font-size: 13px; outline: none; transition: border-color .2s; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary-light); }
.field textarea { resize: vertical; min-height: 70px; }

/* ── Filters ── */
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input, .filters select { padding: 7px 12px; border: 1.5px solid var(--border); border-radius: 7px; font-size: 13px; outline: none; }
.filters input:focus, .filters select:focus { border-color: var(--primary-light); }

/* ── Modal ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: 12px; width: 560px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(0,0,0,.3); }
.modal-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--primary); }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 24px; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── Folder Tree ── */
.folder-tree { font-size: 13px; }
.tree-item { padding: 6px 10px; display: flex; align-items: center; gap: 8px; cursor: pointer; border-radius: 6px; transition: background .15s; }
.tree-item:hover { background: var(--bg); }
.tree-item.selected { background: #dbeafe; color: var(--primary-light); }
.tree-children { padding-left: 20px; }
.tree-badge { margin-left: auto; background: var(--bg); color: var(--muted); font-size: 10px; padding: 1px 6px; border-radius: 10px; }

/* ── Activity Feed ── */
.activity-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-light); margin-top: 5px; flex-shrink: 0; }
.activity-text { font-size: 13px; color: var(--text); }
.activity-time { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Misc ── */
.empty-state { text-align: center; padding: 40px; color: var(--muted); }
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.section-title { font-size: 16px; font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; background: var(--bg); border: 1px solid var(--border); margin: 2px; }
.text-muted { color: var(--muted); font-size: 12px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.alert-danger  { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
