/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3977b2;
    --primary-dark: #1f2d54;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

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

.logo-icon {
    background: var(--primary);
    padding: 0.625rem;
    border-radius: 0.5rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 600;
}

.logo .tagline {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.phone-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.phone-link:hover {
    color: var(--primary-dark);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    gap: 0.5rem;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

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

.btn-secondary:hover {
    background: var(--gray-50);
}

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

.btn-outline:hover {
    background: var(--gray-50);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-large {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hero Section */
.hero {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: 8rem 0;
    position: relative;
}

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

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Services Section */
.services {
    padding: 5rem 0;
    background: white;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.section-header p {
    font-size: 1.125rem;
    color: var(--gray-600);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    padding: 0;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.service-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.service-icon {
    color: var(--primary);
    margin: 1.5rem 2rem 1rem;
}

.service-card h3 {
    font-size: 1.25rem;
    margin: 0 2rem 1rem;
    color: var(--gray-900);
}

.service-card p {
    color: var(--gray-600);
    line-height: 1.6;
    margin: 0 2rem 2rem;
}

/* Why Us Section */
.why-us {
    padding: 5rem 0;
    background: var(--gray-50);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.feature-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.feature-item p {
    color: var(--gray-600);
}

/* Contact Section */
.contact {
    padding: 5rem 0;
    background: white;
}

.contact-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    gap: 1rem;
}

.contact-item-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-item h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.contact-item p {
    color: var(--gray-600);
}

.contact-item a {
    color: var(--primary);
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

.contact-cta {
    background: var(--gray-50);
    padding: 2rem;
    border-radius: 0.5rem;
}

.contact-cta h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.contact-cta p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer .logo h1 {
    color: white;
}

.footer .tagline {
    color: var(--gray-300);
}

.footer-description {
    margin-top: 1rem;
    color: var(--gray-300);
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--gray-300);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: 1rem;
    text-align: center;
    color: var(--gray-300);
}

/* 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 {
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    justify-content: center;
    color: white;
}

.login-header .logo h1 {
    color: white;
}

.login-header .logo p {
    color: rgba(255, 255, 255, 0.9);
}

.login-card {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.login-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.login-subtitle {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-input,
.form-textarea,
.form-select {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.login-footer p {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.link-back {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
}

.link-back:hover {
    text-decoration: underline;
}

/* Dashboard */
.dashboard {
    min-height: 100vh;
    background: var(--gray-50);
}

.dashboard-header {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

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

.dashboard-main {
    padding: 2rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue {
    background: #dbeafe;
    color: var(--primary);
}

.stat-icon.green {
    background: #d1fae5;
    color: var(--success);
}

.stat-icon.orange {
    background: #fed7aa;
    color: var(--warning);
}

.stat-icon.gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

.stat-number {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

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

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

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.card-body {
    padding: 1.5rem;
}

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

.ticket-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: box-shadow 0.2s;
    cursor: pointer;
}

.ticket-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.ticket-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

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

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-new {
    background: var(--primary);
    color: white;
}

.badge-in-progress {
    background: #dbeafe;
    color: #1e40af;
}

.badge-waiting {
    background: var(--gray-100);
    color: var(--gray-700);
}

.badge-closed {
    background: var(--gray-100);
    color: var(--gray-700);
}

.badge-low {
    background: var(--gray-100);
    color: var(--gray-700);
}

.badge-medium {
    background: #dbeafe;
    color: #1e40af;
}

.badge-high {
    background: #fed7aa;
    color: #9a3412;
}

.ticket-meta {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
}

.empty-state svg {
    margin: 0 auto 1rem;
    color: var(--gray-300);
}

.empty-state p {
    color: var(--gray-500);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination button {
    min-width: 40px;
    height: 40px;
}

.pagination .ellipsis {
    padding: 0 0.5rem;
    color: var(--gray-500);
}

/* Modal */
.modal {
    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: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-subtitle {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.modal-body {
    padding: 1.5rem;
}

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

/* Chat */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 400px;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.chat-message.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message.received {
    align-self: flex-start;
    align-items: flex-start;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    margin-bottom: 0.25rem;
}

.chat-message.sent .message-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.chat-message.received .message-bubble {
    background: var(--gray-100);
    color: var(--gray-900);
    border-bottom-left-radius: 0.25rem;
}

.message-sender {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

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

.chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
    background: white;
}

.chat-input input {
    flex: 1;
}

/* Tabs */
.tabs {
    margin-bottom: 1.5rem;
}

.tabs-list {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.tab-trigger {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-600);
    transition: color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: -2px;
}

.tab-trigger:hover {
    color: var(--gray-900);
}

.tab-trigger.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

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

th {
    text-align: left;
    padding: 0.75rem;
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-200);
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

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

/* Responsive */
@media (max-width: 768px) {
    .header-actions .phone-link {
        display: none;
    }
    
    .hero {
        padding: 4rem 0;
        background-attachment: scroll;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .services-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    /* Featured services responsive */
    .services .container > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .services .container > div[style*="grid-template-columns"] > div {
        order: 0 !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .dashboard-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .dashboard-header-content > div:last-child {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .dashboard-header-content > div:last-child .btn {
        width: 100%;
        justify-content: center;
    }

    #userName {
        margin-right: 0 !important;
    }
}

/* Utilities */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.flex { display: flex; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }