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

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

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

/* Layout */
.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }

header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo { font-weight: 600; font-size: 16px; color: #111827; }

.header-nav { display: flex; align-items: center; gap: 20px; font-size: 14px; }

main { padding: 32px 0; }

/* Auth pages */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 36px;
    width: 100%;
    max-width: 420px;
}

.auth-card h1 { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.auth-card p { color: #6b7280; font-size: 14px; margin-bottom: 24px; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: #374151; }

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    color: #111827;
    background: #fff;
    transition: border-color 0.15s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
}

.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; }

.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #e5e7eb; }

.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* Alerts */
.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

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

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.card-title { font-weight: 600; font-size: 15px; }
.card-meta { font-size: 13px; color: #6b7280; margin-top: 4px; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
}

.badge-open { background: #dbeafe; color: #1e40af; }
.badge-inprogress { background: #fef3c7; color: #92400e; }
.badge-awaiting { background: #ede9fe; color: #5b21b6; }
.badge-resolved { background: #d1fae5; color: #065f46; }
.badge-closed { background: #f3f4f6; color: #374151; }

.badge-low { background: #f3f4f6; color: #374151; }
.badge-normal { background: #dbeafe; color: #1e40af; }
.badge-high { background: #fef3c7; color: #92400e; }
.badge-critical { background: #fee2e2; color: #991b1b; }

/* Ticket thread */
.note {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.note-customer { background: #eff6ff; border: 1px solid #bfdbfe; }
.note-staff { background: #f9fafb; border: 1px solid #e5e7eb; }
.note-system { background: #f3f4f6; border: 1px solid #e5e7eb; color: #6b7280; font-size: 13px; }

.note-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
    font-weight: 500;
}

.note-text { white-space: pre-wrap; }

/* Page title row */
.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title { font-size: 20px; font-weight: 600; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state p { margin-top: 8px; font-size: 14px; }
