/* giga0 Support — estilos (mismo aire que Giga Drive) */
:root {
    --blue: #3b82f6; --blue-d: #2563eb; --bg: #f5f6f8; --card: #ffffff; --ink: #1f2937; --muted: #6b7280;
    --line: #e5e7eb; --soft: #f9fafb; --input: #ffffff; --staff: #eff6ff; --staff-line: #bfdbfe;
    --note: #fffbeb; --note-line: #fde68a; --ok-bg: #ecfdf5; --ok: #047857; --err-bg: #fef2f2; --err: #b91c1c;
    --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05);
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111827; --card: #1f2937; --ink: #e5e7eb; --muted: #9ca3af; --line: #374151; --soft: #18212f; --input: #111827;
        --staff: #172554; --staff-line: #1e3a8a; --note: #2d2611; --note-line: #713f12; --ok-bg: #052e22; --ok: #6ee7b7;
        --err-bg: #3b1212; --err: #fca5a5; --shadow: none;
        color-scheme: dark;
    }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
small, .muted { color: var(--muted); }

/* ---------- barra de arriba ---------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; height: 60px; padding: 0 20px; background: var(--blue); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff !important; font-size: 18px; text-decoration: none !important; white-space: nowrap; }
.brand b { font-weight: 600; }
.logo { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; flex: none; }
.logo svg { width: 20px; height: 20px; fill: #fff; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: rgba(255,255,255,.88); padding: 7px 12px; border-radius: 8px; text-decoration: none; white-space: nowrap; }
.nav a:hover, .nav a.on { background: rgba(255,255,255,.18); color: #fff; }
.spacer { flex: 1; }
.who { position: relative; }
.who summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; color: #fff; }
.who summary::-webkit-details-marker { display: none; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; border: 2px solid rgba(255,255,255,.6); }
.who-menu { position: absolute; right: 0; top: 46px; min-width: 220px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 6px 0; }
.who-head { padding: 8px 14px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; word-break: break-all; }
.who-menu a, .who-menu button { display: block; width: 100%; text-align: left; padding: 8px 14px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none; }
.who-menu a:hover, .who-menu button:hover { background: var(--soft); }
.who-menu form { margin: 0; }
@media (max-width: 640px) {
    .top { gap: 10px; padding: 0 12px; }
    .brand span:last-child, .who-name { display: none; }
    .nav a { padding: 7px 8px; font-size: 14px; }
}

/* ---------- contenido ---------- */
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 16px 40px; flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.head .grow { flex: 1; min-width: 200px; }
.foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 16px 20px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.langs { display: flex; gap: 12px; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
       font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; background: var(--soft); color: var(--ink); border-color: var(--line); }
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-d); filter: none; }
.btn-light { background: #fff; color: var(--blue-d); border-color: #fff; }
.btn-danger { background: transparent; color: var(--err); border-color: var(--err); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-sm { padding: 6px 12px; font-size: 14px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- formularios ---------- */
.form { display: grid; gap: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.help { color: var(--muted); font-size: 13px; margin-top: 5px; }
input[type=text], input[type=email], input[type=search], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--input); color: var(--ink); font: inherit; outline: none; }
textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.files { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; background: var(--soft); }
.files input { font-size: 14px; max-width: 100%; }
.files-list { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 17px; height: 17px; margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions .grow { flex: 1; }
.captcha { min-height: 65px; }

/* ---------- avisos y etiquetas ---------- */
.alert { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-err { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.alert-info { background: var(--staff); color: var(--ink); border-color: var(--staff-line); }
.alert-warn { background: var(--note); color: var(--ink); border-color: var(--note-line); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.b-open { background: #fef3c7; color: #92400e; }
.b-answered { background: #d1fae5; color: #065f46; }
.b-closed { background: #e5e7eb; color: #374151; }
.b-prio-high { background: #fee2e2; color: #991b1b; }
.b-prio-low { background: #e0e7ff; color: #3730a3; }
.b-staff { background: #dbeafe; color: #1e40af; }
.b-note { background: #fef3c7; color: #92400e; }
.b-guest { background: #f3e8ff; color: #6b21a8; }

/* ---------- listas de tickets ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); background: var(--card); text-decoration: none; font-size: 14px; }
.tabs a.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.tabs .n { opacity: .75; margin-left: 4px; }
.search { display: flex; gap: 8px; margin-bottom: 14px; }
.tlist { width: 100%; border-collapse: collapse; }
.tlist th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tlist td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tlist tr:last-child td { border-bottom: 0; }
.tlist tbody tr:hover { background: var(--soft); }
.tlist .num { color: var(--muted); font-size: 13px; white-space: nowrap; }
.tlist .subj { font-weight: 600; color: var(--ink); word-break: break-word; }
.tlist .sub2 { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tlist .when { white-space: nowrap; color: var(--muted); font-size: 13px; }
.tcard { padding: 0; overflow: hidden; }
@media (max-width: 720px) {
    .tlist thead { display: none; }
    .tlist, .tlist tbody, .tlist tr, .tlist td { display: block; width: 100%; }
    .tlist tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
    .tlist td { padding: 2px 0; border: 0; }
}
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.pager { display: flex; justify-content: space-between; margin-top: 14px; }

/* ---------- inicio ---------- */
.hero { max-width: 560px; margin: 30px auto 0; text-align: center; padding: 36px 28px; }
.hero h1 { font-size: 28px; margin-bottom: 10px; }
.hero p { color: var(--muted); margin: 0 0 26px; }
.hero .alt { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 14px; }
.g0btn { display: inline-flex; align-items: center; gap: 10px; }
.g0btn .logo { width: 26px; height: 26px; background: rgba(255,255,255,.25); }
.g0btn .logo svg { width: 16px; height: 16px; }

/* ---------- ticket ---------- */
.tgrid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
@media (max-width: 860px) { .tgrid { grid-template-columns: 1fr; } }
.thead h1 { word-break: break-word; }
.thead .meta { color: var(--muted); font-size: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.thread { display: grid; gap: 14px; margin: 18px 0; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.msg-staff { background: var(--staff); border-color: var(--staff-line); }
.msg-note { background: var(--note); border-color: var(--note-line); border-style: dashed; }
.msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; }
.msg-head .when { color: var(--muted); margin-left: auto; font-size: 13px; }
.msg-body { word-break: break-word; overflow-wrap: anywhere; }
.msg-sys { text-align: center; color: var(--muted); font-size: 13px; }
.msg-sys span { background: var(--bg); padding: 0 10px; }
.atts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 12px; }
.att { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 13px; color: var(--ink); max-width: 100%; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att small { flex: none; }
.att-img { padding: 0; overflow: hidden; display: block; }
.att-img img { display: block; max-width: 220px; max-height: 160px; object-fit: cover; }
.side h2 { font-size: 15px; }
.side dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; font-size: 14px; }
.side dt { color: var(--muted); }
.side dd { margin: 0; overflow-wrap: anywhere; }
.side form + form { margin-top: 12px; }
.side .form { gap: 10px; }
.side select { padding: 7px 10px; }
.danger-zone { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
