/* Compuware Technologies Help Desk - Youthful icon-led style */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    --bg: #0d1117;
    --bg-elevated: #161b22;
    --bg-card: #21262d;
    --bg-hover: #30363d;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
    --text: #f0f6fc;
    --text-muted: #8b949e;
    --text-faint: #6e7681;
    --accent: #6ea8fe;
    --accent-hover: #8cb4ff;
    --accent-soft: rgba(110, 168, 254, 0.18);
    --accent-glow: rgba(110, 168, 254, 0.35);
    --success: #56d364;
    --success-soft: rgba(56, 211, 100, 0.18);
    --warning: #e3b341;
    --warning-soft: rgba(227, 179, 65, 0.18);
    --danger: #ff7b72;
    --danger-soft: rgba(255, 123, 114, 0.18);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.2s ease;
    --bounce: 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Icon base (Lucide) */
.icon {
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.2em;
    flex-shrink: 0;
}
.icon-sm { width: 1em; height: 1em; vertical-align: -0.15em; }
.icon-logo { width: 1.4em; height: 1.4em; vertical-align: -0.35em; margin-right: 0.35rem; }
.icon-heart { width: 0.95em; height: 0.95em; vertical-align: -0.1em; margin-right: 0.35rem; color: var(--danger); }
.main-nav a .icon,
.user-menu a .icon { margin-right: 0.35rem; }
.btn .icon { margin-right: 0.4rem; }
.btn .icon:last-child { margin-right: 0; margin-left: 0.4rem; }
.stat-card .stat-icon { width: 2.25rem; height: 2.25rem; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; margin-bottom: 0.65rem; }
.stat-card .stat-icon svg { width: 1.25rem; height: 1.25rem; }
.page-header h1 .icon { margin-right: 0.4rem; vertical-align: -0.25em; }

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.main-content {
    flex: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* ----- Header ----- */
.site-header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
    transition: color var(--transition), transform var(--transition);
}
.logo .icon-logo { color: var(--accent); }
.logo:hover {
    color: var(--accent);
}
.logo:hover .icon-logo { color: var(--accent-hover); }
.logo:active { transform: scale(0.98); }

.main-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.main-nav a:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-strong);
}

.user-name {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.user-menu a {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.user-menu a:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition), transform 0.1s ease, box-shadow var(--transition);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
    border-radius: var(--radius-sm);
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 24px var(--accent-glow);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text);
    border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-faint);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
}

.btn-link {
    background: none;
    color: var(--text-muted);
    box-shadow: none;
}

.btn-link:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.btn-link.danger:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

/* ----- Empty state ----- */
.empty-state {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    padding: 1.25rem 0;
}
.icon-empty {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    opacity: 0.7;
}

/* ----- Alerts ----- */
.alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}
.alert .icon { flex-shrink: 0; }

.alert-error {
    background: var(--danger-soft);
    color: #ff7b72;
    border-color: rgba(248, 81, 73, 0.3);
}

.alert-success {
    background: var(--success-soft);
    color: #56d364;
    border-color: rgba(63, 185, 80, 0.3);
}

/* ----- Auth ----- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.auth-card-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}
.auth-card-icon .icon { width: 1.75rem; height: 1.75rem; }

.auth-card h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.auth-card label:first-of-type {
    margin-top: 0;
}

.auth-hint {
    font-size: 0.8rem;
    color: var(--text-faint);
    margin-top: 1.25rem;
}

/* ----- Forms ----- */
label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    max-width: 420px;
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-weight: 400;
}

