:root {
  --black: #080808;
  --panel: #121212;
  --card: #181818;
  --line: #383838;
  --white: #f7f7f4;
  --muted: #b6b6b0;
  --gold: #d4af37;
  --gold-light: #f8dc73;
  --danger: #ed7171;
  --success: #75d38b;
  --radius: 18px;
  --metallic: linear-gradient(105deg, #241400 0%, #704407 12%, #b77c13 24%, #e2b83f 36%, #fff0a0 48%, #fff8c9 52%, #d8a82d 65%, #9a610b 80%, #3a2100 100%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body { margin: 0; background: var(--black); color: var(--white); font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.gr-header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 76px; padding: 8px max(20px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid #5a3900; background: rgba(8, 8, 8, .96); backdrop-filter: blur(14px); }
.gr-header::after { content: ""; position: absolute; right: 0; bottom: -3px; left: 0; height: 3px; background: var(--metallic); }
.gr-brand { display: flex; align-items: center; gap: 12px; color: var(--white); text-decoration: none; }
.gr-brand img { display: block; width: 145px; height: 58px; object-fit: contain; filter: drop-shadow(0 0 12px rgba(212, 175, 55, .24)); }
.gr-brand span { padding-left: 12px; border-left: 1px solid rgba(212, 175, 55, .48); color: var(--gold-light); font-size: 13px; font-weight: 800; letter-spacing: 1.2px; }
.gr-header nav { display: flex; align-items: center; gap: 9px; }
.gr-header nav a, .gr-header nav button { padding: 9px 12px; border: 1px solid #565656; border-radius: 10px; background: #191919; color: #eee; text-decoration: none; }
.gr-header nav a:hover, .gr-header nav button:hover { border-color: var(--gold); color: var(--gold-light); }

main { width: min(1180px, calc(100% - 32px)); margin: 0 auto 80px; }
.gr-hero { display: grid; grid-template-columns: 1fr 330px; gap: 34px; align-items: center; padding: 64px 0 34px; }
.gr-hero h1 { margin: .12em 0; font-size: clamp(42px, 6vw, 72px); line-height: 1.02; }
.gr-hero > div > p:last-child { max-width: 780px; margin-bottom: 0; color: var(--muted); font-size: 18px; }
.gr-eyebrow { margin: 0; color: var(--gold-light); font-size: 12px; font-weight: 900; letter-spacing: 2px; }
.gr-session-card { display: flex; align-items: center; gap: 14px; padding: 20px; border: 1px solid #674300; border-radius: var(--radius); background: linear-gradient(145deg, #1b1307, #111); }
.gr-session-card strong, .gr-session-card small { display: block; }
.gr-session-card strong { color: var(--gold-light); }
.gr-session-card small { margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.gr-spinner { width: 28px; height: 28px; flex: 0 0 auto; border: 3px solid #4c3c19; border-top-color: var(--gold-light); border-radius: 50%; animation: gr-spin .9s linear infinite; }
@keyframes gr-spin { to { transform: rotate(360deg); } }

.gr-access, .gr-denied { display: grid; grid-template-columns: 1fr minmax(300px, 430px); gap: 40px; align-items: center; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.gr-access h2, .gr-denied h2, .gr-section-heading h2 { margin: 4px 0 6px; font-size: clamp(26px, 4vw, 38px); }
.gr-access p, .gr-denied p, .gr-section-heading p { color: var(--muted); }
.gr-access form { display: grid; gap: 14px; }
.gr-denied { grid-template-columns: 1fr; text-align: center; }
.gr-denied .gr-button { justify-self: center; }

label { display: grid; gap: 7px; color: #dddcd6; font-size: 14px; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid #4a4a4a; border-radius: 11px; outline: none; background: #101010; color: var(--white); padding: 12px 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(231, 164, 17, .12); }
textarea { min-height: 112px; resize: vertical; }
input[type="file"] { color: var(--muted); padding: 9px; }
label small { color: var(--muted); font-weight: 400; }
:disabled { cursor: wait; opacity: .62; }

.gr-button { display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-height: 43px; padding: 10px 16px; border: 1px solid #5a5a5a; border-radius: 11px; background: #202020; color: var(--white); font-weight: 850; text-decoration: none; }
.gr-button:hover { filter: brightness(1.12); }
.gr-primary { border-color: var(--gold-light); background: var(--metallic); color: #1a0f00; }
.gr-danger { border-color: #7b3030; color: #ff9a9a; }

.gr-rolebar { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 18px 20px; border: 1px solid #674300; border-radius: 14px; background: #171208; }
.gr-rolebar div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gr-rolebar span { padding: 6px 10px; border: 1px solid var(--gold); border-radius: 999px; color: var(--gold-light); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.gr-rolebar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-rolebar p { margin: 0; color: var(--muted); text-align: right; }
.gr-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 42px; }
.gr-metric { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #1b1b1b, #111); }
.gr-metric small { color: var(--muted); }
.gr-metric strong { display: block; margin-top: 4px; color: var(--gold-light); font-size: 32px; }

.gr-new { margin-top: 46px; }
.gr-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.gr-section-heading > p { max-width: 420px; margin: 0; text-align: right; }
.gr-form-card { display: grid; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.gr-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gr-form-actions { display: flex; justify-content: flex-end; }

.gr-list-section { margin-top: 54px; }
.gr-filter { width: 210px; }
.gr-list { display: grid; gap: 16px; }
.gr-empty { padding: 46px 24px; border: 1px dashed #555; border-radius: var(--radius); color: var(--muted); text-align: center; }
.gr-case { position: relative; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(150deg, #191919, #101010); }
.gr-case-target { border-color: var(--gold-light); box-shadow: 0 0 0 4px rgba(232, 180, 50, .16), 0 18px 50px rgba(0, 0, 0, .42); animation: gr-highlight 1.5s ease; }
@keyframes gr-highlight { 0% { transform: scale(.985); filter: brightness(1.35); } 100% { transform: none; filter: none; } }
.gr-case::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 3px; background: var(--metallic); }
.gr-case-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.gr-case-head h3 { margin: 5px 0 3px; font-size: 23px; }
.gr-case-id { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.gr-status { display: inline-flex; padding: 6px 10px; border: 1px solid #755310; border-radius: 999px; background: #2e230b; color: #f4c94d; font-size: 12px; font-weight: 900; white-space: nowrap; }
.gr-status[data-state="Resuelto"], .gr-status[data-state="Cerrado"] { border-color: #2e7040; background: #102918; color: #8be2a1; }
.gr-case-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 14px 0; color: var(--muted); font-size: 13px; }
.gr-case-copy { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gr-copy-box { padding: 14px; border: 1px solid #333; border-radius: 12px; background: #101010; }
.gr-copy-box strong { color: var(--gold-light); }
.gr-copy-box p { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.gr-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.gr-files .gr-button { min-height: 38px; padding: 7px 11px; font-size: 13px; }
.gr-history { margin-top: 18px; padding-left: 16px; border-left: 2px solid #9e7215; }
.gr-history h4 { margin: 0 0 10px; }
.gr-history-item { position: relative; padding: 0 0 12px; color: var(--muted); font-size: 13px; }
.gr-history-item::before { content: ""; position: absolute; top: 6px; left: -21px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.gr-history-item strong { display: block; color: #eee; }
.gr-action { display: grid; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #343434; }
.gr-action-buttons { display: flex; flex-wrap: wrap; gap: 9px; }
.gr-action .gr-button { min-width: 150px; }

.gr-toast { position: fixed; right: 18px; bottom: 18px; z-index: 100; max-width: min(430px, calc(100vw - 36px)); padding: 14px 18px; border: 1px solid var(--gold); border-radius: 12px; background: #1a1a1a; color: #fff; box-shadow: 0 16px 45px rgba(0, 0, 0, .55); }
.gr-toast.error { border-color: #8a3030; color: #ffb0b0; }

#abrirNotificaciones { position: relative; }
#contadorNotificaciones { display: inline-grid; min-width: 22px; height: 22px; margin-left: 4px; padding: 0 6px; place-items: center; border-radius: 999px; background: var(--metallic); color: #1a0f00; font-size: 11px; font-weight: 900; }
.gr-notifications { width: min(680px, calc(100% - 24px)); max-height: min(760px, 88vh); padding: 24px; border: 1px solid var(--gold); border-radius: var(--radius); background: #0e0e0e; color: var(--white); box-shadow: 0 35px 120px rgba(0, 0, 0, .78); }
.gr-notifications::backdrop { background: rgba(0, 0, 0, .82); }
.gr-notifications-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid #383838; }
.gr-notifications-head h2 { margin: 4px 0 0; font-size: 30px; }
.gr-notifications-head button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #555; border-radius: 50%; background: #1e1e1e; color: #fff; font-size: 24px; }
.gr-notifications-list { display: grid; gap: 10px; margin-top: 16px; }
.gr-notification { padding: 15px; border: 1px solid #3b3b3b; border-radius: 13px; background: #171717; }
.gr-notification.unread { border-color: #8c620b; background: #1d170b; }
.gr-notification-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.gr-notification h3 { margin: 0; color: var(--gold-light); font-size: 17px; }
.gr-notification p { margin: 7px 0; color: #e7e7e2; }
.gr-notification small { color: var(--muted); }
.gr-notification .gr-button { min-height: 35px; padding: 6px 10px; font-size: 12px; white-space: nowrap; }

@media (max-width: 900px) {
  .gr-hero { grid-template-columns: 1fr; padding-top: 44px; }
  .gr-session-card { max-width: 520px; }
  .gr-access { grid-template-columns: 1fr; }
  .gr-metrics { grid-template-columns: 1fr 1fr; }
  .gr-case-copy { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .gr-header { align-items: flex-start; }
  .gr-brand img { width: 108px; height: 48px; }
  .gr-brand span { display: none; }
  .gr-header nav { align-items: stretch; flex-direction: column; }
  .gr-header nav a, .gr-header nav button { padding: 6px 9px; font-size: 12px; text-align: center; }
  main { width: min(100% - 20px, 1180px); }
  .gr-hero h1 { font-size: 42px; }
  .gr-access, .gr-denied, .gr-form-card, .gr-case { padding: 17px; }
  .gr-rolebar, .gr-section-heading, .gr-case-head { align-items: stretch; flex-direction: column; }
  .gr-rolebar div { align-items: flex-start; flex-direction: column; }
  .gr-rolebar p, .gr-section-heading > p { text-align: left; }
  .gr-grid-two { grid-template-columns: 1fr; }
  .gr-filter { width: 100%; }
  .gr-form-actions .gr-button, .gr-action-buttons .gr-button { width: 100%; }
  .gr-notifications { padding: 17px; }
  .gr-notification-head { align-items: stretch; flex-direction: column; }
}
