
/* ── Reset & Base ─────────────────────────────────────────── */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }



:root {

    --tde-cyan:    #00d4ff;

    --tde-cyan-dim:#00b8d9;

    --ybwp-green:  #00e676;

    --ybwp-dim:    #00c853;

    --bg:          #0a0a0a;

    --bg2:         #111111;

    --bg3:         #1a1a1a;

    --border:      #222222;

    --border2:     #2a2a2a;

    --text-pri:    #e0e0e0;

    --text-sec:    #aaaaaa;

    --text-dim:    #666666;

    --red:         #ff5252;

    --red-bg:      #3a1010;

    --red-border:  #7a2020;

    --green-bg:    #103a10;

    --green-border:#207a20;

    --green-text:  #80ff80;

    --warn-bg:     #3a2a10;

    --warn-border: #7a5a20;

    --warn-text:   #ffcc80;

    --accent:      var(--tde-cyan);

    --accent-dim:  var(--tde-cyan-dim);

    --radius:      6px;

    --radius-lg:   10px;

}



body {

    background: var(--bg);

    color: var(--text-pri);

    font-family: Arial, sans-serif;

    font-size: 15px;

    line-height: 1.5;

    min-height: 100vh;

}



body.entity-ybwp { --accent: var(--ybwp-green); --accent-dim: var(--ybwp-dim); }



.page-wrap { display: flex; flex-direction: column; min-height: 100vh; }



.main-content {

    flex: 1;

    width: 100%;

    max-width: 860px;

    margin: 0 auto;

    padding: 32px 20px 48px;

}



.footer {

    text-align: center;

    padding: 18px;

    color: var(--text-dim);

    font-size: 0.75rem;

    border-top: 1px solid var(--border);

}



.topnav {

    background: var(--bg2);

    border-bottom: 1px solid var(--border);

    position: sticky;

    top: 0;

    z-index: 100;

}



.topnav-inner {

    max-width: 860px;

    margin: 0 auto;

    padding: 0 20px;

    height: 54px;

    display: flex;

    align-items: center;

    justify-content: space-between;

}



.topnav-brand { display: flex; align-items: center; gap: 10px; }

.brand-name { font-weight: bold; font-size: 1rem; }

.brand-name.tde  { color: var(--tde-cyan); }

.brand-name.ybwp { color: var(--ybwp-green); }

.brand-sub { color: var(--text-dim); font-size: 0.78rem; }



.entity-badge {

    font-size: 0.7rem;

    font-weight: bold;

    padding: 2px 8px;

    border-radius: 10px;

    letter-spacing: 0.04em;

}

