* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f3f4f6; color: #1f2937; min-height: 100vh; display: flex; flex-direction: column; }

/* Nav */
.portal-nav { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0.75rem 1.5rem; position: sticky; top: 0; z-index: 50; }
.nav-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { font-size: 1.1rem; font-weight: 700; color: #1e40af; display: flex; align-items: center; gap: 0.5rem; }
.nav-logo { height: 24px; width: auto; }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-user { font-size: 0.85rem; color: #6b7280; }

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem; flex: 1; }

/* Buttons */
.btn { display: inline-flex; align-items: center; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500; border-radius: 0.5rem; border: none; cursor: pointer; text-decoration: none; transition: all 0.15s; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-outline { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.btn-outline:hover { background: #f9fafb; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }

/* Cards */
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 1.25rem; margin-bottom: 1rem; }
.card h3 { font-size: 0.9rem; font-weight: 600; color: #374151; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.03em; }

/* Page Header */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; gap: 1rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: #374151; margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.03em; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid #d1d5db; border-radius: 0.5rem; font-size: 0.9rem; transition: border 0.15s; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* Login */
.login-container { display: flex; align-items: center; justify-content: center; flex: 1; padding: 1rem; }
.login-card { width: 100%; max-width: 420px; }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 { font-size: 1.75rem; color: #1e40af; }
.login-header p { color: #6b7280; margin-top: 0.25rem; }
.login-logo { height: 48px; width: auto; margin-bottom: 1rem; }
.login-form { background: #fff; border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 1.5rem; }
.login-hint { text-align: center; font-size: 0.8rem; color: #9ca3af; margin-top: 1rem; }
.login-hint a { color: #2563eb; }
.login-toggle { display: flex; gap: 0; margin-bottom: 1.5rem; border-radius: 0.5rem; overflow: hidden; border: 1px solid #e5e7eb; }
.login-toggle-btn { flex: 1; text-align: center; padding: 0.6rem; font-size: 0.85rem; font-weight: 500; color: #6b7280; background: #f9fafb; text-decoration: none; transition: all 0.15s; }
.login-toggle-btn.active { background: #2563eb; color: #fff; }
.login-toggle-btn:hover:not(.active) { background: #f3f4f6; }

/* Text */
.text-muted { color: #6b7280; font-size: 0.85rem; }

/* Filter Bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter-pill { padding: 0.35rem 0.75rem; font-size: 0.8rem; border-radius: 9999px; text-decoration: none; color: #6b7280; background: #f3f4f6; transition: all 0.15s; }
.filter-pill:hover { background: #e5e7eb; }
.filter-pill.active { background: #2563eb; color: #fff; }

/* Ticket List */
.ticket-list { display: flex; flex-direction: column; }
.ticket-row { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-bottom: 1px solid #f3f4f6; text-decoration: none; color: inherit; transition: background 0.1s; }
.ticket-row:hover { background: #f9fafb; }
.ticket-row:last-child { border-bottom: none; }
.ticket-prio { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }
.ticket-info { flex: 1; min-width: 0; }
.ticket-number { font-family: monospace; font-size: 0.8rem; font-weight: 600; color: #2563eb; }
.ticket-subject { font-weight: 500; margin: 0.15rem 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-meta { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.ticket-arrow { color: #d1d5db; font-size: 1.5rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: #9ca3af; }
.empty-state .btn { margin-top: 1rem; }

/* Status/Prio Badges */
.status-badge, .prio-badge { display: inline-flex; padding: 0.2rem 0.6rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; color: #fff; }

/* Ticket Detail */
.ticket-detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; }
.ticket-number-large { font-family: monospace; font-size: 0.9rem; font-weight: 700; color: #2563eb; }
.ticket-description { white-space: pre-wrap; line-height: 1.6; color: #374151; }
.detail-list { display: flex; flex-direction: column; gap: 0.75rem; }
.detail-item { display: flex; justify-content: space-between; align-items: center; }
.detail-label { font-size: 0.8rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.03em; }

/* Comments */
.comment-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.comment { padding: 1rem; border-radius: 0.5rem; }
.comment-customer { background: #eff6ff; border-left: 3px solid #2563eb; }
.comment-agent { background: #f0fdf4; border-left: 3px solid #16a34a; }
.comment-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.comment-header strong { font-size: 0.85rem; }
.comment-body { font-size: 0.9rem; line-height: 1.5; }
.comment-form textarea { width: 100%; padding: 0.75rem; border: 1px solid #d1d5db; border-radius: 0.5rem; font-size: 0.9rem; margin-bottom: 0.75rem; resize: vertical; font-family: inherit; }
.comment-form textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

/* Footer */
.portal-footer { background: #fff; border-top: 1px solid #f3f4f6; margin-top: auto; }
.footer-main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.5rem 0; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; font-size: 0.8rem; }
.footer-links a { color: #6b7280; text-decoration: none; }
.footer-links a:hover { color: #374151; }
.footer-email-btn { display: inline-flex; align-items: center; gap: 0.4rem; background: #2563eb; color: #fff !important; padding: 0.5rem 1.25rem; border-radius: 0.5rem; font-weight: 500; font-size: 0.85rem; transition: background 0.15s; }
.footer-email-btn:hover { background: #1d4ed8; color: #fff !important; }
.footer-bottom { max-width: 1100px; margin: 0 auto; padding: 1rem 1.5rem; border-top: 1px solid #f9fafb; display: flex; align-items: center; justify-content: center; gap: 0.35rem; font-size: 0.7rem; color: #d1d5db; }
.footer-bottom a { display: flex; align-items: center; gap: 0.25rem; color: #d1d5db; text-decoration: none; }
.footer-bottom a:hover { color: #9ca3af; }
.footer-logo { height: 14px; width: auto; opacity: 0.4; }
.footer-logo-large { height: 18px; width: auto; opacity: 0.5; }
.footer-support { max-width: 1100px; margin: 0 auto; padding: 0.5rem 1.5rem 1rem; text-align: center; font-size: 0.7rem; color: #d1d5db; }
.footer-support a { color: #2563eb; text-decoration: none; }
.footer-support a:hover { text-decoration: underline; }

/* Language Switcher */
.lang-switcher { display: flex; justify-content: center; gap: 0.25rem; padding: 0.75rem 1.5rem 0; }
.lang-btn { display: inline-block; padding: 0.25rem 0.6rem; font-size: 0.7rem; font-weight: 600; color: #9ca3af; background: transparent; border: 1px solid #e5e7eb; border-radius: 0.25rem; text-decoration: none; transition: all 0.15s; }
.lang-btn:hover { color: #374151; border-color: #9ca3af; }
.lang-btn.active { color: #fff; background: #2563eb; border-color: #2563eb; }

/* Responsive */
@media (max-width: 768px) {
    .ticket-detail-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; }
    .nav-user { display: none; }
}
