/* ============================================
   Overlink24 — Тикет-система
   Цветовая палитра:
   Фон основной:   #050814
   Карточки:       #0C1224
   Панели:         #121A2E
   Яркий синий:    #1E7BFF
   Голубой:        #39C6FF
   Средний синий:  #2D9DFF
   Текст осн.:     #FFFFFF
   Текст доп.:     #A8B3C2
   Градиент:       #39C6FF → #1E7BFF → #040814
   ============================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: #050814;
    color: #FFFFFF;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: #39C6FF; text-decoration: none; transition: color .2s; }
a:hover { color: #1E7BFF; }

/* ===== Login Page ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(30,123,255,0.08) 0%, transparent 70%),
                #050814;
}

.login-box {
    background: #0C1224;
    padding: 48px 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    margin: 60px 20px;
    border: 1px solid rgba(30,123,255,0.1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(30,123,255,0.03);
}

.login-box .logo-img {
    width: auto;
    height: auto;
    border-radius: 12px;
    max-height: 56px;
    margin-bottom: 12px;
    object-fit: cover;
}

.login-box .brand-name {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, #39C6FF, #1E7BFF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.login-box .slogan {
    font-size: 13px;
    color: #A8B3C2;
    margin-bottom: 28px;
}

.login-box h1 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 24px;
    color: #A8B3C2;
}

.login-box input {
    width: 100%;
    padding: 14px 18px;
    background: #121A2E;
    border: 1px solid rgba(30,123,255,0.15);
    border-radius: 12px;
    color: #FFFFFF;
    font-size: 15px;
    margin-bottom: 8px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.login-box input:focus {
    border-color: #1E7BFF;
    box-shadow: 0 0 0 3px rgba(30,123,255,0.15);
}

.login-box .hint {
    font-size: 12px;
    color: #5A6B82;
    margin-bottom: 20px;
}

.login-box .btn { width: 100%; }

/* ===== Topbar ===== */
.topbar {
    background: #0C1224;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid rgba(30,123,255,0.08);
}

.topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
}

.topbar .brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.topbar .user {
    margin-left: auto;
    color: #A8B3C2;
    font-size: 14px;
}

/* ===== Container ===== */
.container { max-width: 840px; margin: 0 auto; padding: 32px 20px; }

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.header-actions h1 {
    font-size: 26px;
    font-weight: 600;
    background: linear-gradient(135deg, #39C6FF, #1E7BFF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #1E7BFF, #2D9DFF);
    color: #FFFFFF !important;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none !important;
    transition: all .25s;
    box-shadow: 0 4px 15px rgba(30,123,255,0.2);
}
.btn:hover {
    background: linear-gradient(135deg, #2D9DFF, #39C6FF);
    box-shadow: 0 4px 25px rgba(30,123,255,0.4), 0 0 15px rgba(57,198,255,0.15);
    transform: translateY(-1px);
}
.btn.small { padding: 8px 16px; font-size: 12px; }

/* ===== Ticket List ===== */
.ticket-list { display: flex; flex-direction: column; gap: 12px; }

.ticket-card {
    background: #0C1224;
    border: 1px solid rgba(30,123,255,0.08);
    border-radius: 14px;
    padding: 18px;
    display: block;
    transition: all .2s;
}
.ticket-card:hover {
    border-color: rgba(57,198,255,0.3);
    box-shadow: 0 4px 20px rgba(30,123,255,0.08);
    transform: translateY(-1px);
}

.ticket-card .ticket-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}
.ticket-card .ticket-id {
    font-size: 12px;
    color: #5A6B82;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.ticket-card .ticket-subject {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #FFFFFF;
}
.ticket-card .ticket-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #A8B3C2;
}

.ticket-card.open { border-left: 3px solid #F0AD4E; }
.ticket-card.in-progress { border-left: 3px solid #39C6FF; }
.ticket-card.resolved { border-left: 3px solid #00C853; }
.ticket-card.closed { border-left: 3px solid #5A6B82; opacity: .7; }

.status-badge, .ticket-status {
    font-size: 11px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.status-open { background: rgba(240,173,78,0.12); color: #F0AD4E; }
.status-in_progress { background: rgba(57,198,255,0.12); color: #39C6FF; }
.status-resolved { background: rgba(0,200,83,0.12); color: #00C853; }
.status-closed { background: rgba(90,107,130,0.15); color: #5A6B82; }

.empty {
    text-align: center;
    padding: 80px 20px;
    color: #5A6B82;
    font-size: 15px;
}

/* ===== Ticket View ===== */
.ticket-header {
    margin-bottom: 8px;
}
.ticket-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
}
.ticket-meta-bar {
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: #A8B3C2;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px 0;
    border-bottom: 1px solid rgba(30,123,255,0.06);
}

.status-actions {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13px;
    color: #A8B3C2;
}

/* ===== Messages ===== */
.messages { margin: 28px 0; display: flex; flex-direction: column; gap: 16px; }
.message {
    padding: 18px 20px;
    border-radius: 14px;
    max-width: 82%;
}
.message.client {
    background: #0C1224;
    border: 1px solid rgba(30,123,255,0.08);
    align-self: flex-start;
}
.message.admin {
    background: linear-gradient(135deg, #0C1224, #121A2E);
    border: 1px solid rgba(30,123,255,0.2);
    align-self: flex-end;
}
.msg-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: #A8B3C2;
}
.msg-time { color: #5A6B82; }
.msg-text {
    line-height: 1.7;
    font-size: 14px;
    white-space: pre-wrap;
    color: #E8ECF0;
}

/* ===== Forms ===== */
.ticket-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 600px;
}
.ticket-form label {
    font-size: 13px;
    color: #A8B3C2;
}
.ticket-form input,
.ticket-form select,
.ticket-form textarea {
    padding: 12px 16px;
    background: #121A2E;
    border: 1px solid rgba(30,123,255,0.12);
    border-radius: 10px;
    color: #FFFFFF;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.ticket-form input:focus,
.ticket-form select:focus,
.ticket-form textarea:focus {
    border-color: #1E7BFF;
    box-shadow: 0 0 0 3px rgba(30,123,255,0.1);
}
.ticket-form textarea { resize: vertical; min-height: 100px; }
.ticket-form .btn { align-self: flex-start; }

.reply-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}
.reply-form textarea {
    width: 100%;
    padding: 14px 18px;
    background: #121A2E;
    border: 1px solid rgba(30,123,255,0.12);
    border-radius: 12px;
    color: #FFFFFF;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.reply-form textarea:focus {
    border-color: #1E7BFF;
    box-shadow: 0 0 0 3px rgba(30,123,255,0.1);
}
.reply-form .btn { align-self: flex-start; }

/* ===== Alerts ===== */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert.error {
    background: rgba(255,68,68,0.08);
    border: 1px solid rgba(255,68,68,0.2);
    color: #FF6B6B;
}

/* ===== Back button ===== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #A8B3C2;
    font-size: 14px;
    margin-bottom: 20px;
    transition: color .2s;
}
.back-link:hover { color: #39C6FF; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #050814; }
::-webkit-scrollbar-thumb { background: #121A2E; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #1E7BFF; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .message { max-width: 100%; }
    .ticket-meta-bar { flex-direction: column; gap: 8px; }
    .header-actions { flex-direction: column; align-items: flex-start; gap: 12px; }
    .login-box { padding: 32px 24px; }
    .topbar { padding: 10px 16px; flex-wrap: wrap; }
}