.entity-badge.entity-tde  { background: #00d4ff18; color: var(--tde-cyan);   border: 1px solid #00d4ff33; }

.entity-badge.entity-ybwp { background: #00e67618; color: var(--ybwp-green); border: 1px solid #00e67633; }



.topnav-links { display: flex; align-items: center; gap: 6px; }



.nav-link {

    color: var(--text-sec);

    text-decoration: none;

    font-size: 0.88rem;

    padding: 6px 12px;

    border-radius: var(--radius);

    transition: color 0.15s, background 0.15s;

}

.nav-link:hover  { color: var(--accent); background: #ffffff08; }

.nav-link.active { color: var(--accent); }

.nav-link.signout { color: var(--text-dim); }

.nav-link.signout:hover { color: var(--red); }



.flash-wrap { margin-bottom: 20px; }



.alert {

    padding: 10px 14px;

    border-radius: var(--radius);

    margin-bottom: 8px;

    font-size: 0.88rem;

}

.alert-error   { background: var(--red-bg);   border: 1px solid var(--red-border);   color: #ff8080; }

.alert-success { background: var(--green-bg); border: 1px solid var(--green-border); color: var(--green-text); }

.alert-warning { background: var(--warn-bg);  border: 1px solid var(--warn-border);  color: var(--warn-text); }

.alert-info    { background: #0d2a3a;          border: 1px solid #1a5a7a;             color: #80ccff; }



.auth-wrap {

    min-height: 100vh;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background: var(--bg);

}



.auth-card {

    background: var(--bg2);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    padding: 36px 40px;

    width: 100%;

    max-width: 420px;

}



.auth-brand { text-align: center; margin-bottom: 28px; }

.auth-brand h1 { color: var(--accent); font-size: 1.5rem; }

.auth-brand p  { color: var(--text-dim); font-size: 0.82rem; margin-top: 4px; }

.auth-tagline  { color: var(--text-dim); font-size: 0.75rem; text-align: center; margin-top: 24px; }



.form-group { margin-bottom: 18px; }



label {

    display: block;

    color: var(--text-sec);

    font-size: 0.85rem;

    margin-bottom: 6px;

}



input[type=email],

input[type=password],

input[type=text],

input[type=number],

textarea,

select {

    width: 100%;

    padding: 10px 12px;

    background: var(--bg3);

    border: 1px solid var(--border2);

    border-radius: var(--radius);

    color: var(--text-pri);

    font-size: 0.95rem;

    outline: none;

    font-family: inherit;

    transition: border-color 0.15s;

}

input:focus, textarea:focus, select:focus { border-color: var(--accent); }

textarea { resize: vertical; min-height: 100px; }



.btn {

    display: inline-block;

    padding: 11px 20px;

    background: var(--accent);

    color: #0a0a0a;

    border: none;

    border-radius: var(--radius);

    font-size: 1rem;

    font-weight: bold;

    cursor: pointer;

    text-decoration: none;

    transition: background 0.15s;

    text-align: center;

}

.btn:hover { background: var(--accent-dim); }

.btn-full  { width: 100%; }

.btn-sm    { padding: 7px 14px; font-size: 0.85rem; }

.btn-ghost {

    background: transparent;

    color: var(--accent);

    border: 1px solid var(--accent);

}

.btn-ghost:hover { background: #ffffff0a; }



a.link { color: var(--accent); text-decoration: none; font-size: 0.88rem; }

a.link:hover { text-decoration: underline; }



.text-center { text-align: center; }

.mt-16 { margin-top: 16px; }

.mt-24 { margin-top: 24px; }

.mb-8  { margin-bottom: 8px; }



.dash-welcome { margin-bottom: 28px; }

.dash-welcome h2 { color: #fff; font-size: 1.3rem; }

.dash-welcome p  { color: var(--text-sec); font-size: 0.88rem; margin-top: 4px; }



.dash-grid {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));

    gap: 16px;

    margin-bottom: 24px;

}



.stat-card {

    background: var(--bg2);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    padding: 20px 24px;

}

.stat-card .stat-label { color: var(--text-dim); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }

.stat-card .stat-value { color: var(--accent); font-size: 2rem; font-weight: bold; margin: 6px 0 2px; }

.stat-card .stat-sub   { color: var(--text-sec); font-size: 0.82rem; }



.panel {

    background: var(--bg2);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    padding: 24px;

    margin-bottom: 16px;

}

.panel-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 16px;

}

.panel-header h3 { color: var(--accent); font-size: 0.95rem; }



.page-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 24px;

}

.page-header h2 { color: #fff; font-size: 1.2rem; }



.ticket-list { display: flex; flex-direction: column; gap: 10px; }



.ticket-row {

    background: var(--bg2);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    padding: 16px 20px;

    display: flex;

    align-items: center;

    gap: 16px;

    text-decoration: none;

    color: inherit;

    transition: border-color 0.15s, background 0.15s;

    cursor: pointer;

}

.ticket-row:hover { border-color: var(--accent); background: #ffffff04; }



.ticket-priority-dot {

    width: 10px; height: 10px;

    border-radius: 50%;

    flex-shrink: 0;

}

.priority-critical { background: var(--red); box-shadow: 0 0 6px var(--red); }

.priority-high     { background: #ff9800; box-shadow: 0 0 6px #ff980080; }

.priority-normal   { background: #4caf50; }



.ticket-main { flex: 1; min-width: 0; }

.ticket-title { color: var(--text-pri); font-size: 0.95rem; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ticket-meta  { color: var(--text-dim); font-size: 0.78rem; margin-top: 3px; }

.ticket-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }



.status-badge {

    font-size: 0.72rem;

    font-weight: bold;

    padding: 2px 10px;

    border-radius: 10px;

    white-space: nowrap;

}

.status-open           { background: #0d2a3a; color: #80ccff; border: 1px solid #1a5a7a; }

.status-in-progress    { background: #2a2a0d; color: #ffee80; border: 1px solid #5a5a1a; }

.status-see-management { background: #2a0d2a; color: #ee80ff; border: 1px solid #5a1a5a; }

.status-closed         { background: #1a1a1a; color: #888;    border: 1px solid #333; }



.ticket-num { color: var(--text-dim); font-size: 0.75rem; }



.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }

.empty-state p { margin-bottom: 20px; font-size: 0.95rem; }



.back-link {

    display: inline-flex;

    align-items: center;

    gap: 6px;

    color: var(--text-sec);

    text-decoration: none;

    font-size: 0.85rem;

    margin-bottom: 20px;

    transition: color 0.15s;

}

.back-link:hover { color: var(--accent); }



.ticket-detail-header {

    background: var(--bg2);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    padding: 24px;

    margin-bottom: 16px;

}

.ticket-detail-header h2 { color: #fff; font-size: 1.1rem; margin-bottom: 12px; }



.ticket-meta-grid {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));

    gap: 12px;

    margin-top: 16px;

    padding-top: 16px;

    border-top: 1px solid var(--border);

}

.meta-item .meta-label { color: var(--text-dim); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }

.meta-item .meta-value { color: var(--text-pri); font-size: 0.88rem; margin-top: 3px; }



.thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }



.thread-msg {

    background: var(--bg2);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    padding: 16px 20px;

}

.thread-msg.staff-msg  { border-left: 3px solid var(--accent); }

.thread-msg.client-msg { border-left: 3px solid var(--text-dim); }



.msg-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 8px;

}

.msg-author        { color: var(--accent); font-size: 0.85rem; font-weight: bold; }

.msg-author.client { color: var(--text-sec); }

.msg-time          { color: var(--text-dim); font-size: 0.75rem; }

.msg-body          { color: var(--text-pri); font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; }



.reply-box {

    background: var(--bg2);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    padding: 20px 24px;

}

.reply-box h4 { color: var(--text-sec); font-size: 0.88rem; margin-bottom: 12px; }



.submit-card {

    background: var(--bg2);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    padding: 28px 32px;

    max-width: 600px;

}

.submit-card h2  { color: #fff; font-size: 1.1rem; margin-bottom: 6px; }

.submit-card .sub { color: var(--text-sec); font-size: 0.85rem; margin-bottom: 24px; }



.admin-card {

    background: var(--bg2);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    padding: 32px 36px;

    max-width: 500px;

    margin: 0 auto;

}



.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }



@media (max-width: 600px) {

    .topnav-links .nav-link { padding: 6px 8px; font-size: 0.82rem; }

    .auth-card { padding: 28px 24px; }

    .ticket-right { display: none; }

}

