/**
 * SDOC-TAP - Custom Stylesheet
 * DepEd-inspired theme featuring official colors, clean admin dashboard,
 * responsive client portal, and print-ready ticket styling.
 */

/* ==========================================================================
   1. CSS Variables & Theme Configuration
   ========================================================================== */
:root {
    /* Primary DepEd Blue */
    --primary: #0038A8;
    --primary-dark: #002d8a;
    --primary-light: #e6eefb;
    --primary-rgb: 0, 56, 168;

    /* DepEd Official Gold Accent */
    --accent: #FDB813;
    --accent-light: #ffc72c;
    --accent-dark: #d99b00;
    --accent-bg: #fff9e6;
    --accent-rgb: 253, 184, 19;

    /* Neutral & Backgrounds */
    --light-bg: #f4f6f9;
    --dark-bg: #1a1a2e;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --text-primary: #2d3748;
    --text-muted: #6c757d;

    /* Admin Dimensions */
    --sidebar-width: 250px;
    --navbar-height: 66px;
    --footer-height: 52px;

    /* Priority Colors */
    --priority-urgent: #dc3545;
    --priority-high: #fd7e14;
    --priority-medium: #0dcaf0;
    --priority-low: #198754;

    /* Status Colors */
    --status-open: #0038A8;
    --status-assigned: #6f42c1;
    --status-in-progress: #fd7e14;
    --status-resolved: #00843D;
    --status-closed: #6c757d;
}

/* ==========================================================================
   2. Base & Global Layout
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: var(--navbar-height);
}

main {
    flex: 1 0 auto;
}

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

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

/* ==========================================================================
   3. Navigation & Header
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-height: var(--navbar-height);
    background-color: var(--primary) !important;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    border-bottom: 3px solid var(--accent);
    padding: 0.6rem 1rem;
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
}

.navbar-brand img,
.brand-logo {
    height: 38px;
    width: 38px;
    object-fit: contain;
    background-color: #ffffff;
    border-radius: 50%;
    padding: 1px;
    border: 1.5px solid var(--accent);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.88);
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar .nav-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.12);
}

.navbar .dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.navbar .dropdown-item:active,
.navbar .dropdown-item.active {
    background-color: var(--primary);
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.35);
    padding: 0.35rem 0.6rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ==========================================================================
   4. Admin Dashboard Layout & Sidebar
   ========================================================================== */
.admin-wrapper {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
    width: 100%;
    position: relative;
}

.admin-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 16px 12px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    bottom: 0;
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1020;
    transition: transform 0.3s ease-in-out;
}

.admin-sidebar::-webkit-scrollbar {
    width: 5px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

[data-bs-theme="dark"] .admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

.admin-sidebar .sidebar-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    color: #6c757d;
    padding: 10px 15px 6px;
    margin-top: 8px;
}

.admin-sidebar .nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.admin-sidebar .nav-item {
    width: 100%;
}

.admin-sidebar .nav-link {
    color: #333333;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.935rem;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-decoration: none;
}

.admin-sidebar .nav-link i {
    width: 24px;
    margin-right: 8px;
    font-size: 1.1rem;
    text-align: center;
    color: var(--primary);
    transition: color 0.2s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: var(--primary);
    color: #ffffff;
}

.admin-sidebar .nav-link:hover i,
.admin-sidebar .nav-link.active i {
    color: #ffffff;
}

.admin-sidebar .badge {
    margin-left: auto;
}

.admin-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-width: 0;
    background-color: var(--light-bg);
    min-height: calc(100vh - var(--navbar-height));
}

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

.admin-content-header h1,
.admin-content-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0;
}

/* Sidebar Backdrop for Mobile view */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 1039;
}

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

/* ==========================================================================
   5. Stat Cards & General Cards
   ========================================================================== */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09);
}

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

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.875rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.stat-card.accent .stat-number {
    color: var(--accent);
}

.stat-card.warning .stat-number {
    color: #fd7e14;
}

.stat-card.danger .stat-number {
    color: #dc3545;
}

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

