/* ==========================================================================
   Dana Nagoya Helpdesk — Design System
   Modern, minimalist, elegant UI
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Palette */
    --bg:            #f5f6f8;
    --surface:        #ffffff;
    --surface-muted:  #fafbfc;
    --border:         #e7e9ee;
    --border-strong:  #d8dbe2;

    --text-primary:   #171a21;
    --text-secondary: #5f6470;
    --text-muted:     #9498a3;

    --navy:           #10233d;
    --navy-soft:      #16304f;
    --navy-softer:    #1c3a5e;

    --accent:         #0f6e5f;
    --accent-dark:    #0b5a4e;
    --accent-tint:    #e7f4f1;

    --info:           #2563eb;
    --info-tint:      #eaf1fe;
    --warning:        #b7791f;
    --warning-tint:   #fbf1de;
    --danger:         #c0392b;
    --danger-tint:    #fbecea;
    --success:        #147a53;
    --success-tint:   #e7f6ef;
    --neutral:        #6b7280;
    --neutral-tint:   #eef0f3;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.06);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.10);

    --transition: all 0.18s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    font-size: 14.5px;
    line-height: 1.55;
}

h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }

/* ==========================================================================
   Login Page
   ========================================================================== */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.05) 0%, transparent 40%),
        linear-gradient(160deg, var(--navy) 0%, #0b1626 100%);
}

.login-box {
    background: var(--surface);
    padding: 44px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.5s ease;
    border: 1px solid var(--border);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-box h2 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 30px;
    font-size: 22px;
    font-weight: 700;
}

.logo {
    text-align: center;
    margin-bottom: 22px;
}

.logo img {
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.08));
}

.logo i {
    font-size: 44px;
    color: var(--accent);
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    padding-left: 40px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface-muted);
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-tint);
}

.form-group i {
    position: absolute;
    left: 14px;
    top: 41px;
    color: var(--text-muted);
    font-size: 14px;
}

.btn-login {
    width: 100%;
    padding: 13px;
    background: var(--navy);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.btn-login:hover {
    background: var(--navy-softer);
}

.error-message {
    background: var(--danger-tint);
    color: var(--danger);
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    text-align: center;
    font-size: 13.5px;
    border: 1px solid rgba(192, 57, 43, 0.15);
}

.info-message {
    background: var(--info-tint);
    color: var(--info);
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    text-align: center;
    font-size: 13.5px;
    border: 1px solid rgba(37, 99, 235, 0.12);
}

/* ==========================================================================
   Dashboard Layout
   ========================================================================== */

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 252px;
    background: var(--navy);
    color: white;
    padding: 22px 16px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 6px 8px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
}

.sidebar-header img {
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.sidebar-header h3 {
    font-size: 15.5px;
    font-weight: 700;
    color: #f3f5f8;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 3px;
}

.sidebar-menu a {
    color: #a9b1c2;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 13.8px;
    font-weight: 500;
}

.sidebar-menu a i,
.sidebar-menu a .fa,
.sidebar-menu a .fab {
    width: 18px;
    text-align: center;
    font-size: 14px;
    opacity: 0.85;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.06);
    color: white;
}

.sidebar-menu a.active {
    background: var(--accent);
    color: white;
}

.main-content {
    margin-left: 252px;
    flex: 1;
    padding: 28px 32px;
    background: var(--bg);
    min-height: 100vh;
}

