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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    background: #f3f4f6;
    color: #111827;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    background: #111827;
    color: #f9fafb;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar .logo {
    font-weight: 600;
    font-size: 18px;
}

.topbar .user-info {
    margin-right: 10px;
    font-size: 14px;
}

.btn {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 13px;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-outline {
    background: transparent;
    color: #e5e7eb;
    border-color: #4b5563;
}

.btn-outline:hover {
    background: #374151;
}

.main-nav {
    background: #1f2937;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

.main-nav li {
    margin-right: 10px;
}

.main-nav a {
    display: block;
    padding: 8px 14px;
    color: #d1d5db;
    font-size: 14px;
}

.main-nav a:hover {
    background: #111827;
    color: #fff;
}

.content {
    max-width: 1100px;
    margin: 20px auto 60px;
    padding: 0 16px;
}

h1, h2, h3 {
    margin-bottom: 10px;
    color: #111827;
}

p {
    margin-bottom: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
}

table th,
table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

table th {
    text-align: left;
    background: #f9fafb;
    font-weight: 600;
}

form {
    margin-top: 10px;
}

label {
    display: block;
    margin: 8px 0 2px;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    max-width: 400px;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    font-size: 14px;
}

textarea {
    min-height: 80px;
}

.alert {
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
}

.alert-success {
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.ticket-reply {
    background: #fff;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
}

.ticket-reply.internal {
    background: #fffbeb;
    border-color: #facc15;
}

.footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #111827;
    color: #9ca3af;
    font-size: 12px;
    padding: 6px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.relation-dropdown {
    position: absolute;
    background: #ffffff;
    border: 1px solid #d1d5db;
    width: 100%;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 4px;
    margin-top: 2px;
}

.relation-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
}

.relation-item:hover {
    background: #f3f4f6;
}

.subnav { margin: 10px 0 15px; }
.subnav a { margin-right: 10px; font-size: 14px; }
.subnav a.active { font-weight: 600; text-decoration: underline; }


.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    border: 1px solid #ccc;
}
.badge.status-open { background:#fffbe6; border-color:#ffec99; }
.badge.status-in_progress { background:#e6f4ff; border-color:#99c9ff; }
.badge.status-waiting_customer { background:#fff0f0; border-color:#ffb3b3; }
.badge.status-closed { background:#e8ffe6; border-color:#9ad29a; }

.badge.badge-light {
    background:#f5f5f5;
    border-color:#ddd;
}

.filter-form label {
    margin-right:4px;
}
.filter-form select {
    margin-right:8px;
}