.stat-card.accent .stat-icon {
    background-color: var(--accent-bg);
    color: var(--accent);
}

.stat-card.warning .stat-icon {
    background-color: #fff4e5;
    color: #fd7e14;
}

.stat-card.danger .stat-icon {
    background-color: #fde8e8;
    color: #dc3545;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #edf2f7;
    padding: 16px 20px;
    font-weight: 600;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}

/* ==========================================================================
   6. Ticket Status & Priority Badges
   ========================================================================== */
.badge {
    font-weight: 600;
    border-radius: 20px;
    padding: 5px 12px;
    letter-spacing: 0.3px;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Status Badge Styles */
.badge-status-open,
.badge-open,
.badge[data-status="Open"] {
    background-color: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(0, 56, 168, 0.25);
}

.badge-status-assigned,
.badge-assigned,
.badge[data-status="Assigned"] {
    background-color: #f0ebf8;
    color: #6f42c1;
    border: 1px solid rgba(111, 66, 193, 0.25);
}

.badge-status-in-progress,
.badge-in-progress,
.badge[data-status="In Progress"] {
    background-color: #fff4e5;
    color: #c96009;
    border: 1px solid rgba(253, 126, 20, 0.3);
}

.badge-status-resolved,
.badge-resolved,
.badge[data-status="Resolved"] {
    background-color: var(--accent-bg);
    color: var(--accent);
    border: 1px solid rgba(0, 132, 61, 0.3);
}

.badge-status-closed,
.badge-closed,
.badge[data-status="Closed"] {
    background-color: #f1f3f5;
    color: #495057;
    border: 1px solid #ced4da;
}

/* Priority Badge Styles */
.badge-priority-urgent,
.badge[data-priority="Urgent"] {
    background-color: #fde8e8;
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.badge-priority-high,
.badge[data-priority="High"] {
    background-color: #fff4e5;
    color: #c96009;
    border: 1px solid rgba(253, 126, 20, 0.3);
}

.badge-priority-medium,
.badge[data-priority="Medium"] {
    background-color: #e0f7fa;
    color: #0288d1;
    border: 1px solid rgba(2, 136, 209, 0.3);
}

.badge-priority-low,
.badge[data-priority="Low"] {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid rgba(46, 125, 50, 0.3);
}

/* SLA Badge Enhancements */
.badge.bg-danger i.fa-fire {
    animation: slaPulse 2s infinite ease-in-out;
}

@keyframes slaPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.85; }
    100% { transform: scale(1); opacity: 1; }
}

/* Star Rating Interactive Selector */
.star-rating-select {
    display: inline-flex;
    cursor: pointer;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.star-rating-select .star-radio {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    pointer-events: none;
}

.star-rating-select .star-btn {
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    padding: 6px 8px;
    touch-action: manipulation;
}

.star-rating-select .star-btn:hover,
.star-rating-select .star-btn:hover ~ .star-btn,
.star-rating-select input[type="radio"]:checked ~ .star-btn,
.star-rating-select .star-btn.is-active {
    color: #FDB813;
}

.star-rating-select .star-btn:hover {
    transform: scale(1.2);
}

/* ==========================================================================
   7. Ticket Cards & Tables
   ========================================================================== */
.ticket-card {
    background-color: #ffffff;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 16px 20px;
    margin-bottom: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.ticket-card.priority-urgent {
    border-left-color: #dc3545;
}

.ticket-card.priority-high {
    border-left-color: #fd7e14;
}

.ticket-card.priority-medium {
    border-left-color: #0dcaf0;
}

.ticket-card.priority-low {
    border-left-color: #198754;
}

.ticket-card .ticket-tracking {
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
}

.ticket-card .ticket-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 6px;
}

/* Table Enhancements */
.table-responsive {
    border-radius: 8px;
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table thead th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 56, 168, 0.035);
}

.table td {
    padding: 12px 16px;
    border-color: #edf2f7;
    font-size: 0.935rem;
}

