/**
 * Animal Database UK - Support System Styles
 * A clean, professional design with subtle gradients and modern aesthetics
 */

/* ================================================================
   CSS VARIABLES & ROOT STYLES
   ================================================================ */
:root {
    /* Primary Colors */
    --primary: #0090e7;
    --primary-dark: #0057a3;
    --primary-light: #4facfe;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Background & Surface */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --surface: #ffffff;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Plus Jakarta Sans', var(--font-primary);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

/* ================================================================
   BASE STYLES
   ================================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--gray-700);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ================================================================
   LAYOUT
   ================================================================ */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-sm {
    max-width: 720px;
}

.container-lg {
    max-width: 1440px;
}

/* ================================================================
   HEADER & NAVIGATION
   ================================================================ */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo img {
    height: 44px;
    width: 44px;
    background: #fff;
    border-radius: 10px;
    padding: 3px;
    box-sizing: border-box;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav a i {
    font-size: 0.9em;
}

.nav a:hover,
.nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

/* ================================================================
   HERO SECTION
   ================================================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ================================================================
   SEARCH BOX
   ================================================================ */
.search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 1.25rem 1.5rem 1.25rem 3.5rem;
    font-size: 1.125rem;
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    box-shadow: var(--shadow-xl), 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.search-box i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.25rem;
}

.search-box button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background: var(--primary-dark);
}

/* ================================================================
   BREADCRUMB
   ================================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
}

.breadcrumb .separator {
    color: var(--gray-400);
    font-size: 0.75rem;
}

.breadcrumb .current {
    color: var(--gray-600);
    font-weight: 500;
}

/* ================================================================
   CARDS & PANELS
   ================================================================ */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.card-header h2,
.card-header h3 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Category Cards */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.category-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.category-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.category-content p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
}

