:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #223047;
  background: #eef3f7;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.panel {
  background: #fff; border: 1px solid #d9e2ea; border-radius: 14px;
  box-shadow: 0 8px 30px rgba(36, 59, 84, .08);
}
.login-panel { width: min(420px, 100%); padding: 2rem; display: grid; gap: 1rem; }
.eyebrow { margin: 0; color: #66809a; font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
h1,h2,h3,p { margin-top: 0; }
label { display: grid; gap: .4rem; font-weight: 700; font-size: .86rem; }
input, textarea, select {
  width: 100%; border: 1px solid #bcc9d6; border-radius: 8px; padding: .7rem .8rem; background: #fff;
}
.primary, .ghost, .nav, .status-card, .icon-button {
  border-radius: 8px; padding: .65rem .85rem; border: 1px solid #bcc9d6; background: #fff;
}
.primary { background: #294e7d; color: #fff; border-color: #294e7d; font-weight: 800; }
.ghost { color: #40536a; }
.error { color: #a61b1b; background: #fff0f0; padding: .7rem; border-radius: 8px; }

.console { min-height: 100vh; display: grid; grid-template-columns: 230px 1fr; }
aside {
  background: #16273a; color: #fff; padding: 1.2rem; display: flex; flex-direction: column; gap: 2rem;
}
aside h1 { margin: .2rem 0 0; }
aside .eyebrow { color: #92abc2; }
aside nav { display: grid; gap: .5rem; }
.nav { border: 0; text-align: left; background: transparent; color: #c8d5e2; font-weight: 750; }
.nav.active { background: #294e7d; color: #fff; }
aside > .ghost { margin-top: auto; background: transparent; color: #dce8f3; border-color: #52687e; }

.workspace { min-width: 0; padding: 1.2rem 1.4rem 2rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.topbar h2 { margin: .2rem 0 0; }

.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .8rem; margin-bottom: 1rem; }
.status-card { text-align: left; display: flex; justify-content: space-between; align-items: end; padding: 1rem; color: #26374a; }
.status-card strong { font-size: 1.7rem; }
.status-card.red { border-left: 6px solid #d93b3b; }
.status-card.yellow { border-left: 6px solid #e2b52c; }
.status-card.green { border-left: 6px solid #32a25d; }
.status-card.blue { border-left: 6px solid #3274c6; }

.panel-head { padding: 1rem; border-bottom: 1px solid #e3e9ef; display: flex; justify-content: space-between; gap: 1rem; }
.panel-head h3 { margin-bottom: .2rem; }
.panel-head p { margin: 0; color: #728296; }

.ticket-list, .installation-list { display: grid; }
.ticket-row, .installation-row {
  display: grid; grid-template-columns: 10px minmax(180px,1fr) 180px 160px 140px;
  gap: .8rem; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid #edf1f5;
}
.ticket-row:hover { background: #f7f9fb; }
.status-dot { width: 10px; height: 44px; border-radius: 99px; }
.status-NEW { background: #d93b3b; }
.status-WAITING { background: #e2b52c; }
.status-IN_PROGRESS { background: #32a25d; }
.status-RESOLVED { background: #3274c6; }
.ticket-row strong, .installation-row strong { display: block; }
.ticket-row small, .installation-row small { color: #738397; }

.installation-row { grid-template-columns: minmax(200px,1fr) 180px 160px 160px; }

dialog { width: min(760px, calc(100vw - 2rem)); border: 0; border-radius: 14px; padding: 0; box-shadow: 0 25px 80px rgba(12,30,50,.32); }
dialog::backdrop { background: rgba(12,30,50,.5); }
.dialog-shell { padding: 1.2rem; display: grid; gap: 1rem; }
.dialog-shell > header { display: flex; justify-content: space-between; gap: 1rem; align-items: start; border-bottom: 1px solid #e4e9ee; padding-bottom: .8rem; }
.dialog-shell > footer { display: flex; justify-content: flex-end; gap: .6rem; }
.icon-button { padding: .35rem .55rem; }

.ticket-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
.ticket-summary > div { padding: .75rem; border-radius: 9px; background: #f5f7fa; }
.ticket-summary span { display: block; color: #74859a; font-size: .72rem; text-transform: uppercase; font-weight: 800; }
.ticket-text { white-space: pre-wrap; padding: 1rem; background: #f8fafc; border-radius: 10px; }
.timeline { display: grid; gap: .6rem; }
.event { border-left: 3px solid #b9c7d5; padding: .3rem 0 .3rem .8rem; }
.event p { margin: .2rem 0; }
.event small { color: #718196; }
.detail-actions { display: grid; grid-template-columns: 220px 1fr auto; gap: .5rem; align-items: end; }
pre { white-space: pre-wrap; word-break: break-all; padding: 1rem; background: #132337; color: #d9e8f5; border-radius: 8px; }

@media (max-width: 900px) {
  .console { grid-template-columns: 1fr; }
  aside { position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  aside nav { display: flex; }
  aside > .ghost { margin: 0 0 0 auto; }
  .status-grid { grid-template-columns: repeat(2,1fr); }
  .ticket-row { grid-template-columns: 8px 1fr; }
  .ticket-row > :nth-child(n+3) { grid-column: 2; }
  .installation-row { grid-template-columns: 1fr; }
  .detail-actions { grid-template-columns: 1fr; }
}