.tracking-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 600;
    color: var(--primary);
    background-color: var(--primary-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* ==========================================================================
   8. Timeline (Ticket Updates & Logs)
   ========================================================================== */
.timeline {
    position: relative;
    padding-left: 30px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background-color: #dee2e6;
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary);
    position: absolute;
    left: -21px;
    top: 6px;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px rgba(0, 56, 168, 0.25);
    z-index: 1;
}

.timeline-item.public::before {
    background-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 132, 61, 0.25);
}

.timeline-item.internal::before {
    background-color: #6c757d;
    box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.25);
}

.timeline-content {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 14px 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f3f5;
}

.timeline-author {
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-time {
    color: #6c757d;
    font-size: 0.8125rem;
}

.timeline-body {
    font-size: 0.935rem;
    color: #4a5568;
    line-height: 1.5;
}

/* ==========================================================================
   9. Status Progress Bar
   ========================================================================== */
.status-progress {
    margin: 20px 0;
}

.status-progress .progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    overflow: hidden;
}

.status-progress .progress-bar {
    background-color: var(--primary);
    transition: width 0.6s ease;
}

.status-progress .progress-bar.bg-accent {
    background-color: var(--accent);
}

.status-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 0 4px;
}

.status-step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-step-label.active {
    color: var(--primary);
}

.status-step-label.completed {
    color: var(--accent);
}

/* ==========================================================================
   10. Forms & Button Styling
   ========================================================================== */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 9px 14px;
    font-size: 0.935rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 56, 168, 0.25);
    outline: 0;
}

.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 6px;
}

.form-text {
    font-size: 0.8125rem;
    color: #6c757d;
}

/* Custom Buttons */
.btn {
    border-radius: 8px;
    padding: 8px 18px;
    font-weight: 500;
    font-size: 0.935rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: #ffffff !important;
}

.btn-accent {
    background-color: var(--accent);
    border: 1px solid var(--accent-dark);
    color: #002878;
    font-weight: 600;
}

.btn-accent:hover,
.btn-accent:focus,
.btn-accent:active {
    background-color: var(--accent-light) !important;
    border-color: var(--accent) !important;
    color: #001f5c !important;
}

.btn-outline-accent {
    background-color: transparent;
    border: 1px solid var(--accent);
    color: var(--accent-dark);
    font-weight: 600;
}

.btn-outline-accent:hover,
.btn-outline-accent:focus,
.btn-outline-accent:active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #002878;
}

.char-counter {
    font-size: 0.8125rem;
    color: #6c757d;
    text-align: right;
    margin-top: 4px;
}

/* ==========================================================================
   11. Authentication & Login Page
   ========================================================================== */
.login-container {
    max-width: 420px;
    margin: 60px auto;
    padding: 0 16px;
}

.login-card {
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 40px;
    background-color: #ffffff;
    border: none;
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo i {
    font-size: 48px;
    color: var(--primary);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 10px;
    margin-bottom: 4px;
    text-align: center;
}

.login-subtitle {
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    margin-bottom: 24px;
}

/* ==========================================================================
   12. Client Portal & Category Showcase
   ========================================================================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    padding: 60px 0;
    text-align: center;
    border-radius: 0 0 24px 24px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 56, 168, 0.15);
}

.hero-section h1 {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 2.25rem;
}

/* Stylized Professional Client Portal Header */
.portal-hero-title {
    font-family: 'Outfit', 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(1.85rem, 3.5vw + 1rem, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    margin-bottom: 0.5rem;
}

.portal-hero-subtitle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 0.5rem;
}

.portal-hero-subtitle::before,
.portal-hero-subtitle::after {
    content: '';
    display: inline-block;
    width: 28px;
    height: 2px;
    background: #FDB813;
    opacity: 0.85;
    border-radius: 2px;
}

.portal-hero-subtext {
    font-family: 'Plus Jakarta Sans', 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(0.95rem, 1.5vw + 0.5rem, 1.25rem);
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #FDB813;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.hero-section p {
    opacity: 0.92;
    font-size: 1.1rem;
    max-width: 720px;
    margin: 0 auto 24px;
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #ffffff;
    background-color: var(--accent);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.service-card {
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 56, 168, 0.1);
    border-color: var(--primary);
    color: inherit;
}

.service-card:hover .service-icon {
    transform: scale(1.08);
}

.service-card .service-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 14px;
    margin-bottom: 6px;
}