/* ================================================================
   FORMS
   ================================================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--surface);
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 144, 231, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-text {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: var(--gray-50);
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--primary);
    background: rgba(0, 144, 231, 0.05);
}

.file-upload-area i {
    font-size: 2.5rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.file-upload-area p {
    color: var(--gray-600);
    margin: 0;
}

.file-upload-area .browse-link {
    color: var(--primary);
    font-weight: 500;
}

.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.file-item i {
    color: var(--gray-500);
}

.file-item .file-name {
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.file-item .file-size {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.file-item .remove-file {
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 144, 231, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 144, 231, 0.4);
    color: white;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.0625rem;
}

.btn-block {
    width: 100%;
}

/* ================================================================
   BADGES
   ================================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-primary { background: rgba(0, 144, 231, 0.1); color: var(--primary); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.badge-secondary { background: var(--gray-200); color: var(--gray-600); }

/* Priority Badges */
.badge-priority-low { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-priority-medium { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.badge-priority-high { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-priority-urgent { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* ================================================================
   TICKETS
   ================================================================ */
.ticket-list {
    list-style: none;
}

.ticket-item {
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ticket-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.ticket-status-indicator {
    width: 4px;
    height: 60px;
    border-radius: 2px;
    flex-shrink: 0;
}

.ticket-status-indicator.open { background: var(--primary); }
.ticket-status-indicator.in_progress { background: var(--info); }
.ticket-status-indicator.waiting_customer { background: var(--warning); }
.ticket-status-indicator.resolved { background: var(--success); }
.ticket-status-indicator.closed { background: var(--gray-400); }

.ticket-content {
    flex: 1;
    min-width: 0;
}

.ticket-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.ticket-number {
    font-family: monospace;
    font-size: 0.8125rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
}

.ticket-subject {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.ticket-meta i {
    margin-right: 0.25rem;
}

.ticket-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Ticket Detail Page */
.ticket-detail {
    max-width: 900px;
    margin: 0 auto;
}

/* Ticket View Layout */
.ticket-view-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 992px) {
    .ticket-view-layout {
        grid-template-columns: 1fr;
    }
}

.ticket-sidebar .card {
    position: sticky;
    top: 1rem;
}

.ticket-sidebar .ticket-meta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ticket-sidebar .meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ticket-sidebar .meta-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ticket-sidebar .meta-value {
    font-weight: 500;
    color: var(--gray-800);
}

/* Ticket Main Content */
.ticket-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ticket-subject-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.ticket-subject-card h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.ticket-description {
    color: var(--gray-600);
    line-height: 1.7;
    white-space: pre-wrap;
}

/* Conversation Thread */
.conversation-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.conversation-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.conversation-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.conversation-list {
    padding: 1rem 0;
}

.conversation-message {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.conversation-message:last-child {
    border-bottom: none;
}

.conversation-message.from-support {
    background: rgba(0, 144, 231, 0.03);
}

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.message-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.message-avatar.user {
    background: var(--primary);
}

.message-avatar.support {
    background: var(--success);
}

.message-author-info strong {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-800);
}

.message-author-info small {
    color: var(--gray-500);
    font-size: 0.75rem;
}

.message-time {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.message-body {
    color: var(--gray-700);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Reply Form */
.reply-form-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.reply-form-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.reply-textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reply-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 144, 231, 0.1);
}

.reply-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}

.ticket-detail-header {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.ticket-detail-header h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.ticket-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.ticket-info-item {
    display: flex;
    flex-direction: column;
}

.ticket-info-item label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.ticket-info-item span {
    font-weight: 500;
    color: var(--gray-700);
}

/* Thread/Conversation */
.conversation {
    margin-bottom: 1.5rem;
}

.message {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.message.from-support {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-600);
    flex-shrink: 0;
}

.message.from-support .message-avatar {
    background: var(--primary);
    color: white;
}

.message-bubble {
    max-width: 75%;
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
}

.message.from-support .message-bubble {
    background: rgba(0, 144, 231, 0.05);
    border-color: rgba(0, 144, 231, 0.2);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.message-author {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.875rem;
}

.message-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.message-content {
    color: var(--gray-700);
    line-height: 1.6;
}

.message-content p {
    margin: 0 0 1rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.message-footer i {
    margin-right: 0.25rem;
}

/* Conversation Thread */
.conversation-thread {
    margin-top: 1.5rem;
}

.thread-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.thread-title i {
    color: var(--primary);
}

.reply-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--gray-300);
}

.reply-card.reply-support {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.02);
}

.reply-card.reply-user {
    border-left-color: var(--primary);
}

.reply-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.reply-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

.author-avatar.avatar-support {
    background: var(--success);
}

.author-avatar.avatar-user {
    background: var(--primary);
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.875rem;
}

.author-role {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.reply-time {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.reply-body {
    color: var(--gray-700);
    line-height: 1.6;
    white-space: pre-wrap;
}

.reply-attachments {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    font-size: 0.75rem;
    color: var(--gray-600);
    text-decoration: none;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.attachment-chip:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

/* Reply Form */
.reply-form {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-top: 1.5rem;
}

.reply-form h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.reply-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 144, 231, 0.1);
}

.reply-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.message-attachments {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    color: var(--gray-700);
    text-decoration: none;
}

.attachment-item:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.attachment-item i {
    color: var(--gray-500);
}

/* Internal Note */
.message.internal-note .message-bubble {
    background: #fffbeb;
    border-color: #fcd34d;
    border-style: dashed;
}

.message.internal-note::before {
    content: 'Internal Note';
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--warning);
    font-weight: 600;
}

/* ================================================================
   TABLES
   ================================================================ */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* ================================================================
   ALERTS
   ================================================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #065f46;
}

.alert-error,
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
}

.pagination a {
    color: var(--gray-600);
    background: var(--surface);
    border: 1px solid var(--gray-300);
}

.pagination a:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ================================================================
   ADMIN SIDEBAR
   ================================================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--gray-900);
    color: white;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.admin-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-sidebar-header .logo img {
    height: 32px;
}

.admin-sidebar-header .logo span {
    font-weight: 600;
    font-size: 1rem;
}

.admin-nav {
    padding: 1rem 0;
}

.admin-nav-section {
    margin-bottom: 1rem;
}

.admin-nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--gray-300);
    transition: var(--transition);
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.admin-nav a.active {
    border-left: 3px solid var(--primary);
}

.admin-nav a i {
    width: 20px;
    text-align: center;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.admin-header h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--gray-800);
}

