diff --git a/assets/css/dashboard.css b/assets/css/dashboard.css index 23c8466..88e06f7 100644 --- a/assets/css/dashboard.css +++ b/assets/css/dashboard.css @@ -520,7 +520,7 @@ h1 { /* ===== INTERMEDIATE RESPONSIVE BREAKPOINTS ===== */ -/* Extra large desktop (1600px+) */ +/* Extra large desktop (1600px+) - Full table view */ @media (min-width: 1600px) { .dashboard-layout { max-width: 1800px; @@ -536,8 +536,8 @@ h1 { } } -/* Large desktop (1200px - 1599px) - Hide some columns to fit */ -@media (min-width: 1200px) and (max-width: 1599px) { +/* Large desktop (1400px - 1599px) - Slightly compact table */ +@media (min-width: 1400px) and (max-width: 1599px) { .dashboard-layout { max-width: 100%; padding: 0 0.5rem; @@ -558,23 +558,136 @@ h1 { th, td { padding: 8px 10px; } - - /* Hide less important columns on medium-large screens */ - table th:nth-child(8), - table td:nth-child(8), - table th:nth-child(10), - table td:nth-child(10) { - display: none; - } } -/* Medium-large desktop (1000px - 1199px) - Hide more columns */ -@media (min-width: 1000px) and (max-width: 1199px) { - .dashboard-layout { - max-width: 100%; - padding: 0 0.5rem; +/* ===== RESPONSIVE CARD VIEW (below 1400px) ===== */ +/* Switch from table to card layout for better usability */ + +@media (max-width: 1399px) { + /* Hide the table on smaller screens */ + .table-wrapper table { + display: none; } + /* Show card view instead */ + .table-wrapper { + display: block; + } + + /* Card-based ticket list */ + .table-wrapper::before { + content: 'Tickets'; + display: block; + font-family: var(--font-mono); + font-size: 1rem; + color: var(--terminal-amber); + text-shadow: var(--glow-amber); + padding: 0.75rem 1rem; + border-bottom: 2px solid var(--terminal-green); + background: var(--bg-primary); + } + + .ticket-cards { + display: flex; + flex-direction: column; + gap: 0.5rem; + padding: 0.5rem; + } + + .ticket-card-row { + display: grid; + grid-template-columns: auto 1fr auto auto; + gap: 1rem; + align-items: center; + padding: 0.75rem 1rem; + background: var(--bg-secondary); + border: 1px solid var(--terminal-green); + border-left: 4px solid var(--terminal-green); + transition: all 0.2s ease; + } + + .ticket-card-row:hover { + background: rgba(0, 255, 65, 0.1); + box-shadow: var(--glow-green); + } + + .ticket-card-row.priority-1 { border-left-color: var(--priority-1); } + .ticket-card-row.priority-2 { border-left-color: var(--priority-2); } + .ticket-card-row.priority-3 { border-left-color: var(--priority-3); } + .ticket-card-row.priority-4 { border-left-color: var(--priority-4); } + .ticket-card-row.priority-5 { border-left-color: var(--priority-5); } + + .ticket-card-id { + font-family: var(--font-mono); + font-size: 0.85rem; + color: var(--terminal-cyan); + white-space: nowrap; + } + + .ticket-card-id a { + color: inherit; + text-decoration: none; + } + + .ticket-card-id a:hover { + color: var(--terminal-amber); + text-shadow: var(--glow-amber); + } + + .ticket-card-main { + min-width: 0; + } + + .ticket-card-title { + font-size: 0.95rem; + color: var(--terminal-green); + margin-bottom: 0.25rem; + word-wrap: break-word; + } + + .ticket-card-meta { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + font-size: 0.75rem; + color: var(--text-muted); + } + + .ticket-card-meta span { + display: inline-flex; + align-items: center; + gap: 0.25rem; + } + + .ticket-card-status { + padding: 0.25rem 0.5rem; + font-size: 0.75rem; + font-family: var(--font-mono); + white-space: nowrap; + } + + .ticket-card-actions { + display: flex; + gap: 0.25rem; + } + + .ticket-card-actions button { + padding: 0.4rem; + min-width: 32px; + min-height: 32px; + background: transparent; + border: 1px solid var(--terminal-green); + color: var(--terminal-green); + cursor: pointer; + font-size: 0.9rem; + } + + .ticket-card-actions button:hover { + background: var(--terminal-green); + color: var(--bg-primary); + } + + /* Sidebar adjustments */ .dashboard-sidebar { width: 200px; } @@ -582,69 +695,52 @@ h1 { .stats-widgets .stats-row { grid-template-columns: repeat(3, 1fr); } +} - table { - font-size: 0.8rem; +/* Tablet view (900px - 1399px) */ +@media (min-width: 900px) and (max-width: 1399px) { + .dashboard-layout { + gap: 1rem; + padding: 0 0.5rem; } - th, td { - padding: 6px 8px; - } - - /* Hide more columns on medium screens */ - table th:nth-child(5), - table td:nth-child(5), - table th:nth-child(8), - table td:nth-child(8), - table th:nth-child(9), - table td:nth-child(9), - table th:nth-child(10), - table td:nth-child(10) { - display: none; + .ticket-card-row { + grid-template-columns: auto 1fr auto auto; } } -/* Medium desktop (900px - 999px) */ -@media (min-width: 900px) and (max-width: 999px) { - .stats-widgets .stats-row { - grid-template-columns: repeat(3, 1fr); - } - - .dashboard-toolbar { - flex-wrap: wrap; - gap: 1rem; - } - - .toolbar-center { - order: 3; - width: 100%; - justify-content: flex-start; - } - +/* Small tablet (600px - 899px) */ +@media (min-width: 600px) and (max-width: 899px) { .dashboard-sidebar { width: 180px; } - table { - font-size: 0.8rem; + .stats-widgets .stats-row { + grid-template-columns: repeat(2, 1fr); } - th, td { - padding: 6px 8px; + .ticket-card-row { + grid-template-columns: 1fr auto; + grid-template-rows: auto auto; } - /* Hide even more columns */ - table th:nth-child(4), - table td:nth-child(4), - table th:nth-child(5), - table td:nth-child(5), - table th:nth-child(8), - table td:nth-child(8), - table th:nth-child(9), - table td:nth-child(9), - table th:nth-child(10), - table td:nth-child(10) { - display: none; + .ticket-card-id { + grid-column: 1; + grid-row: 1; + } + + .ticket-card-main { + grid-column: 1 / -1; + grid-row: 2; + } + + .ticket-card-status { + grid-column: 2; + grid-row: 1; + } + + .ticket-card-actions { + display: none; /* Hide on small tablets, access via tap */ } } @@ -1470,6 +1566,18 @@ button:active { transform: translateY(-2px); } +/* ===== RESPONSIVE TICKET CARDS - Hidden on desktop ===== */ +.ticket-cards { + display: none; +} + +.ticket-card-empty { + padding: 3rem; + text-align: center; + color: var(--terminal-green); + font-family: var(--font-mono); +} + /* ===== TABLE STYLES - TERMINAL EDITION ===== */ table { width: 100%; @@ -5140,7 +5248,7 @@ table td:nth-child(4) { display: none; /* Hide pagination in toolbar - show at bottom */ } - /* ===== TABLE WRAPPER ===== */ + /* ===== TICKET CARDS - Mobile optimized ===== */ .ascii-frame-outer { margin: 0.5rem 0; border-width: 2px; @@ -5162,43 +5270,73 @@ table td:nth-child(4) { .table-wrapper { width: 100%; - overflow-x: visible; } - .table-wrapper table { - min-width: auto; + /* Hide the ::before header on mobile - we use a simpler one */ + .table-wrapper::before { + display: none; + } + + /* Mobile-optimized card layout */ + .ticket-cards { + padding: 0.25rem; + gap: 0.25rem; + } + + .ticket-card-row { + display: flex; + flex-direction: column; + gap: 0.5rem; + padding: 0.75rem; + border-left-width: 4px; + } + + .ticket-card-id { + font-size: 0.9rem; + font-weight: bold; + } + + .ticket-card-id a { + display: inline-block; + padding: 0.25rem 0; + min-height: 44px; + line-height: 2; + } + + .ticket-card-main { width: 100%; } - table { + .ticket-card-title { + font-size: 1rem; + line-height: 1.4; + margin-bottom: 0.5rem; + } + + .ticket-card-meta { + font-size: 0.8rem; + gap: 0.75rem; + } + + .ticket-card-status { + align-self: flex-start; + padding: 0.35rem 0.75rem; font-size: 0.8rem; } - table th, - table td { - padding: 0.75rem 0.5rem; - white-space: normal; - word-wrap: break-word; + .ticket-card-actions { + display: flex; + gap: 0.5rem; + margin-top: 0.5rem; + padding-top: 0.5rem; + border-top: 1px solid rgba(0, 255, 65, 0.2); } - /* Make ticket ID and title columns wider */ - table th:nth-child(1), - table td:nth-child(1) { - min-width: 100px; - } - - table th:nth-child(3), - table td:nth-child(3) { - min-width: 200px; - white-space: normal; - } - - /* Link touch targets */ - table td a { - display: inline-block; - padding: 0.5rem 0; + .ticket-card-actions button { + flex: 1; min-height: 44px; - line-height: 1.5; + padding: 0.5rem; + font-size: 1.1rem; } /* ===== BULK ACTIONS ===== */ diff --git a/views/DashboardView.php b/views/DashboardView.php index 1a16bf7..c42ddca 100644 --- a/views/DashboardView.php +++ b/views/DashboardView.php @@ -12,11 +12,11 @@ $nonce = SecurityHeadersMiddleware::getNonce();