.service-card .service-desc {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0;
}

/* ==========================================================================
   13. User Avatars
   ========================================================================== */
.user-avatar,
.user-avatar-nav,
.user-avatar-table,
.user-avatar-preview,
.user-avatar-lg,
.user-avatar-profile,
.avatar-img,
#userDropdown img {
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    background-color: #ffffff;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-avatar-nav {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 1px;
    border: 1.5px solid var(--accent, #FDB813);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.user-avatar-table {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 1px;
    border: 1.5px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.user-avatar-preview {
    width: 54px;
    height: 54px;
    min-width: 54px;
    min-height: 54px;
    padding: 2px;
    border: 2px solid var(--accent, #FDB813);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.user-avatar-lg {
    width: 80px;
    height: 80px;
    border: 3px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-avatar-profile {
    width: 150px;
    height: 150px;
    max-width: 150px;
    max-height: 150px;
    padding: 4px;
    border: 3.5px solid var(--accent, #FDB813);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    display: inline-block;
}

.avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
    border-radius: 50%;
    user-select: none;
}

[data-bs-theme="dark"] .user-avatar,
[data-bs-theme="dark"] .user-avatar-nav,
[data-bs-theme="dark"] .user-avatar-table,
[data-bs-theme="dark"] .user-avatar-preview,
[data-bs-theme="dark"] .user-avatar-profile {
    background-color: #1e293b;
}

[data-bs-theme="dark"] .user-avatar-table {
    border-color: #334155;
}

/* ==========================================================================
   14. Clipboard & Copy Utilities
   ========================================================================== */
.copy-tracking {
    cursor: pointer;
    transition: color 0.2s ease, transform 0.1s ease;
}

.copy-tracking:hover {
    color: var(--accent);
}

.copy-tracking:active {
    transform: scale(0.95);
}

/* ==========================================================================
   15. Site Footer
   ========================================================================== */
.site-footer {
    background-color: #1a1a2e;
    color: #cccccc;
    padding: 16px 0;
    text-align: center;
    font-size: 0.875rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media (min-width: 769px) {
    .admin-wrapper ~ .site-footer {
        margin-left: var(--sidebar-width);
    }
}

.site-footer a {
    color: var(--accent-light);
    text-decoration: none;
}

.site-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* ==========================================================================
   16. Responsive Media Queries
   ========================================================================== */
@media (max-width: 768px) {
    .admin-wrapper {
        position: relative;
    }

    .admin-sidebar {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        bottom: 0;
        width: var(--sidebar-width);
        z-index: 1040;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.15);
        background-color: #ffffff;
        transform: translateX(-100%);
        display: flex;
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-content {
        margin-left: 0;
        padding: 16px;
        width: 100%;
    }

    .admin-wrapper ~ .site-footer {
        margin-left: 0;
    }

    .hero-section {
        padding: 30px 0;
        border-radius: 0 0 16px 16px;
        margin-bottom: 24px;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .hero-section p {
        font-size: 0.95rem;
        padding: 0 12px;
    }

    .stat-card .stat-number {
        font-size: 1.5rem;
    }

    .login-container {
        margin: 20px auto;
        padding: 0 12px;
    }

    .login-card {
        padding: 24px;
    }
}

/* ==========================================================================
   16. Theme Toggle & Dark Mode Support (Bootstrap 5.3 + Custom Components)
   ========================================================================== */
.theme-toggle-btn {
    border-radius: 20px;
    padding: 5px 12px;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    line-height: 1;
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--accent);
    color: var(--accent) !important;
}

.theme-toggle-btn i {
    transition: transform 0.3s ease;
}

.theme-toggle-btn:hover i {
    transform: rotate(18deg);
}

/* Dark Theme Overrides */
[data-bs-theme="dark"] {
    --light-bg: #0d131f;
    --dark-bg: #070a10;
    --card-bg: #151e2e;
    --border-color: #243247;
    --text-primary: #e2e8f0;
    --text-muted: #94a3b8;
    --primary-light: #162444;
    --accent-bg: #2b230d;
}

[data-bs-theme="dark"] body {
    background-color: var(--light-bg);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .bg-light {
    background-color: #151e2e !important;
}

[data-bs-theme="dark"] .bg-white:not(.btn):not(.badge):not(.dropdown-menu):not(.login-logo-img):not(.receipt-print-area):not(.receipt-print-area *) {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .table.bg-white {
    background-color: transparent !important;
}

[data-bs-theme="dark"] .card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-header.bg-white,
[data-bs-theme="dark"] .card-header.bg-light,
[data-bs-theme="dark"] .card-header.bg-body,
[data-bs-theme="dark"] .card-header.bg-body-tertiary {
    background-color: #1e293b !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .card-header h1,
[data-bs-theme="dark"] .card-header h2,
[data-bs-theme="dark"] .card-header h3,
[data-bs-theme="dark"] .card-header h4,
[data-bs-theme="dark"] .card-header h5,
[data-bs-theme="dark"] .card-header h6,
[data-bs-theme="dark"] .card-header .card-title,
[data-bs-theme="dark"] .card-header .text-dark,
[data-bs-theme="dark"] .card-header .text-body {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .card-header .text-muted,
[data-bs-theme="dark"] .card-header .text-secondary {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .card-footer {
    background-color: #1a2436 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .card-footer.bg-white,
[data-bs-theme="dark"] .card-body.bg-white {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .nav-tabs {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
    color: #94a3b8;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: rgba(255, 255, 255, 0.12) rgba(255, 255, 255, 0.12) transparent;
    color: #f8fafc;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.12) rgba(255, 255, 255, 0.12) var(--card-bg);
    color: #60a5fa;
}

[data-bs-theme="dark"] .form-label {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
    background-color: #162030;
    border-color: #2b3b52;
    color: #f1f5f9;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #1a2538;
    border-color: #60a5fa;
    color: #ffffff;
    box-shadow: 0 0 0 0.25rem rgba(0, 56, 168, 0.35);
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #64748b;
}

[data-bs-theme="dark"] .admin-sidebar {
    background-color: #0f1726;
    border-right-color: #1e293b;
}

[data-bs-theme="dark"] .admin-sidebar .sidebar-heading {
    color: #64748b;
}

[data-bs-theme="dark"] .admin-sidebar .nav-link {
    color: #94a3b8;
}

[data-bs-theme="dark"] .admin-sidebar .nav-link i {
    color: #60a5fa;
}

[data-bs-theme="dark"] .admin-sidebar .nav-link:hover {
    background-color: #1e293b;
    color: #ffffff;
}

[data-bs-theme="dark"] .admin-sidebar .nav-link.active {
    background-color: var(--primary);
    color: #ffffff;
}

[data-bs-theme="dark"] .admin-sidebar .nav-link.active i {
    color: var(--accent);
}

[data-bs-theme="dark"] .admin-content {
    background-color: var(--light-bg);
}

[data-bs-theme="dark"] .admin-content-header h1,
[data-bs-theme="dark"] .admin-content-header h2 {
    color: #f8fafc;
}

[data-bs-theme="dark"] .stat-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

[data-bs-theme="dark"] .stat-card .stat-number {
    color: #60a5fa;
}

[data-bs-theme="dark"] .stat-card.accent .stat-number {
    color: var(--accent);
}

[data-bs-theme="dark"] .stat-card .stat-label {
    color: #94a3b8;
}

[data-bs-theme="dark"] .ticket-card {
    background-color: var(--card-bg);
}

[data-bs-theme="dark"] .timeline::before {
    background-color: #2b3b52;
}

[data-bs-theme="dark"] .timeline-item-content {
    background-color: #162030;
    border-color: #2b3b52;
}

[data-bs-theme="dark"] .timeline-author {
    color: #f1f5f9;
}

[data-bs-theme="dark"] .timeline-meta {
    color: #94a3b8;
}

[data-bs-theme="dark"] .site-footer {
    background-color: #080c14;
    border-top: 1px solid #1e293b;
    color: #94a3b8;
}

[data-bs-theme="dark"] .table {
    color: #e2e8f0;
    border-color: #243247;
}

[data-bs-theme="dark"] .table th {
    background-color: #162030;
    color: #f8fafc;
    border-color: #243247;
}

[data-bs-theme="dark"] .table td {
    border-color: #1e293b;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.02);
    color: #e2e8f0;
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #162030;
    border-color: #2b3b52;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .dropdown-item {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #243247;
    color: #ffffff;
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: #243247;
}

[data-bs-theme="dark"] .border {
    border-color: #243247 !important;
}

[data-bs-theme="dark"] .border-bottom {
    border-bottom-color: #243247 !important;
}

[data-bs-theme="dark"] .border-top {
    border-top-color: #243247 !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .btn-outline-dark {
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

[data-bs-theme="dark"] .btn-outline-dark:hover {
    color: #ffffff !important;
    background-color: #334155 !important;
    border-color: #64748b !important;
}

/* ==========================================================================
   17. Print Stylesheet (Default A4 for All Reports)
   ========================================================================== */
@media print {
    @page {
        size: A4;
        margin: 10mm 12mm;
    }

    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
        padding-top: 0 !important;
    }

    .navbar,
    .admin-sidebar,
    .site-footer,
    .btn,
    .no-print,
    .sidebar-backdrop,
    .char-counter,
    .pagination,
    .modal,
    .alert {
        display: none !important;
    }

    .admin-content,
    .container,
    .container-fluid {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .admin-wrapper {
        display: block !important;
        min-height: auto !important;
    }

    .card,
    .ticket-card,
    .timeline-content {
        box-shadow: none !important;
        border: 1px solid #cccccc !important;
        page-break-inside: avoid;
        margin-bottom: 12px !important;
    }

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

    .table th,
    .table td {
        border: 1px solid #dee2e6 !important;
        padding: 6px 10px !important;
        font-size: 10pt !important;
    }

    .report-table th,
    .report-table td,
    .report-summary-table th,
    .report-summary-table td,
    .report-breakdown-table th,
    .report-breakdown-table td,
    .table-report th,
    .table-report td {
        font-size: 10pt !important;
        padding: 5px 6px !important;
    }

    .badge {
        border: 1px solid #333333 !important;
        background: transparent !important;
        color: #000000 !important;
    }

    .timeline::before {
        background-color: #999999 !important;
    }

    .timeline-item::before {
        background-color: #000000 !important;
        box-shadow: none !important;
    }

    .editable-sig {
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        outline: none !important;
    }
    .editable-sig:hover {
        background: transparent !important;
        box-shadow: none !important;
    }
}

/* Editable Signatory Elements on Report Pages */
.editable-sig {
    cursor: text;
    border-radius: 4px;
    padding: 1px 4px;
    display: inline-block;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.editable-sig:hover {
    background-color: #fef9c3;
    box-shadow: 0 0 0 1px #eab308;
}
.editable-sig:focus {
    background-color: #ffffff;
    box-shadow: 0 0 0 2px #2563eb;
    outline: none;
}

/* Gmail-style New Ticket Indicator Dot */
@keyframes pulseDot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
    }
    70% {
        transform: scale(1.15);
        box-shadow: 0 0 0 6px rgba(13, 110, 253, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

.new-ticket-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    min-width: 9px;
    border-radius: 50%;
    background-color: #0d6efd;
    box-shadow: 0 0 6px rgba(13, 110, 253, 0.85);
    animation: pulseDot 2s infinite ease-in-out;
}

tr.table-unread {
    background-color: rgba(13, 110, 253, 0.04) !important;
    font-weight: 500;
}
