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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f3f4f6;
    background-image:
        radial-gradient(at 40% 20%, hsla(250, 100%, 94%, 1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(189, 100%, 96%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(341, 100%, 96%, 1) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    color: #1e293b;
}

#app {
    width: 100%;
    overflow-x: hidden;
}

/* Login Page */
body:has(.login-wrapper) {
    background: #0f172a;
    margin: 0;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.login-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    animation: float-shape 20s infinite alternate ease-in-out;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation-delay: -5s;
}

.shape-3 {
    top: 40%;
    left: 40%;
    width: 30vw;
    height: 30vw;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation-delay: -10s;
    opacity: 0.4;
}

@keyframes float-shape {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(50px, 50px) rotate(20deg);
    }
}

.login-container {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slide-up 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.brand-logo {
    width: 64px;
    height: 64px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-header h1 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header .subtitle {
    color: #94a3b8;
    font-size: 15px;
    line-height: 1.5;
}

.input-group {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    color: #94a3b8;
    transition: color 0.3s ease;
}

.input-wrapper input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 16px 16px 48px;
    color: #ffffff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    background: rgba(15, 23, 42, 0.8);
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.input-wrapper input:focus+.input-icon,
.input-wrapper input:focus~.input-icon {
    color: #6366f1;
}

.input-wrapper input::placeholder {
    color: #64748b;
}

.toggle-password {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #ffffff;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    font-size: 14px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #94a3b8;
    user-select: none;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #475569;
    border-radius: 5px;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-container input:checked~.checkmark {
    background: #6366f1;
    border-color: #6366f1;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container:hover .label-text {
    color: #cbd5e1;
}

.forgot-password {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #818cf8;
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn-login:hover .btn-arrow {
    transform: translateX(4px);
}

.error-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shake 0.5s ease-in-out;
}

.error-banner::before {
    content: '⚠';
    font-size: 16px;
}

/* Dashboard Layout - Sidebar Style */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: transparent;
    position: relative;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(2px);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    pointer-events: none;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Sidebar */
.sidebar {
    width: 234px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    height: 100dvh;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

.sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.logo-container:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5px;
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.0;
}

.logo-tagline {
    font-size: 10px;
    font-style: italic;
    color: #94a3b8;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    /* Allow flex item to shrink */
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #64748b;
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.8);
    color: #4f46e5;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.nav-item.active {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.35);
    border: none;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 2.5;
}

.nav-label {
    flex: 1;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    background: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    margin-top: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.user-avatar-sidebar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.user-info-sidebar {
    flex: 1;
    min-width: 0;
}

.user-name-sidebar {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email-sidebar {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn-sidebar {
    width: 100%;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.logout-btn-sidebar:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
    transform: translateY(-1px);
}

.logout-icon {
    width: 18px;
    height: 18px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 234px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    min-height: 72px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #64748b;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-menu-toggle:hover {
    background: #f1f5f9;
    color: #334155;
}

.mobile-menu-toggle:active {
    background: #e2e8f0;
    transform: scale(0.95);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
    pointer-events: none;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.content-area {
    flex: 1;
    padding: 24px;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    overflow-x: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.btn-icon-svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.stat-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.stat-primary .stat-icon-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-warning .stat-icon-wrapper {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.stat-success .stat-icon-wrapper {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.stat-info .stat-icon-wrapper {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 3px;
}

.stat-change {
    font-size: 12px;
    color: #64748b;
}

.stat-change.positive {
    color: #10b981;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.dashboard-card {
    /* Merged into common card style above, removing duplicate/specific rule */
    padding: 24px;
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.view-all-link {
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.view-all-link:hover {
    color: #764ba2;
}

/* Tickets Page Styles */
.tickets-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tickets-card,
.users-card,
.settings-card,
.dashboard-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.6);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.tickets-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.tickets-count {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.tickets-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.tickets-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    table-layout: fixed;
}

.tickets-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.tickets-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 10;
}

.tickets-table th.col-id {
    width: 5%;
    text-align: center;
}

.tickets-table th.col-ticket {
    width: 24%;
    text-align: left;
}

.tickets-table th.col-created-by {
    width: 9%;
    text-align: center;
}

.tickets-table th.col-project {
    width: 9%;
    text-align: center;
}

.tickets-table th.col-assigned {
    width: 9%;
    text-align: center;
}

.tickets-table th.col-priority {
    width: 8%;
    text-align: center;
}

.tickets-table th.col-status {
    width: 9%;
    text-align: center;
}

.tickets-table th.col-created {
    width: 10%;
    text-align: center;
}

.tickets-table th.col-updated {
    width: 10%;
    text-align: center;
}

.tickets-table th.col-actions {
    width: 7%;
    text-align: center;
}

.tickets-table tbody tr.ticket-row {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tickets-table tbody tr.ticket-row:hover {
    background: rgba(248, 250, 252, 0.8);
    transform: scale(1.002);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.tickets-table tbody tr.ticket-row:last-child {
    border-bottom: none;
}

.tickets-table td {
    padding: 10px 8px;
    vertical-align: top;
    font-size: 13px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tickets-table td.col-id {
    vertical-align: middle;
    text-align: center;
}

.tickets-table td.col-ticket {
    text-align: left;
    min-width: 0;
}

.tickets-table td.col-created-by {
    text-align: center;
    vertical-align: middle;
}

.tickets-table td.col-project {
    text-align: center;
    vertical-align: middle;
}

.tickets-table td.col-assigned {
    text-align: center;
    vertical-align: middle;
}

.tickets-table td.col-priority {
    text-align: center;
    vertical-align: middle;
}

.tickets-table td.col-status {
    text-align: center;
    vertical-align: middle;
}

.tickets-table td.col-created {
    text-align: center;
    vertical-align: middle;
}

.tickets-table td.col-updated {
    text-align: center;
    vertical-align: middle;
}

.tickets-table td.col-actions {
    text-align: center;
    vertical-align: middle;
}

.ticket-id-badge {
    font-size: 11px;
    font-weight: 700;
    color: #667eea;
    background: #eef2ff;
    padding: 3px 8px;
    border-radius: 5px;
    display: inline-block;
    letter-spacing: 0.2px;
}

.ticket-info-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ticket-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-description-preview {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.ticket-created-by-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
    color: #1e293b;
    font-weight: 500;
}

.ticket-project-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
}

.ticket-project {
    color: #667eea;
    font-weight: 500;
}

.ticket-assigned-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
}

.ticket-assigned {
    color: #059669;
    font-weight: 500;
}

.ticket-unassigned {
    color: #f59e0b;
    font-weight: 500;
    font-size: 12px;
}

.ticket-date-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.date-value {
    font-size: 11px;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
}

.date-updated {
    font-size: 10px;
    color: #94a3b8;
}

.ticket-meta-icon {
    width: 12px;
    height: 12px;
    color: #94a3b8;
    flex-shrink: 0;
}

/* Admin Settings Styles */
.admin-settings-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.company-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s ease;
}

.company-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.company-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.company-info {
    flex: 1;
}

.company-name {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.company-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.company-domain {
    font-size: 14px;
    color: #64748b;
}

.company-status {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 12px;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.company-stats {
    display: flex;
    gap: 24px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.company-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #475569;
}

.detail-item svg {
    color: #64748b;
    flex-shrink: 0;
}

.company-projects {
    margin-top: 20px;
}

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

.projects-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.project-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}

.project-description {
    font-size: 12px;
    color: #64748b;
}

.project-status {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 10px;
}

.empty-projects {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

/* Mobile Responsive - Admin Settings */
@media (max-width: 767.98px) {
    .company-header {
        flex-direction: column;
        gap: 16px;
    }

    .company-stats {
        width: 100%;
        justify-content: flex-start;
    }

    .company-details {
        padding: 12px;
    }

    .projects-header {
        flex-wrap: wrap;
        gap: 8px;
    }
}

.ticket-unassigned {
    color: #f59e0b;
    font-weight: 500;
}

.ticket-priority,
.ticket-status {
    display: flex;
    align-items: center;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.priority-urgent {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid rgba(153, 27, 27, 0.2);
}

.priority-high {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    color: #9a3412;
    border: 1px solid rgba(154, 52, 18, 0.2);
}

.priority-medium {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid rgba(146, 64, 14, 0.2);
}

.priority-low {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid rgba(6, 95, 70, 0.2);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.status-open {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid rgba(30, 64, 175, 0.2);
}

.status-in-progress {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid rgba(146, 64, 14, 0.2);
}

.status-resolved {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid rgba(6, 95, 70, 0.2);
}

.status-closed {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid rgba(71, 85, 105, 0.2);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.ticket-date {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-value {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.ticket-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tickets-table {
    width: 100%;
}

.table-header {
    display: grid;
    grid-template-columns: 70px 2fr 100px 100px 130px;
    gap: 12px;
    padding: 10px 0;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #e2e8f0;
}

.table-body {
    min-height: 200px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
}

.coming-soon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 48px 20px;
}

.coming-soon-content {
    text-align: center;
    max-width: 500px;
}

.coming-soon-icon {
    width: 80px;
    height: 80px;
    color: #cbd5e1;
    margin: 0 auto 24px;
    display: block;
}

.coming-soon-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.coming-soon-content p {
    font-size: 16px;
    color: #64748b;
    line-height: 1.6;
}

.empty-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    opacity: 0.3;
    color: #64748b;
    stroke-width: 1.5;
}

.empty-text {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}

.empty-subtext {
    font-size: 13px;
    color: #64748b;
}

/* Loading Spinner */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 15px;
    font-weight: 500;
    color: #64748b;
}

/* Users Page Styles */
.users-filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.search-box {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #94a3b8;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    background: #f8fafc;
    color: #1e293b;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-weight: 400;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box input::placeholder {
    color: #94a3b8;
}

.filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 12px 36px 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    background-color: #f8fafc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    flex: 1;
    min-width: 0;
    font-weight: 400;
    appearance: none;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-select:hover {
    background-color: white;
    border-color: #cbd5e1;
}

.users-card {
    /* Merged into common card style above */
    padding: 24px;
}

.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.users-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.users-count {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.user-row:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    display: flex;
    align-items: center;
}

.role-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.role-user {
    background: #f1f5f9;
    color: #475569;
}

.role-agent {
    background: #dbeafe;
    color: #1e40af;
}

.role-supervisor {
    background: #fef3c7;
    color: #92400e;
}

.role-admin {
    background: #fce7f3;
    color: #9f1239;
}

.role-developer {
    background: #e0e7ff;
    color: #3730a3;
}

.user-status {
    display: flex;
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-active .status-dot {
    background: #10b981;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.status-inactive .status-dot {
    background: #ef4444;
}

.user-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
}

.btn-icon:hover {
    background: #e2e8f0;
    color: #334155;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.btn-icon-danger {
    background: #fef2f2;
    color: #dc2626;
}

.btn-icon-danger:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* Modal Styles */
.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: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-content form {
    padding: 24px;
}

.modal-content .form-group {
    margin-bottom: 20px;
}

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

.modal-content .form-group input,
.modal-content .form-group select,
.modal-content .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    color: #2d3748;
    box-sizing: border-box;
}

.modal-content .form-group input:focus,
.modal-content .form-group select:focus,
.modal-content .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.modal-content .form-group:focus-within label {
    color: #667eea;
}

/* Custom Select Dropdown */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    position: relative;
    width: 100%;
    cursor: pointer;
}

.custom-select-trigger {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    color: #2d3748;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    min-height: 48px;
}

.custom-select-trigger span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-trigger svg {
    flex-shrink: 0;
    margin-left: 8px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.custom-select.active .custom-select-trigger {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.custom-select.active .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-select:focus {
    outline: none;
}

.custom-select:focus .custom-select-trigger {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.custom-select.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.custom-select.active .custom-select-options {
    display: block;
}

.custom-select-option {
    padding: 12px 14px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-size: 16px;
    color: #2d3748;
}

.custom-select-option:hover {
    background-color: #f7fafc;
}

.custom-select-option.selected {
    background-color: #eef2ff;
    color: #667eea;
    font-weight: 500;
}

.custom-select-option[data-value=""] {
    color: #94a3b8;
    font-style: italic;
}

.custom-select-option .project-company {
    font-size: 13px;
    color: #64748b;
    font-style: italic;
    margin-left: 4px;
}

/* Scrollbar styling for custom select */
.custom-select-options::-webkit-scrollbar {
    width: 8px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Markdown Content Styles (for comments and descriptions) */
.timeline-comment-content code,
div[style*="white-space: pre-wrap"] code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    color: #dc2626;
    white-space: pre-wrap;
}

.timeline-comment-content a,
div[style*="white-space: pre-wrap"] a {
    color: #3b82f6;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.timeline-comment-content a:hover,
div[style*="white-space: pre-wrap"] a:hover {
    color: #2563eb;
}

.timeline-comment-content strong,
div[style*="white-space: pre-wrap"] strong {
    font-weight: 600;
    color: #1e293b;
}

.timeline-comment-content em,
div[style*="white-space: pre-wrap"] em {
    font-style: italic;
    color: #475569;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.btn-secondary {
    padding: 12px 20px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #334155;
}

/* Mobile Responsive - Modal */
@media (max-width: 575.98px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer button {
        width: 100%;
        min-height: 44px;
        padding: 12px 16px;
    }
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.action-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.action-btn:hover {
    background: #f1f5f9;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.action-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
    color: #667eea;
}

.action-text {
    font-size: 12px;
    font-weight: 500;
    color: #334155;
}

.activity-feed {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
    transition: background 0.2s ease;
}

.activity-item:hover {
    background: #f1f5f9;
}

.activity-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    color: #667eea;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

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

.activity-text {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
    margin-bottom: 6px;
}

.activity-text strong {
    font-weight: 600;
    color: #0f172a;
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #64748b;
    flex-wrap: wrap;
}

.activity-feed .empty-state {
    padding: 40px 20px;
    text-align: center;
    background: transparent;
}

.activity-feed .empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: #cbd5e1;
}

.activity-feed .empty-text {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 4px;
}

.activity-feed .empty-subtext {
    font-size: 12px;
    color: #94a3b8;
}

/* Dashboard Recent Tickets Table - Simplified */
.dashboard-card .tickets-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -24px;
    /* Negative margin to span full width */
    padding: 0 24px;
    /* Padding to align content */
}

.dashboard-card .tickets-table {
    min-width: 600px;
    /* Ensure minimum width for grid */
}

.dashboard-card .table-header {
    display: grid;
    grid-template-columns: 60px 1fr 100px 100px 100px;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-card .table-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dashboard-card .table-row {
    display: grid;
    grid-template-columns: 60px 1fr 100px 100px 100px;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    transition: background 0.2s ease;
    cursor: pointer;
}

.dashboard-card .table-row:hover {
    background: #f8fafc;
    border-radius: 6px;
    padding-left: 8px;
    padding-right: 8px;
}

.dashboard-card .table-row:last-child {
    border-bottom: none;
}

.dashboard-card .table-col-id {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
}

.dashboard-card .table-col-subject {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-card .table-col-status,
.dashboard-card .table-col-priority {
    display: flex;
    align-items: center;
}

.dashboard-card .table-col-date {
    font-size: 11px;
    color: #64748b;
}

/* Responsive - Mobile First Approach */
/* Base styles are mobile-friendly, these enhance for larger screens */

/* Small devices (phones, 576px and up) */
@media (max-width: 575.98px) {
    body:has(.login-container) {
        padding: 0 !important;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .login-container {
        margin: 15px !important;
        padding: 35px 25px !important;
        position: relative !important;
        transform: none !important;
        width: calc(100vw - 30px) !important;
        max-width: none !important;
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .login-container h1 {
        font-size: 24px;
        margin-bottom: 6px;
    }

    .login-container .subtitle {
        font-size: 13px;
        margin-bottom: 25px;
    }

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

    .form-group label {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .form-group input {
        padding: 14px 16px;
        /* Larger touch target */
        font-size: 16px;
        /* Prevents zoom on iOS */
        border-radius: 8px;
    }

    button[type="submit"],
    #login-btn {
        padding: 14px;
        /* Larger touch target */
        font-size: 16px;
        min-height: 48px;
        /* Minimum touch target size */
        border-radius: 8px;
        margin-top: 4px;
    }

    /* Dashboard Mobile Styles - Sidebar Layout */
    .app-layout {
        position: relative;
        overflow-x: hidden;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar {
        width: 280px;
        max-width: 85vw;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        will-change: transform;
        visibility: hidden;
        pointer-events: none;
        height: 100vh;
        height: 100dvh;
        /* Use dynamic viewport height for mobile */
        overflow: hidden;
        /* Prevent scrolling on sidebar itself */
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        min-width: 0;
        overflow-x: hidden;
        position: relative;
        z-index: 1;
    }

    /* Ensure main content is interactive when sidebar is closed */
    .main-content:not(.sidebar-open) {
        pointer-events: auto;
    }

    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        z-index: 1001;
        position: relative;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        touch-action: manipulation;
        user-select: none;
        -webkit-user-select: none;
        cursor: pointer;
    }

    .mobile-menu-toggle:active {
        background: #e2e8f0;
        transform: scale(0.95);
    }

    .mobile-menu-toggle svg {
        pointer-events: none;
    }

    .top-header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 100;
        background: #ffffff;
    }

    .header-left {
        gap: 12px;
    }

    .page-title {
        font-size: 18px;
        font-weight: 700;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-right {
        flex-shrink: 0;
        margin-left: 8px;
    }

    .btn-primary {
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
        min-height: 44px;
        flex-shrink: 0;
    }

    .btn-primary .btn-icon-svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    /* Compact button on very small screens */
    @media (max-width: 360px) {
        .btn-primary {
            padding: 10px 12px;
            font-size: 12px;
        }
    }

    .content-area {
        padding: 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Prevent horizontal scroll */
    .main-content {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }

    .dashboard-card {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }

    .tickets-card {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Tickets Page Mobile Styles */
    .tickets-filters {
        flex-direction: column;
        gap: 12px;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 12px 16px 12px 48px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        width: 100%;
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 12px 14px;
        min-width: 0;
    }

    .tickets-card {
        border-radius: 12px;
        overflow: visible;
    }

    .tickets-header {
        padding: 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .tickets-header h3 {
        font-size: 18px;
    }

    .tickets-count {
        font-size: 13px;
    }

    .tickets-table-wrapper {
        overflow-x: visible;
        -webkit-overflow-scrolling: touch;
        padding: 0;
    }

    .tickets-table {
        min-width: 0;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    .tickets-table thead {
        display: none;
    }

    .tickets-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 0;
    }

    .tickets-table tbody tr.ticket-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        margin-bottom: 0;
        padding: 14px;
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
        border-left: 3px solid;
        border-image: linear-gradient(180deg, #667eea 0%, #764ba2 100%) 1;
    }

    .tickets-table tbody tr.ticket-row:active {
        transform: translateY(1px);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    }

    /* Header: ID badge on left, badges on right */
    .tickets-table tbody tr.ticket-row>td.col-id {
        order: 1;
        padding: 0;
        margin: 0;
        margin-bottom: 8px;
        border: none;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        width: 100%;
    }

    .tickets-table tbody tr.ticket-row>td.col-id:before {
        display: none;
    }

    .ticket-id-badge {
        font-size: 11px;
        font-weight: 700;
        color: #667eea;
        background: rgba(102, 126, 234, 0.1);
        padding: 4px 10px;
        border-radius: 6px;
        display: inline-block;
        letter-spacing: 0.3px;
        border: none;
        align-self: flex-start;
    }

    /* Badges container - top right of card */
    .tickets-table tbody tr.ticket-row>td.col-priority,
    .tickets-table tbody tr.ticket-row>td.col-status {
        order: 1;
        position: absolute;
        top: 14px;
        padding: 0;
        margin: 0;
        border: none;
        width: auto;
        display: inline-flex;
        align-items: center;
        z-index: 1;
    }

    .tickets-table tbody tr.ticket-row>td.col-status {
        right: 90px;
    }

    .tickets-table tbody tr.ticket-row>td.col-priority {
        right: 14px;
    }

    .tickets-table tbody tr.ticket-row>td.col-priority:before,
    .tickets-table tbody tr.ticket-row>td.col-status:before {
        display: none;
    }

    /* Title and Description */
    .tickets-table tbody tr.ticket-row>td.col-ticket {
        order: 2;
        padding: 0;
        margin: 0;
        border: none;
        display: block;
        width: 100%;
    }

    .tickets-table tbody tr.ticket-row>td.col-ticket:before {
        display: none;
    }

    .ticket-info-cell {
        gap: 6px;
        display: flex;
        flex-direction: column;
    }

    .ticket-title {
        font-size: 15px;
        font-weight: 600;
        line-height: 1.4;
        margin: 0;
        color: #0f172a;
        letter-spacing: -0.2px;
    }

    .ticket-description-preview {
        font-size: 13px;
        line-height: 1.5;
        color: #64748b;
        margin-top: 2px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Modern badge styling */
    .priority-badge,
    .status-badge {
        font-size: 11px;
        font-weight: 600;
        padding: 6px 12px;
        border-radius: 8px;
        letter-spacing: 0.2px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        border: none;
        display: inline-block;
        white-space: nowrap;
    }

    /* Metadata section - Compact grid layout */
    .tickets-table tbody tr.ticket-row>td.col-created-by,
    .tickets-table tbody tr.ticket-row>td.col-project,
    .tickets-table tbody tr.ticket-row>td.col-assigned {
        order: 3;
        display: flex;
        align-items: center;
        width: 100%;
        padding: 6px 0;
        border: none;
    }

    .tickets-table tbody tr.ticket-row>td.col-created-by {
        padding-top: 8px;
        border-top: 1px solid #f1f5f9;
    }

    .tickets-table tbody tr.ticket-row>td.col-created-by:before {
        content: "CREATED BY";
        font-weight: 600;
        font-size: 9px;
        color: #94a3b8;
        margin-right: 10px;
        flex-shrink: 0;
        min-width: 65px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .tickets-table tbody tr.ticket-row>td.col-project:before {
        content: "PROJECT";
        font-weight: 600;
        font-size: 9px;
        color: #94a3b8;
        margin-right: 10px;
        flex-shrink: 0;
        min-width: 65px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .tickets-table tbody tr.ticket-row>td.col-assigned:before {
        content: "ASSIGNED";
        font-weight: 600;
        font-size: 9px;
        color: #94a3b8;
        margin-right: 10px;
        flex-shrink: 0;
        min-width: 65px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .ticket-created-by-cell,
    .ticket-project-cell,
    .ticket-assigned-cell {
        font-size: 13px;
        font-weight: 500;
        flex: 1;
        min-width: 0;
        color: #1e293b;
        display: flex;
        align-items: center;
    }

    .ticket-meta-icon {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
        margin-right: 6px;
        color: #94a3b8;
    }

    /* Dates section - Compact inline layout */
    .tickets-table tbody tr.ticket-row>td.col-created,
    .tickets-table tbody tr.ticket-row>td.col-updated {
        order: 4;
        display: inline-flex;
        align-items: center;
        padding: 0;
        margin-right: 16px;
        border: none;
        font-size: 11px;
        width: auto;
    }

    .tickets-table tbody tr.ticket-row>td.col-created {
        padding-top: 6px;
        border-top: 1px solid #f1f5f9;
        margin-top: 4px;
    }

    .tickets-table tbody tr.ticket-row>td.col-created:before {
        content: "CREATED";
        font-weight: 600;
        font-size: 9px;
        color: #94a3b8;
        margin-right: 6px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .tickets-table tbody tr.ticket-row>td.col-updated:before {
        content: "UPDATED";
        font-weight: 600;
        font-size: 9px;
        color: #94a3b8;
        margin-right: 6px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .date-value {
        font-size: 11px;
        font-weight: 500;
        color: #475569;
        white-space: nowrap;
    }

    /* Actions section - compact styling */
    .tickets-table tbody tr.ticket-row>td.col-actions {
        order: 5;
        display: flex;
        padding: 8px 0 0 0;
        margin-top: 6px;
        border-top: 1px solid #f1f5f9;
        border: none;
        width: 100%;
        justify-content: flex-end;
    }

    .tickets-table tbody tr.ticket-row>td.col-actions:before {
        display: none;
    }

    .ticket-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
        width: auto;
        margin-left: auto;
    }

    .ticket-actions .btn-icon {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        flex: 0 0 auto;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        transition: all 0.2s ease;
    }

    .ticket-actions .btn-icon:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .ticket-actions .btn-icon:active {
        transform: translateY(0);
    }

    .ticket-actions .btn-icon svg {
        width: 18px;
        height: 18px;
        stroke-width: 2;
    }

    /* Modern badge styling */
    .priority-badge,
    .status-badge {
        font-size: 11px;
        font-weight: 600;
        padding: 5px 10px;
        border-radius: 6px;
        letter-spacing: 0.2px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .ticket-id-badge {
        font-size: 11px;
        font-weight: 700;
        padding: 4px 10px;
        border-radius: 6px;
        letter-spacing: 0.3px;
    }

    /* Empty state mobile */
    .empty-state {
        padding: 40px 20px;
    }

    /* Hide horizontal scroll on mobile */
    .tickets-table-wrapper::-webkit-scrollbar {
        display: none;
    }

    .tickets-table-wrapper {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    /* Mobile-specific card improvements */
    .dashboard-card {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    /* Better spacing for mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }

    .stat-card {
        padding: 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .stat-icon-wrapper {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .stat-icon {
        width: 20px;
        height: 20px;
    }

    .stat-label {
        font-size: 11px;
        margin-bottom: 4px;
        word-break: break-word;
    }

    .stat-value {
        font-size: 20px;
        margin-bottom: 2px;
    }

    .stat-change {
        font-size: 10px;
        word-break: break-word;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 16px;
    }

    /* Touch-friendly nav items */
    .nav-item {
        min-height: 48px;
    }

    .dashboard-card {
        padding: 16px;
        border-radius: 12px;
    }

    .card-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .card-header h3 {
        font-size: 16px;
    }

    .view-all-link {
        font-size: 13px;
    }

    /* Dashboard table - keep header visible on mobile */
    .dashboard-card .table-header {
        display: none;
    }

    .dashboard-card .tickets-table {
        min-width: 0;
        /* Reset min-width on mobile */
    }

    .dashboard-card .tickets-table-wrapper {
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    /* Modern Card Design for Recent Tickets */
    .dashboard-card .table-row {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 18px 20px;
        border: none;
        border-radius: 16px;
        margin-bottom: 16px;
        background: #ffffff;
        box-shadow:
            0 2px 8px rgba(0, 0, 0, 0.04),
            0 1px 2px rgba(0, 0, 0, 0.06);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
        position: relative;
        border-left: 4px solid;
        border-image: linear-gradient(180deg, #667eea 0%, #764ba2 100%) 1;
    }

    .dashboard-card .table-row:active {
        transform: translateY(1px);
        box-shadow:
            0 1px 4px rgba(0, 0, 0, 0.04),
            0 1px 2px rgba(0, 0, 0, 0.06);
    }

    .dashboard-card .table-row:last-child {
        margin-bottom: 0;
    }

    /* ID - Top right badge */
    .dashboard-card .table-col-id {
        order: 1;
        font-size: 11px;
        font-weight: 700;
        color: #667eea;
        background: rgba(102, 126, 234, 0.1);
        padding: 5px 11px;
        border-radius: 6px;
        width: fit-content;
        letter-spacing: 0.3px;
        align-self: flex-end;
        margin-bottom: -8px;
    }

    .dashboard-card .table-col-id::before {
        content: "#";
        opacity: 0.7;
    }

    /* Subject - Main title */
    .dashboard-card .table-col-subject {
        order: 2;
        font-size: 16px;
        font-weight: 600;
        color: #0f172a;
        line-height: 1.5;
        margin: 0;
        word-break: break-word;
        white-space: normal;
        letter-spacing: -0.2px;
    }

    .dashboard-card .table-col-subject::before {
        display: none;
    }

    /* Status and Priority - Inline badges */
    .dashboard-card .table-col-status,
    .dashboard-card .table-col-priority {
        order: 3;
        display: inline-flex;
        align-items: center;
        margin-right: 8px;
    }

    .dashboard-card .table-col-status::before,
    .dashboard-card .table-col-priority::before {
        display: none;
    }

    /* Created date - Bottom right */
    .dashboard-card .table-col-date {
        order: 4;
        font-size: 13px;
        color: #64748b;
        font-weight: 500;
        margin-top: 4px;
        align-self: flex-end;
    }

    .dashboard-card .table-col-date::before {
        display: none;
    }

    /* Enhance badge styles for mobile */
    .dashboard-card .table-row .priority-badge,
    .dashboard-card .table-row .status-badge {
        font-size: 11px;
        padding: 5px 10px;
        border-radius: 6px;
        font-weight: 600;
    }

    .table-body {
        min-height: 150px;
    }

    .empty-state {
        padding: 40px 20px;
    }

    .empty-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 12px;
    }

    .empty-text {
        font-size: 15px;
        margin-bottom: 6px;
    }

    .empty-subtext {
        font-size: 13px;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .action-btn {
        padding: 16px 12px;
        min-height: 80px;
        border-radius: 10px;
        flex-direction: column;
        gap: 10px;
    }

    .action-icon {
        width: 28px;
        height: 28px;
    }

    .action-text {
        font-size: 12px;
        font-weight: 600;
    }

    .sidebar-header {
        padding: 20px 16px;
    }

    .logo-container {
        gap: 2;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        object-fit: contain;
    }

    .logo-text {
        font-size: 28px;
    }

    .logo-text-wrapper {
        gap: 0.5px;
    }

    .logo-tagline {
        font-size: 9px;
    }

    .sidebar-nav {
        padding: 12px 8px;
    }

    .nav-item {
        padding: 14px 12px;
        font-size: 14px;
        margin-bottom: 4px;
        border-radius: 10px;
    }

    .nav-icon {
        width: 22px;
        height: 22px;
    }

    .sidebar-footer {
        padding: 16px;
        flex-shrink: 0;
        margin-top: auto;
        display: flex;
        flex-direction: column;
    }

    .user-profile {
        gap: 10px;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .user-avatar-sidebar {
        width: 44px;
        height: 44px;
        font-size: 15px;
    }

    .user-name-sidebar {
        font-size: 14px;
    }

    .user-email-sidebar {
        font-size: 11px;
    }

    .logout-btn-sidebar {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        visibility: visible;
        opacity: 1;
    }

    .logout-icon {
        width: 18px;
        height: 18px;
    }

    /* Users Page Mobile Styles */
    .users-filters {
        gap: 12px;
    }

    .filter-group {
        flex-direction: column;
        gap: 10px;
    }

    .filter-select {
        width: 100%;
        min-width: 0;
    }

    .users-card {
        padding: 16px;
    }

    .users-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .user-row {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px;
    }

    .user-info {
        width: 100%;
    }

    .user-role,
    .user-company,
    .user-status {
        justify-content: flex-start;
    }

    .user-actions {
        justify-content: flex-end;
        width: 100%;
        padding-top: 8px;
        border-top: 1px solid #e2e8f0;
    }

    .error {
        padding: 12px 14px;
        font-size: 13px;
        margin-bottom: 20px;
    }

    /* Disable animation on mobile for better performance */
    .login-container {
        animation: none;
    }
}

/* Medium devices (tablets, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .login-container {
        margin: 20px;
        padding: 45px 35px;
        max-width: 100%;
    }

    .sidebar {
        width: 0;
        transform: translateX(-100%);
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
        height: 100vh;
        height: 100dvh;
        /* Use dynamic viewport height for mobile */
        overflow: hidden;
        /* Prevent scrolling on sidebar itself */
    }

    .sidebar.mobile-open {
        width: 234px;
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

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

    .top-header {
        padding: 16px 24px;
    }

    .content-area {
        padding: 24px 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .table-header {
        display: grid;
        grid-template-columns: 70px 2fr 100px 100px 130px;
    }

    .table-col-priority,
    .table-col-date {
        display: block;
    }
}

/* Large devices (desktops, 768px and up) */
@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }

    .sidebar {
        width: 234px;
        transform: translateX(0);
    }

    .main-content {
        margin-left: 234px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 2fr 1fr;
    }

    .table-header {
        display: grid;
        grid-template-columns: 70px 2fr 100px 100px 130px;
    }

    .table-col-priority,
    .table-col-date {
        display: block;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 992px) {
    .login-container {
        padding: 50px 40px;
    }

    .container {
        padding: 0 40px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets for touch devices */
    button,
    .logout-btn,
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    button:hover:not(:disabled),
    .logout-btn:hover {
        transform: none;
    }

    /* Better spacing for touch */
    .form-group {
        margin-bottom: 24px;
    }
}

/* Landscape mobile orientation */
@media (max-width: 767.98px) and (orientation: landscape) {
    body:has(.login-container) {
        padding: 15px;
    }

    .login-container {
        padding: 25px 30px;
        max-width: 450px;
        margin: 0 auto;
    }

    .login-container h1 {
        font-size: 22px;
        margin-bottom: 4px;
    }

    .login-container .subtitle {
        font-size: 12px;
        margin-bottom: 20px;
    }

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

    .form-group input {
        padding: 12px 16px;
    }

    button[type="submit"],
    #login-btn {
        padding: 12px;
        min-height: 44px;
    }
}

/* Settings Page Styles */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-section-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 4px;
}

.settings-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.3px;
}

.settings-section-description {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.settings-card {
    /* Merged into common card style above */
    padding: 32px;
}

.settings-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-form .form-group {
    margin-bottom: 0;
}

.settings-form .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.settings-form .form-group:focus-within label {
    color: #667eea;
}

.settings-form .form-group input,
.settings-form .form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    color: #2d3748;
    box-sizing: border-box;
    font-family: inherit;
}

.settings-form .form-group input:focus,
.settings-form .form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.settings-form .form-group input:hover:not(:focus),
.settings-form .form-group select:hover:not(:focus) {
    border-color: #cbd5e1;
}

.settings-form .form-group small {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    line-height: 1.4;
}

.settings-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.form-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 8px;
    line-height: 1.5;
}

.form-message-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.form-message-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s ease;
}

.info-row:hover {
    background: #f8fafc;
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
    border-radius: 8px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
}

.info-value {
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
    text-align: right;
}

.settings-form .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-weight: 400;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
    margin: -12px;
    padding-left: 12px;
    padding-right: 12px;
}

.settings-form .checkbox-label:hover {
    background: #f8fafc;
}

.settings-form .checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.settings-form .checkbox-label>span:not(small) {
    flex: 1;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

/* Mobile Settings Styles */
@media (max-width: 767.98px) {
    .settings-content {
        gap: 20px;
    }

    .settings-card {
        padding: 20px;
        border-radius: 10px;
    }

    .settings-section-title {
        font-size: 18px;
    }

    .settings-section-description {
        font-size: 13px;
    }

    .settings-form .form-group input,
    .settings-form .form-group select {
        padding: 12px 14px;
        font-size: 16px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-primary {
        width: 100%;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 16px 0;
    }

    .info-row:hover {
        margin: 0 -20px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .info-value {
        text-align: left;
        width: 100%;
    }
}

/* Small Mobile Settings Styles - Reduce spacing */
@media (max-width: 575.98px) {
    .content-area {
        padding: 16px;
    }

    .settings-content {
        gap: 16px;
    }

    .settings-section {
        gap: 12px;
    }

    .settings-section-header {
        gap: 2px;
        margin-bottom: 4px;
    }

    .settings-section-title {
        font-size: 16px;
        margin-bottom: 2px;
    }

    .settings-section-description {
        font-size: 12px;
        margin-bottom: 0;
    }

    .settings-card {
        padding: 14px;
        border-radius: 10px;
    }

    .settings-form {
        gap: 14px;
    }

    .form-group {
        margin-bottom: 0;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .settings-form .form-group input,
    .settings-form .form-group select {
        padding: 12px 14px;
        font-size: 16px;
        /* Prevent iOS zoom */
    }

    .form-group small {
        font-size: 11px;
        margin-top: 3px;
    }

    .form-row {
        gap: 12px;
    }

    .form-actions {
        margin-top: 4px;
        gap: 10px;
    }

    .form-actions .btn-primary {
        padding: 12px;
        font-size: 14px;
    }

    .form-message {
        padding: 10px 12px;
        font-size: 13px;
        margin-top: 4px;
    }

    .account-info {
        gap: 12px;
    }

    .info-row {
        padding: 10px 0;
        gap: 6px;
    }

    .info-row:hover {
        margin: 0 -14px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .info-label {
        font-size: 12px;
    }

    .info-value {
        font-size: 13px;
    }

    .checkbox-label {
        font-size: 13px;
        gap: 8px;
    }

    .checkbox-label small {
        font-size: 11px;
        margin-top: 3px;
    }
}

/* Tablet Settings Styles */
@media (min-width: 768px) and (max-width: 991.98px) {
    .settings-content {
        gap: 20px;
    }

    .settings-card {
        padding: 20px;
    }
}

/* ============================================
   Chat Widget Styles
   ============================================ */

#chat-widget-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #1e293b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.4);
    z-index: 9998;
    transition: all 0.3s ease;
    color: white;
}

#chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.6);
}

#chat-widget-button.chat-widget-active {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}

#chat-widget-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
}

#chat-widget-window.chat-widget-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-widget-header {
    background: #1e293b;
    color: white;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-widget-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-widget-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 44px;
    /* Touch-friendly minimum */
    height: 44px;
    /* Touch-friendly minimum */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.chat-widget-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-widget-end-btn {
    background: rgba(239, 68, 68, 0.9);
    border: none;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s;
    min-height: 36px;
    /* Better touch target */
}

.chat-widget-end-btn:hover {
    background: rgba(220, 38, 38, 1);
    transform: translateY(-1px);
}

.chat-widget-end-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #64748b;
    transform: none;
}

.chat-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-widget-loading,
.chat-widget-empty {
    text-align: center;
    color: #6b7280;
    padding: 40px 20px;
    font-size: 14px;
}

.chat-widget-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-widget-message-user {
    align-self: flex-end;
}

.chat-widget-message-admin {
    align-self: flex-start;
}

.chat-widget-message-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-widget-message-user .chat-widget-message-content {
    background: #1e293b;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-widget-message-admin .chat-widget-message-content {
    background: #f3f4f6;
    color: #374151;
    border-bottom-left-radius: 4px;
}

.chat-widget-message-system {
    align-self: center;
    max-width: 90%;
    margin: 8px 0;
}

.chat-widget-message-system .chat-widget-message-content {
    background: transparent;
    color: #9ca3af;
    text-align: center;
    font-size: 12px;
    font-style: normal;
    padding: 4px 8px;
    border: none;
}

.chat-widget-message-system .chat-widget-message-content strong {
    font-weight: 600;
    color: #6b7280;
}

.chat-widget-message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    padding: 0 4px;
}

.chat-widget-input-container {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#chat-widget-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    /* 16px+ prevents iOS zoom on focus */
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

#chat-widget-input:focus {
    border-color: #1e293b;
}

.chat-widget-send-btn {
    background: #1e293b;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    /* Touch-friendly minimum size */
}

.chat-widget-send-btn:hover:not(:disabled) {
    background: #334155;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(15, 23, 42, 0.3);
}

.chat-widget-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-widget-confirmation {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-widget-confirmation-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-widget-confirmation-message {
    margin: 0;
    font-size: 14px;
    color: #374151;
    text-align: center;
    font-weight: 500;
}

.chat-widget-confirmation-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.chat-widget-confirm-btn {
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    min-height: 44px;
    /* Touch-friendly minimum size */
}

.chat-widget-confirm-yes {
    background: #ef4444;
    color: white;
}

.chat-widget-confirm-yes:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.chat-widget-confirm-cancel {
    background: #f3f4f6;
    color: #374151;
}

.chat-widget-confirm-cancel:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

/* Admin Chat View Styles */
.chat-sessions-list {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

.chat-session-item {
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid transparent;
}

.chat-session-item:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.chat-session-item.active {
    background: #eff6ff;
    border-color: #1e293b;
}

.chat-session-info {
    flex: 1;
}

.chat-session-name {
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.chat-session-email {
    font-size: 12px;
    color: #6b7280;
}

.chat-unread-badge {
    background: #ef4444;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    border-radius: 8px;
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
    text-align: center;
    padding: 40px;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    border-radius: 8px 8px 0 0;
}

.chat-header-info h3 {
    margin: 0 0 4px 0;
    color: #374151;
}

.chat-header-email {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

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

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

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

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

.chat-message-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message-admin .chat-message-content {
    background: #f3f4f6;
    color: #374151;
    border-bottom-left-radius: 4px;
}

.chat-message-user .chat-message-content {
    background: #1e293b;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message-system {
    display: flex;
    justify-content: center;
    margin: 8px 0;
}

.chat-message-system .chat-message-content {
    background: transparent;
    color: #9ca3af;
    text-align: center;
    font-size: 12px;
    font-style: normal;
    padding: 4px 8px;
    border: none;
    max-width: 100%;
}

.chat-message-system .chat-message-content strong {
    font-weight: 600;
    color: #6b7280;
}

.chat-confirmation {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.chat-confirmation-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.chat-confirmation-message {
    margin: 0 0 16px 0;
    font-size: 15px;
    color: #374151;
    text-align: center;
    font-weight: 500;
}

.chat-confirmation-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.chat-confirm-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.chat-confirm-yes {
    background: #ef4444;
    color: white;
}

.chat-confirm-yes:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.chat-confirm-cancel {
    background: #f3f4f6;
    color: #374151;
}

.chat-confirm-cancel:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.chat-start-new-btn {
    background: #1e293b !important;
}

.chat-message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    padding: 0 4px;
}

.chat-input-container {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#chat-reply-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

#chat-reply-input:focus {
    border-color: #1e293b;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #chat-widget-window {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 80px;
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
    }

    #chat-widget-button {
        bottom: 15px;
        right: 15px;
        width: 56px;
        height: 56px;
    }
}

/* ============================================
   File Upload Styles
   ============================================ */

.file-upload-area {
    margin-top: 8px;
}

.file-upload-dropzone {
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    background: #ffffff;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-upload-dropzone:hover {
    border-color: #1e293b;
    background: #f8fafc;
}

.file-upload-browse-btn {
    background: none;
    border: none;
    color: #1e293b;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-size: 14px;
}

.file-upload-browse-btn:hover {
    color: #1e293b;
}

.file-list-container {
    margin-top: 12px;
}

.file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.file-upload-add-more-btn {
    transition: all 0.2s ease;
}

.file-upload-add-more-btn:hover {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

.file-list {
    margin-top: 0;
}

.file-item {
    transition: all 0.2s ease;
}

.file-item:hover {
    background: #f1f5f9 !important;
}

.attachment-item:hover {
    border-color: #1e293b !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
    transform: translateY(-2px);
}

/* Mobile file upload styles */
@media (max-width: 575.98px) {
    .file-upload-dropzone {
        padding: 24px 16px;
    }

    .file-upload-dropzone svg {
        width: 40px !important;
        height: 40px !important;
    }

    .file-upload-dropzone p {
        font-size: 13px !important;
    }

    .file-upload-dropzone small {
        font-size: 11px !important;
    }
}