/* ================================================================
   STATS CARDS
   ================================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon-total { background: rgba(0, 144, 231, 0.1); color: var(--primary); }
.stat-icon-open { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-icon-progress { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.stat-icon-resolved { background: rgba(16, 185, 129, 0.1); color: var(--success); }

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card-icon.primary { background: rgba(0, 144, 231, 0.1); color: var(--primary); }
.stat-card-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-card-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-card-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* ================================================================
   FILTER BAR
   ================================================================ */
.filter-bar {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group label {
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    background: var(--gray-100);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
}

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--gray-400);
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state .btn {
    margin-top: 0.5rem;
}

/* ================================================================
   TICKET CARDS GRID
   ================================================================ */
.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .tickets-grid {
        grid-template-columns: 1fr;
    }
}

.ticket-card-new {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.ticket-card-new:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.ticket-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.ticket-card-new .ticket-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    font-family: monospace;
    letter-spacing: 0.025em;
}

.ticket-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0 0 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticket-card-preview {
    font-size: 0.8125rem;
    color: var(--gray-500);
    line-height: 1.5;
    margin: 0 0 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticket-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}

.ticket-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ticket-card-meta span {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.ticket-card-meta i {
    width: 14px;
    text-align: center;
    color: var(--gray-400);
}

.ticket-card-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ticket-card-badges .reply-count {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ticket-card-status-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.ticket-card-status-bar.status-open {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.ticket-card-status-bar.status-in_progress {
    background: linear-gradient(90deg, var(--info), #60a5fa);
}

.ticket-card-status-bar.status-waiting_customer {
    background: linear-gradient(90deg, var(--warning), #fbbf24);
}

.ticket-card-status-bar.status-resolved {
    background: linear-gradient(90deg, var(--success), #34d399);
}

.ticket-card-status-bar.status-closed {
    background: linear-gradient(90deg, var(--gray-400), var(--gray-300));
}

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--gray-800);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--gray-500);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ================================================================
   ARTICLE STYLES
   ================================================================ */
.article-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    font-family: var(--font-display);
    color: var(--gray-800);
    margin: 1.5rem 0 1rem;
}

.article-content h1 { font-size: 2rem; }
.article-content h2 { font-size: 1.5rem; }
.article-content h3 { font-size: 1.25rem; }

.article-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.article-content ul,
.article-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content code {
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.875em;
}

.article-content pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1rem 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.article-content img {
    border-radius: var(--radius);
    margin: 1rem 0;
}

/* ================================================================
   SEARCH RESULTS
   ================================================================ */
.search-results {
    margin-top: 2rem;
}

.search-result-item {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.search-result-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.search-result-item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.search-result-item h3 a {
    color: var(--gray-800);
}

.search-result-item h3 a:hover {
    color: var(--primary);
}

.search-result-item p {
    color: var(--gray-600);
    font-size: 0.9375rem;
    margin: 0;
}

.search-result-meta {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2rem;
}

.login-container {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    width: 100%;
    max-width: 420px;
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
}

.login-header .logo img {
    height: 48px;
    width: 48px;
    background: #fff; border-radius: 12px; padding: 4px; box-sizing: border-box;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-header p {
    opacity: 0.9;
    font-size: 0.9375rem;
}

.login-form {
    padding: 2rem;
}

/* ================================================================
   UTILITIES
   ================================================================ */

/* Icon spacing - ensures icons have proper gap from text */
/* Only apply to elements that don't already use flexbox with gap */
.breadcrumb a i:first-child,
.ticket-meta i,
.search-result-meta i,
.article-card-meta i {
    margin-right: 0.35em;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.hidden { display: none; }
.visible { display: block; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .nav {
        order: 3;
        width: 100%;
        margin-top: 1rem;
        overflow-x: auto;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .ticket-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ticket-status-indicator {
        width: 100%;
        height: 4px;
        margin-bottom: 1rem;
    }
    
    .ticket-badges {
        margin-top: 1rem;
    }
    
    .message {
        flex-direction: column !important;
    }
    
    .message-bubble {
        max-width: 100%;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .search-box input {
        padding: 1rem 1rem 1rem 2.75rem;
        font-size: 1rem;
    }
    
    .search-box button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   MOBILE RESPONSIVE ADDITIONS
   ================================================================ */

/* ================================================================
   MOBILE NAVIGATION
   ================================================================ */

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    display: none;
}

.mobile-nav-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile Navigation Menu */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    z-index: 999;
    transition: right 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: none;
}

.mobile-nav.open {
    right: 0;
}

.mobile-nav-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.mobile-nav-user {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

.mobile-nav-user .user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.mobile-nav-user .user-info {
    flex: 1;
}

.mobile-nav-user .user-name {
    font-weight: 600;
    font-size: 1rem;
}

.mobile-nav-user .user-email {
    font-size: 0.8125rem;
    opacity: 0.8;
}

.mobile-nav-links {
    padding: 1rem 0;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 1rem;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.mobile-nav-links a i {
    width: 24px;
    text-align: center;
    font-size: 1.125rem;
}

.mobile-nav-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.mobile-nav-footer a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9375rem;
    padding: 0.75rem 0;
}

.mobile-nav-footer a:hover {
    color: white;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    color: white;
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .ticket-view-layout {
        grid-template-columns: 1fr;
    }
    
    .ticket-sidebar .card {
        position: relative;
        top: 0;
    }
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-nav {
        display: block;
    }
    
    .mobile-nav-overlay {
        display: block;
    }
    
    /* Hide desktop navigation */
    .header .nav {
        display: none !important;
    }
    
    .header .user-menu {
        display: none !important;
    }
    
    .sidebar-close-btn {
        display: block;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    /* Table to Card conversion */
    .tickets-table thead,
    .admin-table thead,
    .table thead {
        display: none;
    }
    
    .tickets-table tbody,
    .admin-table tbody,
    .table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    .tickets-table tr,
    .admin-table tr,
    .table tr {
        display: block;
        background: white;
        border: 1px solid var(--gray-200);
        border-radius: 10px;
        padding: 16px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    
    .tickets-table tr.urgent,
    .admin-table tr.urgent {
        border-left: 4px solid var(--danger);
        background: #fef2f2;
    }
    
    .tickets-table td,
    .admin-table td,
    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid var(--gray-100);
    }
    
    .tickets-table td:last-child,
    .admin-table td:last-child,
    .table td:last-child {
        border-bottom: none;
        padding-top: 12px;
    }
    
    .tickets-table td::before,
    .admin-table td::before,
    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--gray-500);
        font-size: 11px;
        text-transform: uppercase;
        flex-shrink: 0;
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hero {
        padding: 2.5rem 0;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .tickets-grid {
        grid-template-columns: 1fr;
    }
    
    .ticket-info-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-buttons {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .message {
        flex-direction: column !important;
    }
    
    .message-bubble {
        max-width: 100%;
    }
    
    .reply-form-actions {
        flex-direction: column;
    }
    
    .reply-form-actions .btn {
        width: 100%;
    }
    
    .modal {
        margin: 16px;
        max-width: calc(100% - 32px);
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box input {
        padding: 1rem 1rem 1rem 2.75rem;
        font-size: 1rem;
    }
    
    .search-box button {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 100%;
        margin-top: 10px;
        border-radius: var(--radius);
    }
    
    .form-control {
        padding: 14px;
        font-size: 16px;
    }
    
    .ticket-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ticket-status-indicator {
        width: 100%;
        height: 4px;
        margin-bottom: 12px;
    }
    
    .ticket-badges {
        margin-top: 12px;
        justify-content: flex-start;
    }
    
    .reply-card {
        padding: 1rem;
    }
    
    .reply-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .pagination a,
    .pagination span {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
    }
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Utility classes */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
}
/* No blinking cursor outside form fields */
body { caret-color: transparent; }
input, textarea, select, [contenteditable], [contenteditable] * { caret-color: auto; }

/* Customer pages: room above the page heading now the header is compact */
main.main-content { padding-top: 1.5rem; padding-bottom: 2rem; }

/* iPhones zoom in on any form box under 16px, so nothing on a phone goes smaller. Double taps don't zoom either; pinching still does. */
@media (max-width: 900px) {
    input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; }
}
html { touch-action: manipulation; }
