:root {
  --fes-red: #d0424b;
  --fes-red-light: rgba(208,66,75,0.08);
  --fes-red-mid: rgba(208,66,75,0.15);
  --fes-red-border: rgba(208,66,75,0.2);
  --fes-red-hover: #b8323b;
  --fes-gray: #5d5e61;
  --fes-gray-light: rgba(93,94,97,0.07);
  --fes-light: #eeeeee;
  --fes-success: #2d7a3a;
  --fes-success-bg: #e6f4ea;
  --fes-warning: #b35a00;
  --fes-warning-bg: #fff3e0;
  --fes-border: #e0e0e0;
  --fes-radius: 14px;
  --fes-radius-sm: 8px;
}

.fes-bento-grid { display: grid; gap: 12px; width: 100%; font-family: inherit; }
.fes-bento-grid--2col { grid-template-columns: 2fr 1fr; }
.fes-bento-grid--3col { grid-template-columns: repeat(3, 1fr); }
.fes-bento-grid--span2 { grid-row: span 2; }
.fes-bento-grid--full { grid-column: 1 / -1; }

.fes-bcard {
  background: #fff;
  border: 1px solid var(--fes-border);
  border-radius: var(--fes-radius);
  padding: 20px 22px;
  box-sizing: border-box;
}

.fes-bcard--accent-left {
  border-left: 3px solid var(--fes-red);
  border-radius: 0 var(--fes-radius) var(--fes-radius) 0;
}