.checkbox-label input {
    width: auto;
    max-width: none;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-faint);
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.form-card .btn {
    margin-top: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.form-row > div input,
.form-row > div select {
    max-width: none;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
}

.form-inline input[type="text"] {
    max-width: 220px;
}

/* ----- Page header ----- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ----- Tables ----- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

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

.data-table th {
    background: var(--bg-elevated);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover td {
    background: var(--bg-hover);
}

.data-table a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.data-table a:hover {
    text-decoration: underline;
}

/* ----- Badges ----- */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-open {
    background: var(--accent-soft);
    color: #79b8ff;
}

.badge-in_progress {
    background: var(--warning-soft);
    color: #e3b341;
}

.badge-waiting {
    background: rgba(139, 148, 158, 0.2);
    color: var(--text-muted);
}

.badge-resolved {
    background: var(--success-soft);
    color: #56d364;
}

.badge-closed {
    background: rgba(139, 148, 158, 0.2);
    color: var(--text-muted);
}

.badge-priority-high,
.badge-priority-urgent {
    background: var(--danger-soft);
    color: #ff7b72;
}

.badge-priority-medium {
    background: var(--warning-soft);
    color: #e3b341;
}

.badge-priority-low {
    background: rgba(139, 148, 158, 0.2);
    color: var(--text-muted);
}

.badge-internal {
    background: rgba(139, 148, 158, 0.2);
    color: var(--text-muted);
}

.badge-planning {
    color: #79b8ff;
    background: var(--accent-soft);
}

.badge-active {
    color: #56d364;
    background: var(--success-soft);
}

.badge-on_hold {
    color: var(--text-muted);
    background: rgba(139, 148, 158, 0.2);
}

.badge-completed {
    color: #56d364;
    background: var(--success-soft);
}

.badge-cancelled {
    color: #ff7b72;
    background: var(--danger-soft);
}

.badge-info {
    background: var(--accent-soft);
    color: #79b8ff;
}

.badge-pending {
    background: var(--accent-soft);
    color: #79b8ff;
}

.badge-confirmed {
    background: var(--success-soft);
    color: #56d364;
}

/* ----- Project sections: SLA, Training, Comments ----- */
.project-sla-section,
.project-training-section,
.project-comments-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.project-sla-section h2,
.project-training-section h2,
.project-comments-section h2 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: -0.5rem 0 1rem;
}

.sla-upload-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.sla-upload-form input[type="file"] {
    max-width: 280px;
}

.sla-list, .training-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sla-item, .training-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.sla-meta, .training-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.training-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.training-user {
    font-weight: 600;
}

.training-issue {
    margin: 0 0 0.5rem;
    color: var(--text);
}

.training-staff-notes {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0.5rem 0;
    padding-left: 1rem;
    border-left: 2px solid var(--border-strong);
}

.training-status-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.training-status-form select,
.training-status-form input[type="text"] {
    max-width: 140px;
}

.training-booking-form,
.comment-form {
    margin-bottom: 1.25rem;
}

.comment-form textarea,
.training-booking-form textarea {
    min-height: 80px;
}

.project-comments-list {
    margin-top: 1rem;
}

.project-comment-thread {
    margin-bottom: 1.25rem;
}

