/* Envato Support System - Consolidated Stylesheet */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f7fb;
    color: #101828;
    line-height: 1.5;
}

a { color: #2d7ff9; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.container {
    max-width: 1180px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 30px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Buttons */
.btn {
    display: inline-block;
    text-decoration: none;
    background: #2d7ff9;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.9; text-decoration: none; color: #fff; }
.btn.secondary { background: #111827; }
.btn.danger { background: #dc3545; }
.btn.logout { background: #dc3545; }
.btn.disabled { background: #98a2b3; cursor: not-allowed; pointer-events: none; }

/* Alerts */
.alert { padding: 14px; border-radius: 8px; margin-bottom: 20px; }
.alert-error, .error { background: #ffe3e3; color: #b42318; }
.alert-success, .success { background: #dcfce7; color: #166534; }
.alert-info, .info { background: #eff6ff; color: #1d4ed8; }
.alert-warning, .notice { background: #fff7ed; color: #9a3412; }

/* Cards & Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.card { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 18px; }
.card .label { font-size: 13px; color: #667085; margin-bottom: 6px; }
.card .value { font-size: 20px; font-weight: bold; color: #101828; }

/* Items Grid */
.items-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.item-card { border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; background: #fff; }
.item-card img { width: 100%; height: 180px; object-fit: cover; background: #f3f4f6; }
.item-body { padding: 16px; }
.item-title { font-size: 18px; font-weight: bold; margin: 0 0 10px; line-height: 1.4; }
.item-title a { color: #101828; text-decoration: none; }
.item-meta { font-size: 14px; color: #667085; margin-bottom: 6px; word-break: break-word; }

/* Badges */
.badge { display: inline-block; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: bold; }
.status-open { background: #dbeafe; color: #1d4ed8; }
.status-answered { background: #fef3c7; color: #92400e; }
.status-closed { background: #e5e7eb; color: #374151; }
.state-support { background: #dbeafe; color: #1d4ed8; }
.state-customer { background: #fef3c7; color: #92400e; }
.state-closed { background: #e5e7eb; color: #374151; }
.small-badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }

/* Support Status */
.support-active { color: #0f766e; font-weight: bold; }
.support-expired { color: #b42318; font-weight: bold; }

/* Tickets */
.ticket-list { display: grid; gap: 12px; }
.ticket-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    flex-wrap: wrap;
}
.ticket-title { margin: 0 0 6px; font-size: 18px; }
.preview { margin-top: 8px; font-size: 14px; color: #344054; line-height: 1.5; }

/* Messages */
.msg { padding: 16px; border-radius: 10px; margin-bottom: 12px; }
.msg.customer { background: #eff6ff; border: 1px solid #bfdbfe; }
.msg.admin { background: #f8fafc; border: 1px solid #d1d5db; }
.msg-sender { font-weight: bold; margin-bottom: 8px; }
.msg-body { white-space: pre-wrap; }
.msg-time { color: #667085; font-size: 14px; margin-top: 8px; }

/* Forms */
label { display: block; margin-bottom: 4px; font-weight: 500; color: #344054; }
input[type="text"], input[type="password"], input[type="email"],
textarea, select {
    width: 100%;
    padding: 12px;
    margin-top: 4px;
    margin-bottom: 16px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font: inherit;
    color: #101828;
}
textarea { min-height: 160px; resize: vertical; }

/* Filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 22px; }
.filters input, .filters select { margin-bottom: 0; }

/* Actions */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* Profile */
.profile { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.profile img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid #e5e7eb; }

/* Box */
.box { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 18px; }

/* Notes */
.note-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; margin-bottom: 10px; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: top; }
th { background: #f8fafc; font-weight: 600; }

/* Empty state */
.empty { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 20px; color: #475467; }

/* Utility */
.muted { color: #667085; font-size: 14px; }
.section-title { margin-top: 35px; margin-bottom: 15px; font-size: 24px; }
.text-center { text-align: center; }

/* Two-column layout */
.layout-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
@media (max-width: 900px) { .layout-grid { grid-template-columns: 1fr; } }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 24px; align-items: center; }
.pagination a, .pagination span {
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}
.pagination .active { background: #2d7ff9; color: #fff; border-color: #2d7ff9; }
.pagination .disabled { color: #98a2b3; cursor: not-allowed; }

/* Login card */
.login-wrapper { width: 100%; max-width: 520px; }
.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 40px 30px;
    text-align: center;
}
.logo-circle {
    width: 78px; height: 78px; margin: 0 auto 20px; border-radius: 50%;
    background: #81b441; border: 1px solid #e5e7eb; display: flex;
    align-items: center; justify-content: center;
}
.logo-circle img { width: 42px; height: 42px; object-fit: contain; }
.login-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; background: #2d7ff9; color: #fff; padding: 14px 18px;
    border-radius: 10px; font-size: 16px; font-weight: bold; text-decoration: none;
    transition: 0.2s ease;
}
.login-btn:hover { opacity: 0.95; transform: translateY(-1px); color: #fff; }
.login-btn img { width: 22px; height: 22px; object-fit: contain; }
.subtitle { margin: 0 0 28px; color: #667085; font-size: 15px; line-height: 1.6; }

/* Auth card */
.auth-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 460px; background: #fff; padding: 30px; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