.fes-bcard--red-bg {
  background: var(--fes-red-light);
  border-color: var(--fes-red-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.fes-status-box { width: 100%; z-index: 2; }
.fes-status-icon {
  width: 54px; height: 54px; margin: 0 auto 15px;
  background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.fes-status-icon svg { width: 28px; height: 28px; }
.fes-status-icon--active { color: var(--fes-success); border: 2px solid var(--fes-success-bg); }
.fes-status-icon--expired { color: var(--fes-red); border: 2px solid var(--fes-red-light); }
.fes-status-title { font-size: 13px; font-weight: 500; color: var(--fes-gray); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }

.fes-bcard--gray-bg {
  background: var(--fes-gray-light);
  border-color: #ddd;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fes-bcard__icon {
  width: 32px; height: 32px;
  border-radius: var(--fes-radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}

.fes-bcard__icon--red { background: var(--fes-red-mid); color: var(--fes-red); }

.fes-bcard__title {
  font-size: 14px; font-weight: 600;
  color: inherit; margin: 0 0 4px;
}

.fes-bcard__sub {
  font-size: 12px; color: var(--fes-gray); margin: 0 0 12px;
}

.fes-stat-number {
  font-size: 32px; font-weight: 700;
  color: var(--fes-red); margin: 12px 0;
  line-height: 1.2;
}

.fes-stat-number--gray { color: var(--fes-gray); }

.fes-stat-label {
  font-size: 11px; color: var(--fes-gray);
}

.fes-input {
  width: 100%; box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--fes-border);
  border-radius: var(--fes-radius-sm);
  font: inherit; font-size: 14px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.fes-input:focus { border-color: var(--fes-red); outline: none; }
.fes-input--sm { padding: 6px 10px; font-size: 13px; }

textarea.fes-input { resize: vertical; min-height: 90px; }
select.fes-input { cursor: pointer; appearance: none; }

.fes-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: var(--fes-radius-sm);
  font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
}

.fes-btn--primary {
  background: var(--fes-red); color: #fff; border-color: var(--fes-red);
  width: 100%; margin-top: 4px;
}
.fes-btn--primary:hover { background: var(--fes-red-hover); color: #fff; }

.fes-btn--outline {
  background: transparent; color: var(--fes-red); border-color: var(--fes-red);
  width: 100%;
}
.fes-btn--outline:hover { background: var(--fes-red-light); }

.fes-btn--ghost {
  background: transparent; color: var(--fes-gray); border-color: var(--fes-border);
}
.fes-btn--ghost:hover { background: var(--fes-gray-light); }

.fes-btn--sm { padding: 6px 12px; font-size: 13px; }
.fes-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.fes-dropzone {
  border: 1.5px dashed var(--fes-border);
  border-radius: var(--fes-radius-sm);
  padding: 16px; text-align: center;
  font-size: 13px; color: var(--fes-gray);
  cursor: pointer; margin-bottom: 8px;
  transition: border-color 0.15s, background 0.15s;
}
.fes-dropzone:hover { border-color: var(--fes-red); background: var(--fes-red-light); }

.fes-file-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px; border-radius: 6px;
  background: var(--fes-gray-light); margin-bottom: 4px;
  font-size: 12px;
}

.fes-file-item__remove { color: var(--fes-red); cursor: pointer; font-weight: 600; padding: 0 4px; }

.fes-badge {
  display: inline-block;
  padding: 4px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fes-badge--active, .fes-badge--open, .fes-status-repaired { background: var(--fes-success-bg); color: var(--fes-success); }
.fes-badge--expired, .fes-status-rejected { background: var(--fes-red-light); color: var(--fes-red); }
.fes-badge--pending, .fes-status-pending { background: var(--fes-warning-bg); color: var(--fes-warning); }
.fes-badge--resolved, .fes-badge--closed, .fes-status-closed { background: #e8e8e8; color: var(--fes-gray); }
.fes-status-reviewing { background: #e3f0fb; color: #1a5e9e; }
.fes-status-repair { background: #fff0e0; color: #b35a00; }

.fes-alert {
  padding: 12px 16px;
  border-left: 3px solid;
  border-radius: 0 var(--fes-radius-sm) var(--fes-radius-sm) 0;
  font-size: 13px; margin: 12px 0;
}
.fes-alert--success { background: var(--fes-success-bg); border-color: var(--fes-success); color: var(--fes-success); }
.fes-alert--error { background: var(--fes-red-light); border-color: var(--fes-red); color: var(--fes-red); }

.fes-ticket-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--fes-border);
  font-size: 13px;
}
.fes-ticket-row:last-child { border-bottom: none; }

.fes-ticket-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.fes-ticket-dot--red { background: var(--fes-red); }
.fes-ticket-dot--orange { background: #f59e0b; }
.fes-ticket-dot--gray { background: #bbb; }
.fes-ticket-dot--green { background: var(--fes-success); }

.fes-ticket-subject { flex: 1; font-weight: 500; color: inherit; }
.fes-ticket-date { font-size: 11px; color: var(--fes-gray); white-space: nowrap; }

.fes-messages-container {
  padding: 12px; max-height: 360px; overflow-y: auto;
  border: 1px solid var(--fes-border); border-radius: var(--fes-radius-sm);
  margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px;
}

.fes-message {
  max-width: 78%; padding: 10px 14px;
  border-radius: 12px; font-size: 13px; line-height: 1.5;
}
.fes-message-user {
  align-self: flex-start;
  background: var(--fes-red-light); border: 1px solid var(--fes-red-border);
  color: inherit;
}
.fes-message-reply {
  align-self: flex-end;
  background: var(--fes-gray-light); border: 1px solid #ddd;
  color: inherit;
}
.fes-message__time { font-size: 10px; color: var(--fes-gray); margin-top: 4px; display: block; }

.fes-meta-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; border-bottom: 1px solid var(--fes-border);
  font-size: 12px;
}
.fes-meta-row:last-child { border-bottom: none; }
.fes-meta-row__key { color: var(--fes-gray); }
.fes-meta-row__value { font-weight: 500; }

.fes-spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 3px solid var(--fes-light);
  border-top-color: var(--fes-red);
  animation: fes-spin 0.8s linear infinite;
  margin: 12px auto;
}
@keyframes fes-spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .fes-bento-grid--2col { grid-template-columns: 1fr; }
  .fes-bento-grid--2col .fes-bento-grid--span2 { grid-row: span 1; }
  .fes-bento-grid--3col { grid-template-columns: 1fr; }
  .fes-message { max-width: 92%; }
  .fes-ticket-date { display: none; }
}
