/* =========================================================
   HYDE PROTOCOL THEME
   Two Accounts. One Mind.
   Drop-in replacement for the old Hyde CSS.
   ========================================================= */

:root {
    --hyde-bg: #050507;
    --hyde-bg-2: #090b10;
    --hyde-card: rgba(16, 18, 24, 0.92);
    --hyde-card-2: rgba(23, 26, 34, 0.88);
    --hyde-card-soft: rgba(255, 255, 255, 0.035);
    --hyde-border: rgba(212, 175, 55, 0.22);
    --hyde-border-soft: rgba(255, 255, 255, 0.08);
    --hyde-gold: #d4af37;
    --hyde-gold-2: #f5d46b;
    --hyde-silver: #b7c0ba;
    --hyde-green: #4ade80;
    --hyde-red: #ff6b6b;
    --hyde-blue: #74c0fc;
    --hyde-text: #f7f4ea;
    --hyde-muted: #9ca3af;
    --hyde-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

body {
    background:
        radial-gradient(circle at top left, rgba(212, 175, 55, 0.13), transparent 30%),
        radial-gradient(circle at bottom right, rgba(183, 192, 186, 0.08), transparent 32%),
        linear-gradient(135deg, #030304 0%, #090b10 45%, #000 100%);
    color: var(--hyde-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    min-height: 100vh;
}

a { text-decoration: none; }

/* LAYOUT */
.dashboard-layout { display: flex; min-height: 100vh; }

.sidebar-left {
    width: 250px;
    background: linear-gradient(180deg, rgba(5,5,7,.98), rgba(10,12,16,.94));
    border-right: 1px solid var(--hyde-border);
    padding: 1.35rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: 18px 0 60px rgba(0,0,0,.28);
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .72rem;
    color: var(--hyde-gold);
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: .78rem;
}

.sidebar-brand img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid rgba(212,175,55,.45);
    box-shadow: 0 0 24px rgba(212,175,55,.22);
}

.sidebar-subtitle {
    color: var(--hyde-muted);
    font-size: .68rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    margin-top: .15rem;
}

.sidebar-section-title {
    margin: .9rem .65rem .35rem;
    color: rgba(183,192,186,.72);
    font-size: .68rem;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.sidebar-nav { display: flex; flex-direction: column; gap: .25rem; }

.sidebar-nav a {
    color: var(--hyde-muted);
    font-size: .91rem;
    padding: .58rem .7rem;
    border-radius: .9rem;
    display: flex;
    align-items: center;
    gap: .55rem;
    border: 1px solid transparent;
    transition: all .18s ease;
}

.sidebar-nav a:hover {
    background: rgba(212, 175, 55, 0.07);
    border-color: rgba(212, 175, 55, 0.16);
    color: var(--hyde-gold-2);
    transform: translateX(2px);
}

.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(212,175,55,.19), rgba(183,192,186,.06));
    border-color: rgba(212,175,55,.35);
    color: var(--hyde-gold-2);
    box-shadow: inset 0 0 20px rgba(212,175,55,.05);
}

.main-content { flex: 1; padding: 1.5rem 1.5rem 2rem; }
.full-width-row { max-width: 1480px; margin: 0 auto; }

.header-top {
    position: relative;
    z-index: 1200;
    overflow: visible;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: .85rem 1rem;
    border: 1px solid var(--hyde-border-soft);
    background: rgba(9, 11, 16, .58);
    border-radius: 1.2rem;
    backdrop-filter: blur(12px);
}

.page-title { color: #fff7db; letter-spacing: .04em; }
.page-subtitle { color: var(--hyde-muted); font-size: .9rem; margin-bottom: 0; }

.header-user { display: flex; align-items: center; gap: .65rem; }
.user-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: radial-gradient(circle, rgba(212,175,55,.35), rgba(212,175,55,.08));
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; color: var(--hyde-gold-2);
    border: 1px solid rgba(212,175,55,.4);
}

.header-account-actions { position: relative; z-index: 1210; margin-left: auto; }
.header-account-menu { position: relative; z-index: 1220; }
.header-account-menu > summary { list-style: none; }
.header-account-menu > summary::-webkit-details-marker { display: none; }
.header-account-trigger {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    padding: .35rem .45rem .35rem .35rem;
    border: 1px solid transparent;
    border-radius: .9rem;
    color: var(--hyde-text);
    cursor: pointer;
    user-select: none;
    transition: background-color .18s ease, border-color .18s ease;
}
.header-account-trigger:hover,
.header-account-menu[open] .header-account-trigger {
    color: #fff;
    border-color: rgba(212,175,55,.2);
    background: rgba(212,175,55,.055);
}
.header-profile-copy { display: flex; flex-direction: column; min-width: 92px; line-height: 1.15; }
.header-profile-copy strong { max-width: 150px; overflow: hidden; color: #fff7db; font-size: .76rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.header-profile-copy small { margin-top: .22rem; color: #777f8a; font-size: .58rem; font-weight: 550; letter-spacing: .02em; }
.header-menu-chevron { width: 7px; height: 7px; margin: 0 .3rem 3px .15rem; border-right: 1px solid rgba(245,212,107,.78); border-bottom: 1px solid rgba(245,212,107,.78); transform: rotate(45deg); transition: transform .18s ease; }
.header-account-menu[open] .header-menu-chevron { margin-bottom: -3px; transform: rotate(225deg); }

.header-account-dropdown {
    position: absolute;
    z-index: 1100;
    top: calc(100% + .7rem);
    right: 0;
    width: min(310px, calc(100vw - 2rem));
    padding: .7rem;
    border: 1px solid rgba(212,175,55,.22);
    border-radius: 1rem;
    background: rgba(10,11,15,.98);
    box-shadow: 0 24px 60px rgba(0,0,0,.58), inset 0 1px rgba(255,255,255,.025);
    animation: header-menu-in .16s ease-out;
}
.header-account-dropdown::before { content:""; position:absolute; top:-5px; right:28px; width:9px; height:9px; border-top:1px solid rgba(212,175,55,.22); border-left:1px solid rgba(212,175,55,.22); background:#0a0b0f; transform:rotate(45deg); }
@keyframes header-menu-in { from { opacity:0; transform:translateY(-5px); } to { opacity:1; transform:translateY(0); } }
.header-dropdown-identity { display:flex; flex-direction:column; min-width:0; padding:.7rem .75rem .8rem; }
.header-dropdown-kicker { color:rgba(245,212,107,.7); font-size:.5rem; font-weight:900; letter-spacing:.14em; }
.header-dropdown-identity strong { overflow:hidden; margin-top:.42rem; color:#fff7db; font-size:.82rem; text-overflow:ellipsis; white-space:nowrap; }
.header-dropdown-identity small { overflow:hidden; margin-top:.25rem; color:#747c87; font-size:.63rem; text-overflow:ellipsis; white-space:nowrap; }
.header-dropdown-divider { height:1px; margin:0 .35rem .45rem; background:rgba(255,255,255,.065); }
.header-dropdown-form { margin:0; }
.header-dropdown-item {
    width:100%;
    display:grid;
    grid-template-columns:32px 1fr auto;
    gap:.7rem;
    align-items:center;
    padding:.7rem;
    border:0;
    border-radius:.75rem;
    color:#d7dbe1;
    background:transparent;
    text-align:left;
    transition:background-color .16s ease,color .16s ease;
}
.header-dropdown-item:hover { color:#fff; background:rgba(212,175,55,.065); }
.header-dropdown-icon { display:grid; place-items:center; width:32px; height:32px; border:1px solid rgba(212,175,55,.18); border-radius:.65rem; color:var(--hyde-gold-2); background:rgba(212,175,55,.05); font-size:.85rem; }
.header-dropdown-item > span:nth-child(2) { display:flex; flex-direction:column; }
.header-dropdown-item strong { font-size:.7rem; font-weight:800; }
.header-dropdown-item small { margin-top:.22rem; color:#747c87; font-size:.57rem; }
.header-dropdown-item i { color:rgba(245,212,107,.55); font-size:1rem; font-style:normal; }
.header-dropdown-logout { cursor:pointer; }
.header-dropdown-logout:hover { color:#ffd2d2; background:rgba(255,107,107,.065); }
.header-dropdown-logout .header-dropdown-icon { color:#ff9292; border-color:rgba(255,107,107,.18); background:rgba(255,107,107,.045); }

/* CARDS */
.card-hyde, .card {
    border-radius: 1.15rem;
    background: var(--hyde-card);
    border: 1px solid var(--hyde-border-soft);
    box-shadow: var(--hyde-shadow);
    color: var(--hyde-text);
}

.card-hyde .card-header, .card .card-header {
    border-bottom: 1px solid var(--hyde-border-soft);
    background: linear-gradient(90deg, rgba(212,175,55,.10), rgba(183,192,186,.035));
    border-radius: 1.15rem 1.15rem 0 0 !important;
}

.card-hyde .card-header h5,
.card-hyde h5,
.card-hyde h6,
.card h5,
.card h6 { color: #fff7db; }

.summary-card, .agent-status-card {
    width: 100%;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: var(--hyde-card-2);
    border: 1px solid var(--hyde-border-soft);
}

.summary-label, .result-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--hyde-muted);
}

.summary-value, .result-box {
    font-size: 1.24rem;
    font-weight: 750;
    color: #fff7db;
}

/* HYDE HERO */
.hyde-hero, .agent-hero {
    border-radius: 1.35rem;
    padding: 2rem;
    background:
        radial-gradient(circle at 15% 10%, rgba(212,175,55,.21), transparent 28%),
        linear-gradient(135deg, rgba(17,18,25,.96), rgba(5,5,7,.98));
    border: 1px solid rgba(212,175,55,.30);
    box-shadow: 0 24px 80px rgba(0,0,0,.58);
}

.hyde-logo-large { max-width: 190px; filter: drop-shadow(0 0 22px rgba(212,175,55,.18)); }
.hyde-tagline { color: var(--hyde-gold-2); letter-spacing: .22em; text-transform: uppercase; font-size: .82rem; }
.hyde-title { color: #fff7db; font-weight: 800; letter-spacing: .08em; }
.hyde-split { color: var(--hyde-silver); }

.agent-pill, .hyde-pill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .38rem .78rem;
    border-radius: 999px;
    background: rgba(212,175,55,.12);
    border: 1px solid rgba(212,175,55,.36);
    color: var(--hyde-gold-2);
    font-size: .82rem;
}

/* FORMS */
.form-label { color: #fff7db !important; font-size: .92rem !important; font-weight: 600 !important; }
.form-control, .form-select, textarea {
    background-color: rgba(5,5,7,.72) !important;
    border-color: rgba(255,255,255,.16) !important;
    color: #fff !important;
    border-radius: .8rem;
    font-size: .92rem;
}
.form-control::placeholder, textarea::placeholder { color: rgba(156,163,175,.78) !important; }
.form-control:focus, .form-select:focus, textarea:focus {
    box-shadow: 0 0 0 .16rem rgba(212,175,55,.25) !important;
    border-color: var(--hyde-gold) !important;
}
.form-control[readonly] { background-color: rgba(255,255,255,.035) !important; box-shadow: none; cursor: default; }

/* BUTTONS
   Keep foreground/background explicit: these rules also protect buttons from
   Bootstrap variables inherited by dark cards and cached theme overrides. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    border-radius: 999px;
    font-weight: 750;
    opacity: 1;
    visibility: visible;
}
.btn-hyde,
a.btn-hyde,
button.btn-hyde,
.btn-primary,
a.btn-primary,
button.btn-primary {
    min-height: 40px;
    padding: .6rem 1.08rem;
    border: 1px solid #f7df87 !important;
    background-color: #d4af37 !important;
    background-image: linear-gradient(135deg, #d4af37, #f7df87) !important;
    color: #050507 !important;
    -webkit-text-fill-color: #050507 !important;
    font-size: .92rem;
    font-weight: 850;
    line-height: 1.2;
    text-shadow: none !important;
    box-shadow: 0 8px 24px rgba(212,175,55,.22) !important;
}
.btn-hyde:hover,
.btn-hyde:focus,
.btn-primary:hover,
.btn-primary:focus {
    border-color: #fff0b0 !important;
    background-color: #f5d46b !important;
    background-image: linear-gradient(135deg, #f5d46b, #fff0b0) !important;
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    filter: none;
}
.btn-outline-light,
.btn-outline-warning,
.btn-outline-info,
.btn-outline-danger,
.btn-outline-success,
.btn-outline-secondary {
    background-color: rgba(255,255,255,.035) !important;
    box-shadow: none !important;
}
.btn-outline-light { border-color: rgba(255,255,255,.42) !important; color:#f8f9fa !important; -webkit-text-fill-color:#f8f9fa !important; }
.btn-outline-warning { border-color:#d4af37 !important; color:#f5d46b !important; -webkit-text-fill-color:#f5d46b !important; }
.btn-outline-info { border-color:#74c0fc !important; color:#a5d8ff !important; -webkit-text-fill-color:#a5d8ff !important; }
.btn-outline-danger { border-color:#ff6b6b !important; color:#ff9b9b !important; -webkit-text-fill-color:#ff9b9b !important; }
.btn-outline-success { border-color:#4ade80 !important; color:#86efac !important; -webkit-text-fill-color:#86efac !important; }
.btn-outline-secondary { border-color:#7d8590 !important; color:#d5d9df !important; -webkit-text-fill-color:#d5d9df !important; }
.btn-outline-light:hover { background-color:#f8f9fa !important; color:#08090b !important; -webkit-text-fill-color:#08090b !important; }
.btn-outline-warning:hover { background-color:#d4af37 !important; color:#08090b !important; -webkit-text-fill-color:#08090b !important; }
.btn-outline-info:hover { background-color:#74c0fc !important; color:#071018 !important; -webkit-text-fill-color:#071018 !important; }
.btn-outline-danger:hover { background-color:#ff6b6b !important; color:#130505 !important; -webkit-text-fill-color:#130505 !important; }
.btn-outline-success:hover { background-color:#4ade80 !important; color:#041108 !important; -webkit-text-fill-color:#041108 !important; }
.btn-outline-secondary:hover { background-color:#7d8590 !important; color:#fff !important; -webkit-text-fill-color:#fff !important; }
.btn-success { border-color:#4ade80 !important; background:#4ade80 !important; color:#041108 !important; -webkit-text-fill-color:#041108 !important; }
.btn-danger { border-color:#ff6b6b !important; background:#ff6b6b !important; color:#130505 !important; -webkit-text-fill-color:#130505 !important; }
.btn-secondary { border-color:#7d8590 !important; background:#5e6670 !important; color:#fff !important; -webkit-text-fill-color:#fff !important; }
.btn-success:hover { background:#86efac !important; color:#020b05 !important; -webkit-text-fill-color:#020b05 !important; }
.btn-danger:hover { background:#ff9b9b !important; color:#100303 !important; -webkit-text-fill-color:#100303 !important; }
.btn-secondary:hover { background:#7d8590 !important; color:#fff !important; -webkit-text-fill-color:#fff !important; }
.hyde-btn-secondary {
    min-height: 40px;
    padding: .6rem 1.08rem;
    border: 1px solid rgba(255,255,255,.32) !important;
    border-radius: 999px;
    background: rgba(255,255,255,.055) !important;
    color: #f7f4ea !important;
    -webkit-text-fill-color: #f7f4ea !important;
    font-weight: 750;
}
.hyde-btn-secondary:hover,
.hyde-btn-secondary:focus {
    border-color: #d4af37 !important;
    background: rgba(212,175,55,.12) !important;
    color: #f5d46b !important;
    -webkit-text-fill-color: #f5d46b !important;
}
.btn:focus-visible { outline: 3px solid rgba(245,212,107,.38); outline-offset: 2px; }
.btn:disabled,
.btn.disabled {
    opacity: .52 !important;
    visibility: visible !important;
    cursor: not-allowed;
}

/* TABLES */
.table-hyde, .table {
    --bs-table-bg: transparent !important;
    --bs-table-striped-bg: rgba(255,255,255,.025) !important;
    --bs-table-hover-bg: rgba(212,175,55,.055) !important;
    --bs-table-color: #f8f9fa;
    color: #f8f9fa;
    background-color: transparent !important;
    margin-bottom: 0;
}
.table-hyde thead, .table thead { background: rgba(255,255,255,.025); }
.table-hyde td, .table-hyde th, .table td, .table th { border-color: rgba(255,255,255,.10) !important; }
.table-hyde thead th, .table thead th { color: #fff7db; }

/* STATUS */
.status-tag, .badge-status {
    display: inline-flex; align-items: center;
    padding: .25rem .7rem;
    border-radius: 999px;
    font-size: .75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,.18);
}
.status-challenge-open, .status-waiting { background: rgba(212,175,55,.12); color: var(--hyde-gold-2); border-color: rgba(212,175,55,.55); }
.status-real-open, .status-active { background: rgba(74,222,128,.12); color: var(--hyde-green); border-color: rgba(74,222,128,.6); }
.status-challenge-burned, .status-real-burned, .status-error { background: rgba(255,107,107,.12); color: var(--hyde-red); border-color: rgba(255,107,107,.65); }
.status-closed { background: rgba(183,192,186,.11); color: var(--hyde-silver); border-color: rgba(183,192,186,.45); }

.dot { width: 10px; height: 10px; border-radius: 50%; display:inline-block; margin-right:6px; }
.dot-challenge-open { background-color: var(--hyde-gold); }
.dot-real-open { background-color: var(--hyde-green); }
.dot-challenge-burned, .dot-real-burned { background-color: var(--hyde-red); }

.agent-code, pre {
    background: rgba(0,0,0,.45);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: .75rem;
    padding: .75rem .95rem;
    color: var(--hyde-gold-2);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
}

.hint { font-size: .75rem; color: var(--hyde-muted); }
.text-secondary { color: var(--hyde-muted) !important; }
.text-light { color: var(--hyde-text) !important; }

.hyde-buttons { display:flex; justify-content:center; align-items:center; gap:15px; flex-wrap:wrap; width:100%; }
.hyde-btn {
    display:inline-block; padding:14px 26px; font-size:18px; font-weight:700;
    color:var(--hyde-gold-2); background-color:#000;
    border:2px solid var(--hyde-gold); border-radius:10px;
    text-decoration:none; transition:all .25s ease-in-out;
    box-shadow:0 0 12px rgba(212,175,55,.45);
}
.hyde-btn:hover { color:#000; background:var(--hyde-gold-2); box-shadow:0 0 20px rgba(212,175,55,.55); transform:scale(1.04); }

@media (max-width: 992px) {
    .dashboard-layout { flex-direction: column; }
    .header-top { z-index: 1030; }
    .sidebar-left {
        width: 100%; height: auto; position: relative;
        border-right: none; border-bottom: 1px solid var(--hyde-border);
    }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar-section-title { width:100%; margin-top:.6rem; }
    .main-content { padding: 1rem; }
    .header-top { flex-direction: column; align-items: flex-start; gap:.8rem; }
}

@media (max-width: 575.98px) {
    .header-account-actions { margin-left: auto; }
    .header-profile-copy,
    .header-menu-chevron { display: none; }
    .header-account-trigger { padding: .2rem; }
    .header-account-dropdown { right: -.25rem; }
}
/* =========================================================
   FIX MODAL NUOVO CICLO - TRACKING.PHP
   ========================================================= */

.modal-content {
    background: #101218 !important;
    color: var(--hyde-text) !important;
    border: 1px solid var(--hyde-border) !important;
    border-radius: 1.15rem;
}

.modal-header,
.modal-footer {
    background: rgba(23, 26, 34, 0.95) !important;
    border-color: var(--hyde-border-soft) !important;
}

.modal-body {
    background: #101218 !important;
    color: var(--hyde-text) !important;
}

.modal-title,
.modal-body label,
.modal-body .form-label {
    color: #fff7db !important;
}

.modal-body .form-control,
.modal-body .form-select,
.modal-body textarea {
    background-color: #050507 !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
}

.modal-body .form-select option {
    background-color: #050507 !important;
    color: #ffffff !important;
}

.modal-body .text-muted,
.modal-body small {
    color: var(--hyde-muted) !important;
}

.modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
