/* styles.css */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #f4f6fb;
    color: #1f2933;
    padding: 20px;
}

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

/* Auth / centered container */
.center-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    background: #ffffff;
    border-radius: 10px;
    padding: 24px 28px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    max-width: 420px;
    width: 100%;
}

.card h2 {
    margin-bottom: 8px;
    font-size: 22px;
    font-weight: 600;
}

.card p.subtitle {
    margin-bottom: 20px;
    color: #6b7280;
    font-size: 14px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 9px 11px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f9fafb;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1d4ed8);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-secondary {
    background: #e5e7eb;
    color: #111827;
}
.btn-secondary:hover {
    background: #d1d5db;
}

/* Alerts */
.alert {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
}
.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.alert-info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* Layout for dashboards */
.app-shell {
    max-width: 1100px;
    margin: 0 auto;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.app-title {
    font-size: 24px;
    font-weight: 600;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #4b5563;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #e5e7eb;
    color: #111827;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}
.stat-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}
.stat-value {
    font-size: 22px;
    font-weight: 600;
    color: #111827;
}

/* Tables */
.table-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
    margin-bottom: 18px;
}

.table-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table thead {
    background: #f3f4f6;
}
.table th, .table td {
    padding: 9px 8px;
    text-align: left;
}
.table th {
    font-weight: 600;
    color: #4b5563;
    border-bottom: 1px solid #e5e7eb;
}
.table tbody tr:nth-child(even) {
    background: #f9fafb;
}
.table tbody tr:hover {
    background: #eef2ff;
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}
.badge-open {
    background: #ecfdf3;
    color: #166534;
}
.badge-assigned {
    background: #eff6ff;
    color: #1d4ed8;
}
.badge-closed {
    background: #fef2f2;
    color: #b91c1c;
}

/* Chat layout */
.chat-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.5fr) minmax(0, 1.3fr);
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.chat-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
    padding: 16px 18px;
}

.chat-meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.chat-box {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    height: 380px;
    overflow-y: auto;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.chat-message {
    margin-bottom: 8px;
    font-size: 13px;
}

.chat-timestamp {
    color: #9ca3af;
    font-size: 11px;
    margin-right: 6px;
}

.chat-sender {
    font-weight: 600;
    margin-right: 4px;
}

.chat-input-row {
    display: flex;
    gap: 8px;
}

/* Visitor widget */
.widget {
    max-width: 360px;
    margin: 40px auto;
}

.widget-header {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    padding: 14px 16px;
    border-radius: 14px 14px 0 0;
}

.widget-header h3 {
    margin-bottom: 2px;
    font-size: 16px;
}
.widget-header p {
    font-size: 12px;
    color: #dbeafe;
}

.widget-body {
    background: #ffffff;
    border-radius: 0 0 14px 14px;
    padding: 14px 16px 16px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.15);
}

.widget-chat-box {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    height: 260px;
    overflow-y: auto;
    padding: 8px 10px;
    margin-bottom: 10px;
    font-size: 13px;
}

/* Small helper */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-2 { margin-bottom: 8px; }
.text-right { text-align: right; }