.comment-context {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.project-comment {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.project-comment.staff-reply {
    border-left: 3px solid var(--accent);
}

.project-comment .comment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.comment-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.project-comment .comment-body {
    margin-bottom: 0.5rem;
}

.milestone-comment-link {
    font-size: 0.875rem;
    color: var(--accent);
    text-decoration: none;
    margin-left: 0.5rem;
}

.milestone-comment-link:hover {
    text-decoration: underline;
}

.sla-delete-form {
    display: inline;
    margin: 0;
}

.comment-attachments {
    margin: 0.5rem 0;
}

.comment-attachment {
    display: inline-block;
    margin-right: 1rem;
}

.comment-attachment a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}

.comment-attachment a:hover {
    text-decoration: underline;
}

.comment-reply-form {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.comment-reply-form textarea {
    min-height: 60px;
    margin-bottom: 0.5rem;
}

/* ----- Dashboard ----- */
.dashboard .welcome {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1.75rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--bounce);
}
.stat-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.stat-icon-blue { background: var(--accent-soft); color: var(--accent); }
.stat-icon-green { background: var(--success-soft); color: var(--success); }
.stat-icon-teal { background: rgba(56, 211, 160, 0.2); color: #56d3a0; }
.stat-icon-purple { background: rgba(163, 113, 247, 0.2); color: #a371f7; }
.stat-icon-danger { background: var(--danger-soft); color: var(--danger); }

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.recent-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.recent-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem;
}

.recent-section .data-table {
    margin-bottom: 1rem;
}

.recent-section p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ----- Reports & Analytics ----- */
.reports-section {
    margin-bottom: 2.5rem;
}
.reports-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.reports-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}
.reports-desc {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.reports-kpi {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.reports-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}
.reports-kpi-value small {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
}
.reports-kpi-value.reports-kpi-good { color: var(--success); }
.reports-kpi-value.reports-kpi-warn { color: var(--warning); }
.reports-kpi-value.reports-kpi-bad { color: var(--danger); }
.reports-kpi-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.reports-table {
    margin-top: 0.5rem;
}

.recent-section a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.recent-section a:hover {
    text-decoration: underline;
}

/* ----- Ticket detail ----- */
.ticket-detail {
    max-width: 820px;
}

.ticket-assignee-card {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.ticket-assignee-card h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.assignee-info a {
    color: var(--accent);
    text-decoration: none;
}

.assignee-info a:hover {
    text-decoration: underline;
}

.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.ticket-detail h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.ticket-body {
    margin-bottom: 1.75rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    line-height: 1.65;
}

.ticket-staff-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.ticket-staff-form label {
    margin-top: 0;
}

.ticket-staff-form select {
    max-width: 160px;
}

.replies h3 {
    margin: 1.5rem 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.reply {
    padding: 1.15rem 1.25rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 0.85rem;
    border-left: 4px solid var(--accent);
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-left-color: var(--accent);
}

.reply.internal {
    border-left-color: var(--warning);
    background: rgba(210, 153, 34, 0.05);
}

.reply-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.reply-meta .reply-date {
    margin-left: 0.5rem;
    color: var(--text-faint);
}

.reply-body {
    font-size: 0.95rem;
    line-height: 1.6;
}

.reply-form {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.reply-form textarea {
    max-width: 100%;
}

.ticket-attachments,
.reply-attachments {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}
.ticket-attachments-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 0.5rem;
}
.ticket-attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--accent);
    text-decoration: none;
    margin-right: 1rem;
    margin-top: 0.35rem;
}
.ticket-attachment-link:hover {
    text-decoration: underline;
}
.reply-attachments .ticket-attachment-link {
    display: inline-flex;
}
.ticket-attachment-item {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
    margin-top: 0.5rem;
}
.ticket-attachment-preview {
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-subtle);
}
.ticket-attachment-preview .attachment-thumb {
    display: block;
    max-width: 120px;
    max-height: 90px;
    object-fit: contain;
    vertical-align: middle;
}
.ticket-attachment-links {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.ticket-attachment-sep {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Ticket SLA (response & resolution) - visible to all users */
.ticket-sla {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.ticket-sla h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.ticket-sla-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.ticket-sla-item {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--success);
    background: var(--bg-elevated);
}
.ticket-sla-item.ticket-sla-breach {
    border-left-color: var(--danger);
    background: var(--danger-soft);
}
.ticket-sla-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.ticket-sla-value {
    font-size: 0.95rem;
    font-weight: 500;
}
.ticket-sla-target {
    display: block;
    font-size: 0.8rem;
    color: var(--text-faint);
    margin-top: 0.2rem;
}

/* SLA badge in ticket list */
.sla-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
.sla-badge.sla-badge-ok { background: var(--success-soft); color: var(--success); }
.sla-badge.sla-badge-response_breach { background: var(--warning-soft); color: var(--warning); }
.sla-badge.sla-badge-resolution_breach { background: var(--warning-soft); color: var(--warning); }
.sla-badge.sla-badge-both_breach { background: var(--danger-soft); color: var(--danger); }

/* ----- Project detail ----- */
.project-detail {
    max-width: 820px;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.project-meta a {
    color: var(--accent);
    text-decoration: none;
}

.project-meta a:hover {
    text-decoration: underline;
}

.project-description {
    margin-bottom: 1.75rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    line-height: 1.65;
}

/* ----- Live chat ----- */
body.chat-page .main-content {
    max-width: 720px;
    padding: 1rem;
    height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chat-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-header h1 {
    margin: 0 0 0.2rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.chat-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chat-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

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

.chat-loading {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

.chat-msg {
    max-width: 85%;
    align-self: flex-start;
    padding: 0.65rem 1rem;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.chat-msg-me {
    align-self: flex-end;
    background: var(--accent-soft);
    border-color: rgba(110, 168, 254, 0.3);
}

.chat-msg-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.chat-msg-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.chat-msg-role {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    text-transform: capitalize;
}

.chat-msg-me .chat-msg-role {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
}

.chat-msg-time {
    font-size: 0.75rem;
    color: var(--text-faint);
    margin-left: auto;
}

.chat-msg-body {
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
}

.chat-form {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

.chat-input-wrap {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.chat-input-wrap textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    resize: none;
    margin: 0;
    max-width: none;
}

.chat-send {
    flex-shrink: 0;
}

.chat-hint {
    font-size: 0.75rem;
    color: var(--text-faint);
    margin-top: 0.35rem;
}

/* ----- Progress bars & project charts ----- */
.progress-bar-wrap {
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    height: 8px;
    overflow: hidden;
    min-width: 80px;
}
.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--accent);
    transition: width 0.4s ease;
}
.progress-bar.progress-success { background: var(--success); }
.progress-bar.progress-warning { background: var(--warning); }
.progress-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.progress-cell .progress-bar-wrap { flex: 1; max-width: 100px; }
.progress-cell .progress-pct { font-size: 0.8rem; color: var(--text-muted); min-width: 2.5rem; }

.project-progress-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.project-progress-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.project-progress-card h3 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}
.project-progress-card .progress-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.project-progress-card .progress-bar-wrap {
    height: 10px;
    margin-bottom: 0.25rem;
}
.project-progress-card .progress-legend {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.project-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 48px;
    margin-top: 0.5rem;
}
.project-chart-bar {
    flex: 1;
    min-width: 12px;
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
}
.project-chart-bar.completed { background: var(--success); }
.project-chart-bar.pending { background: var(--border-strong); }

.milestones-section {
    margin-top: 2rem;
}

.milestones-section h2 {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.milestones-section .btn-sm {
    margin-bottom: 1rem;
}

.milestone-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.milestone-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 0.85rem;
    transition: border-color var(--transition);
}

.milestone-item:hover {
    border-color: var(--border-strong);
}

.milestone-item.completed {
    opacity: 0.9;
    border-left: 3px solid var(--success);
}

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

.milestone-title {
    font-weight: 600;
    font-size: 1rem;
}

.milestone-due {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.milestone-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
    line-height: 1.5;
}

.milestone-payment {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: var(--text-muted);
}

.milestone-payment .badge {
    margin-left: 0.4rem;
}

/* ----- Timeline share ----- */
body.timeline-share .main-nav {
    display: none;
}

.timeline-share-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 1rem 0;
}
.timeline-share-icon {
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
.timeline-share-icon .icon { width: 2rem; height: 2rem; }

.timeline-share-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.timeline-share-header .subtitle {
    color: var(--text-muted);
    margin: 0.25rem 0;
    font-size: 0.95rem;
}

.timeline-share-header .project-desc {
    max-width: 560px;
    margin: 1rem auto;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.timeline-share-header .dates {
    color: var(--text-faint);
    font-size: 0.9rem;
}

.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 560px;
}

.timeline-item {
    padding: 1.25rem;
    margin-bottom: 0.85rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    transition: border-color var(--transition);
}

.timeline-item.completed {
    border-left-color: var(--success);
    opacity: 0.95;
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.timeline-content p {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.timeline-sla-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.timeline-sla-section h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.timeline-sla-section .sla-list {
    margin-top: 0.75rem;
}

.timeline-footer {
    text-align: center;
    margin-top: 2.5rem;
    font-size: 0.9rem;
    color: var(--text-faint);
}

.no-events {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* ----- Landing ----- */
.landing {
    text-align: center;
    padding: 4rem 2rem 5rem;
    max-width: 640px;
    margin: 0 auto;
}

.landing-hero-icon {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent-soft) 0%, rgba(163, 113, 247, 0.2) 100%);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}
.landing-hero-icon .icon { width: 2.5rem; height: 2.5rem; }

.landing h1 {
    margin: 0 0 0.5rem;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.tagline {
    color: var(--accent);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--accent-soft);
    border-radius: var(--radius-full);
}

.landing p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.65;
    margin: 0 0 1rem;
}

.landing .btn {
    margin-top: 0.5rem;
    padding: 0.85rem 1.85rem;
    font-size: 1rem;
    border-radius: var(--radius-sm);
}
.landing .btn .icon { margin-right: 0.5rem; }

/* ----- Knowledge base ----- */
.kb-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.kb-content {
    padding: 1rem 0;
    max-width: 720px;
    line-height: 1.7;
}

.kb-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kb-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.kb-list li:hover {
    background: var(--bg-hover);
    margin: 0 -1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
}

.kb-list a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.kb-list a:hover {
    color: var(--accent);
}

.kb-cat {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
    font-weight: 400;
}

/* ----- Footer ----- */
.site-footer {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    font-size: 0.85rem;
    color: var(--text-faint);
    text-align: center;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .main-content {
        padding: 1.25rem 1rem;
    }

    .header-inner {
        padding: 0.75rem 1rem;
    }

    .main-nav {
        width: 100%;
        justify-content: flex-start;
    }

    .user-menu {
        margin-left: auto;
        padding-left: 0.75rem;
        border-left: 1px solid var(--border-strong);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1.5rem;
    }

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

    .stat-card {
        padding: 1.25rem;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.65rem 0.85rem;
        font-size: 0.9rem;
    }

    .landing {
        padding: 3rem 1.5rem 4rem;
    }

    .landing h1 {
        font-size: 1.75rem;
    }

    .auth-card {
        padding: 1.75rem;
    }
}

/* ----- Hosting detail ----- */
.detail-grid {
    display: grid;
    gap: 1.25rem;
    max-width: 960px;
}

@media (min-width: 768px) {
    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .detail-grid .form-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

.detail-list {
    margin: 0;
}

.detail-list dt {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.detail-list dt:first-child {
    margin-top: 0;
}

.detail-list dd {
    margin: 0.15rem 0 0;
}

.text-danger {
    color: var(--danger);
}

.pre-wrap {
    white-space: pre-wrap;
    font-family: inherit;
    margin: 0;
    font-size: 0.9rem;
}

/* ----- Ticket live chat (stakeholders + staff) ----- */
.ticket-live-chat {
    margin: 2rem 0 1.5rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.ticket-live-chat h3 {
    margin-top: 0;
}

.ticket-chat-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ticket-chat-messages {
    max-height: 280px;
    overflow-y: auto;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.ticket-chat-msg {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.ticket-chat-msg-me {
    border-color: var(--accent);
    background: var(--accent-soft, rgba(79, 70, 229, 0.08));
}

.ticket-chat-msg-header {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.ticket-chat-msg-header strong {
    color: var(--text);
}

.ticket-chat-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.ticket-chat-form textarea {
    flex: 1;
    min-height: 2.5rem;
    resize: vertical;
}