.header {
    background: var(--surface);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h2 {
    color: var(--text-primary);
    font-size: 19px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info span {
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
}

.user-role-badge {
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.role-admin { background: var(--danger); }
.role-agent { background: var(--warning); }
.role-user  { background: var(--info); }

.btn-logout {
    padding: 8px 16px;
    background: var(--surface);
    color: var(--danger);
    border: 1.5px solid var(--danger-tint);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--danger-tint);
    color: var(--danger);
}

.btn-back {
    padding: 8px 16px;
    background: var(--surface-muted);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-back:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* ==========================================================================
   Stat Cards
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.stat-card {
    background: var(--surface);
    padding: 22px 22px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card h4 {
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .number {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.stat-card:nth-child(1) .number { color: var(--info); }
.stat-card:nth-child(2) .number { color: var(--danger); }
.stat-card:nth-child(3) .number { color: var(--warning); }
.stat-card:nth-child(4) .number { color: var(--success); }

/* ==========================================================================
   Content Card
   ========================================================================== */

.content-card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 22px;
}

.content-card h3 {
    font-size: 16.5px;
}

.card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 22px;
}

/* ==========================================================================
   Table
   ========================================================================== */

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: var(--surface-muted);
    padding: 12px 15px;
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1.5px solid var(--border);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

table td {
    padding: 13px 15px;
    border-bottom: 1px solid var(--border);
    font-size: 13.8px;
    color: var(--text-primary);
}

table tbody tr {
    transition: var(--transition);
}

table tbody tr:hover {
    background: var(--surface-muted);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    letter-spacing: 0.02em;
}

.badge-open        { background: var(--info-tint);    color: var(--info); }
.badge-progress,
.badge-in_progress  { background: var(--warning-tint); color: var(--warning); }
.badge-resolved     { background: var(--success-tint); color: var(--success); }
.badge-closed       { background: var(--neutral-tint); color: var(--neutral); }

.badge-low          { background: var(--info-tint);    color: var(--info); }
.badge-medium       { background: var(--warning-tint); color: var(--warning); }
.badge-high         { background: #fdeee0;             color: #b1560f; }
.badge-urgent       { background: var(--danger-tint);  color: var(--danger); }

.badge-admin        { background: var(--danger-tint);  color: var(--danger); }
.badge-agent        { background: var(--warning-tint); color: var(--warning); }
.badge-user         { background: var(--info-tint);    color: var(--info); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    padding: 9px 17px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13.3px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: var(--transition);
}

.btn-primary   { background: var(--navy);     color: white; }
.btn-primary:hover   { background: var(--navy-softer); color: white; text-decoration: none; }

.btn-secondary { background: var(--surface-muted); color: var(--text-secondary); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text-primary); text-decoration: none; }

.btn-success   { background: var(--accent);   color: white; }
.btn-success:hover   { background: var(--accent-dark); color: white; text-decoration: none; }

.btn-info      { background: var(--info);     color: white; }
.btn-info:hover      { background: #1d4fd1;   color: white; text-decoration: none; }

.btn-danger    { background: var(--danger);   color: white; }
.btn-danger:hover    { background: #a3311f;   color: white; text-decoration: none; }

.btn-warning   { background: var(--warning);  color: white; }
.btn-warning:hover   { background: #96631a;   color: white; text-decoration: none; }

.btn-save      { background: var(--navy); color: white; padding: 11px 24px; }
.btn-save:hover      { background: var(--navy-softer); }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-group { display: inline-flex; gap: 8px; }
.action-buttons { display: inline-flex; gap: 8px; }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-control {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
    font-size: 13.8px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface-muted);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-tint);
}

select.form-control { cursor: pointer; }

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-section {
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-child { border-bottom: none; margin-bottom: 0; }

.form-section h4 {
    font-size: 14.5px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.help-text {
    color: var(--text-muted);
    font-size: 12.5px;
    margin-top: -10px;
    margin-bottom: 15px;
    display: block;
}

.current-value {
    color: var(--text-secondary);
    font-size: 12.5px;
    background: var(--surface-muted);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 10px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.alert-success { background: var(--success-tint); color: var(--success); border-color: rgba(20,122,83,0.15); }
.alert-danger  { background: var(--danger-tint);  color: var(--danger);  border-color: rgba(192,57,43,0.15); }
.alert-info    { background: var(--info-tint);    color: var(--info);    border-color: rgba(37,99,235,0.12); }

/* ==========================================================================
   Tabs
   ========================================================================== */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1.5px solid var(--border);
    margin-bottom: 22px;
}

.tab {
    padding: 11px 18px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1.5px;
    transition: var(--transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tab:hover { color: var(--text-primary); text-decoration: none; }

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    text-decoration: none;
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ==========================================================================
   Toggle Switch
   ========================================================================== */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #d3d7de;
    transition: var(--transition);
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .toggle-slider { background-color: var(--accent); }
input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ==========================================================================
   Modal
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(16, 24, 40, 0.5);
    z-index: 2000;
}

.modal.active { display: block; }

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.close-modal {
    position: absolute;
    top: 18px;
    right: 20px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.close-modal:hover { color: var(--text-primary); }

/* ==========================================================================
   Ticket View
   ========================================================================== */

.ticket-code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.02em;
}

.success-ticket {
    text-align: center;
    padding: 10px 0;
}

.ticket-info {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 20px;
}

.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 16px 0;
}

.ticket-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ticket-meta-item span:first-child {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 700;
}

.status-form { }

.closed-notice {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--neutral-tint);
    color: var(--text-secondary);
    padding: 18px 20px;
    border-radius: var(--radius-md);
    margin-top: 20px;
}

/* ==========================================================================
   Response / Conversation thread
   ========================================================================== */

.response-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

.response-item:last-child { border-bottom: none; }

.response-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.response-user {
    display: flex;
    align-items: center;
    gap: 11px;
}

.response-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--navy);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.response-user-meta {
    display: flex;
    align-items: center;
    gap: 9px;
}

.response-user-meta strong {
    font-weight: 700;
    font-size: 13.8px;
    color: var(--text-primary);
}

.response-time {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.response-body {
    padding-left: 47px;
    color: var(--text-primary);
    font-size: 13.8px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.response-image {
    padding-left: 47px;
    margin-top: 10px;
}

.response-image img {
    max-width: 280px;
    max-height: 220px;
    width: auto;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    display: block;
    object-fit: cover;
    transition: var(--transition);
}

.response-image img:hover {
    opacity: 0.9;
}

.response-image-download {
    margin-top: 8px;
}

.response-image-download a {
    color: var(--accent);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
}

.response-image-download a:hover {
    text-decoration: underline;
}

.remove-image {
    color: var(--danger);
    cursor: pointer;
    font-size: 12px;
}

.no-responses {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

/* ==========================================================================
   File Upload
   ========================================================================== */

.file-upload-wrapper { margin-bottom: 15px; }

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--surface-muted);
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.file-upload-label:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-tint);
}

#image-preview {
    position: relative;
    display: inline-block;
    margin-top: 10px;
}

#image-preview img {
    max-width: 220px;
    max-height: 160px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: block;
    object-fit: cover;
}

#image-preview .remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    padding: 0;
}

/* ==========================================================================
   Admin / Telegram
   ========================================================================== */

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
}

.status-active   { background: var(--success-tint); color: var(--success); }
.status-inactive { background: var(--neutral-tint); color: var(--neutral); }

.button-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- Status card --- */
.tg-status-card { display: flex; align-items: center; gap: 20px; }

.tg-status-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.tg-status-icon.is-active   { background: var(--success-tint); color: var(--success); }
.tg-status-icon.is-inactive { background: var(--neutral-tint); color: var(--neutral); }

.tg-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12.5px;
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* --- Setup guide --- */
.guide-list {
    list-style: none;
    counter-reset: guide;
    padding: 0;
    color: var(--text-secondary);
}

.guide-list li {
    counter-increment: guide;
    position: relative;
    padding: 9px 0 9px 40px;
    font-size: 13.5px;
    border-bottom: 1px dashed var(--border);
}

.guide-list li:last-child { border-bottom: none; }

.guide-list li::before {
    content: counter(guide);
    position: absolute;
    left: 0;
    top: 7px;
    width: 24px;
    height: 24px;
    background: var(--navy);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
}

.steps { padding: 0; }

details.guide-details summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

details.guide-details summary::-webkit-details-marker { display: none; }

details.guide-details summary .chevron {
    transition: var(--transition);
    color: var(--text-muted);
}

details.guide-details[open] summary .chevron { transform: rotate(180deg); }

/* --- Setting rows (toggle) --- */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.setting-row:last-child { margin-bottom: 0; }
.setting-row strong { font-size: 13.8px; }
.setting-row small { color: var(--text-muted); font-size: 12.5px; }

.setting-row-main {
    border-color: var(--accent);
    background: var(--accent-tint);
}

/* --- Telegram-style preview mockup --- */
.tg-preview {
    background: linear-gradient(160deg, #dbe9f5 0%, #c9dcee 100%);
    border-radius: var(--radius-md);
    padding: 26px 22px;
}

.tg-bubble {
    background: var(--surface);
    border-radius: 4px 14px 14px 14px;
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    font-size: 12.8px;
    line-height: 1.7;
    color: var(--text-primary);
    max-width: 480px;
    white-space: pre-wrap;
}

.tg-bubble-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 700;
    color: #2aa9dc;
    font-size: 13px;
}

/* ==========================================================================
   Empty States
   ========================================================================== */

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

.empty-state i {
    font-size: 44px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content { margin-left: 0; padding: 18px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
