﻿/* PixelReports - Modern Enterprise Dashboard Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700&display=swap');

:root {
    /* Color Palette - Premium Enterprise */
    /* Primary: Deep, Trustworthy Navy */
    --primary: #0f172a;
    /* Slate 900 */
    --primary-light: #334155;
    /* Slate 700 */
    --primary-dark: #020617;
    /* Slate 950 */

    /* Secondary/Neutral */
    --secondary: #64748b;
    /* Slate 500 */
    --secondary-light: #94a3b8;
    /* Slate 400 */

    /* Accent: Refined, Professional Orange/Gold */
    --accent: #ea580c;
    /* Orange 600 - Visible but not neon */
    --accent-light: #f97316;
    /* Orange 500 */
    --accent-dark: #c2410c;
    /* Orange 700 */

    /* Status Colors - Modern & Accessible */
    --success: #15803d;
    /* Green 700 */
    --success-light: #22c55e;
    /* Green 500 */
    --warning: #b45309;
    /* Amber 700 */
    --warning-light: #f59e0b;
    /* Amber 500 */
    --danger: #b91c1c;
    /* Red 700 */
    --danger-light: #ef4444;
    /* Red 500 */

    /* Backgrounds */
    --bg-main: #f8fafc;
    /* Slate 50 - Cool light gray */
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    /* Matches primary for seamless look */
    --bg-input: #ffffff;
    --bg-hover: #f1f5f9;
    /* Slate 100 */

    /* Typography */
    --text-main: #1e293b;
    /* Slate 800 */
    --text-secondary: #475569;
    /* Slate 600 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --text-light: #ffffff;
    --text-sidebar: #e2e8f0;
    /* Slate 200 */

    /* Borders & Shadows */
    --border-color: #cbd5e1;
    /* Slate 300 */
    --border-light: #e2e8f0;
    /* Slate 200 */

    /* Modern Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* Dimensions & Spacing */
    --radius-sm: 4px;
    --radius-md: 8px;
    /* Professional, not too round */
    --radius-lg: 12px;
    --radius-xl: 16px;

    --sidebar-width: 260px;
    --header-height: 64px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

h1,
h2,
h3,
h4,
.brand-font {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* ================================
   LAYOUT - Desktop Sidebar
================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-light);
}

.sidebar-logo svg {
    width: 32px;
    height: 32px;
    color: var(--accent);
}

.sidebar-logo span {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-sidebar);
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

.nav-item.active {
    background: rgba(0, 0, 0, 0.3);
    /* Stronger contrast for active state */
    border-left-color: var(--accent);
    color: var(--text-light);
    font-weight: 600;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item.logout {
    color: rgba(255, 255, 255, 0.6);
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item.logout:hover {
    color: var(--danger-light);
    background: rgba(198, 40, 40, 0.15);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Header Bar */
.top-header {
    background: var(--bg-card);
    /* Keep white for professional look */
    height: var(--header-height);
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Container */
.container {
    padding: 2rem;
    flex: 1;
}

/* ================================
   CARDS
================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    /* Keep subtle border for definition */
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    /* Side accent instead of top bar for cleaner look */
    height: 100%;
    background: var(--primary);
    opacity: 0.8;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 0, 0, 0.05);
}

.stat-card .header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.stat-card .icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card .icon-box svg {
    width: 22px;
    height: 22px;
}

.stat-card .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    margin: 0.25rem 0;
}

.stat-card .trend {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-card .link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

.stat-card .link:hover {
    color: var(--accent);
}

/* Stat card variations */
.stat-card.danger::before {
    background: var(--danger);
}

.stat-card.success::before {
    background: var(--success);
}

.stat-card.warning::before {
    background: var(--warning);
}

.stat-card.accent::before {
    background: var(--accent);
}

/* ================================
   TABLES
================================ */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--bg-main);
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    /* Thinner border */
    white-space: nowrap;
}

td {
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--bg-hover);
    /* Use variable */
    transform: scale(1);
    /* unintended side effects often happen with scale on rows, keeping it simple */
}

/* ================================
   FORMS
================================ */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-input);
    color: var(--text-main);
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ================================
   BUTTONS
================================ */
button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    /* Slightly smaller vertical padding */
    border-radius: var(--radius-md);
    /* Softer corners */
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    /* Ensure border box consistency */
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    /* Subtle depth */
}

button,
.btn-primary {
    background: var(--primary);
    color: var(--text-light);
}

button:hover,
.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background: var(--accent);
    color: var(--text-light);
}

.btn-accent:hover {
    background: var(--accent-dark);
}

.btn-success {
    background: var(--success);
    color: var(--text-light);
}

.btn-success:hover {
    background: var(--success-light);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-light);
}

.btn-danger:hover {
    background: var(--danger-light);
}

.btn-secondary {
    background: var(--bg-main);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* ================================
   BADGES
================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-Nova {
    background: rgba(46, 125, 50, 0.12);
    color: var(--success);
}

.status-Vista {
    background: rgba(245, 124, 0, 0.12);
    color: var(--warning);
}

.status-Resolvida {
    background: rgba(84, 110, 122, 0.12);
    color: var(--text-secondary);
}

/* ================================
   MODALS
================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    padding: 0.5rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ================================
   ALERTS
================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-error {
    background: rgba(198, 40, 40, 0.1);
    color: var(--danger);
    border: 1px solid rgba(198, 40, 40, 0.2);
}

.alert-success {
    background: rgba(46, 125, 50, 0.1);
    color: var(--success);
    border: 1px solid rgba(46, 125, 50, 0.2);
}

.alert-warning {
    background: rgba(245, 124, 0, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 124, 0, 0.2);
}

/* ================================
   UTILITIES
================================ */
.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* ================================
   LOGIN PAGE
================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo svg {
    width: 56px;
    height: 56px;
    color: var(--accent);
}

.login-logo h2 {
    margin-top: 1rem;
    font-size: 1.5rem;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ================================
   PUBLIC FORM (registar.php)
================================ */
.public-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.public-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.public-header {
    text-align: center;
    margin-bottom: 2rem;
}

.public-header svg {
    width: 52px;
    height: 52px;
    color: var(--accent);
    margin-bottom: 1rem;
}

.public-header h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.public-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.success-view {
    text-align: center;
    display: none;
}

.success-view svg {
    width: 72px;
    height: 72px;
    color: var(--success);
    margin-bottom: 1.25rem;
}

.form-status {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    display: none;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ================================
   MOBILE RESPONSIVE
================================ */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding-bottom: 80px;
        /* Space for bottom nav */
    }

    /* Mobile Bottom Navigation */
    .mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        padding: 0.5rem 0;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox */
    }

    .mobile-nav::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .mobile-nav a {
        flex: 0 0 auto;
        min-width: 60px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.5rem 0.75rem;
        color: var(--text-muted);
        font-size: 0.6rem;
        font-weight: 500;
        gap: 0.25rem;
        transition: var(--transition);
        text-decoration: none;
    }

    .mobile-nav a svg {
        width: 22px;
        height: 22px;
    }

    .mobile-nav a.active {
        color: var(--primary);
    }

    .mobile-nav a.active svg {
        color: var(--accent);
    }

    .mobile-nav a.logout {
        color: var(--danger);
    }

    /* Mobile Header */
    .top-header {
        padding: 1rem;
    }

    .top-header .mobile-logo {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
    }

    .top-header .mobile-logo svg {
        width: 28px;
        height: 28px;
        color: var(--accent);
    }

    .top-header .mobile-logo span {
        font-family: 'Outfit', sans-serif;
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--primary);
    }

    .container {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .value {
        font-size: 1.5rem;
    }

    .stat-card .icon-box {
        width: 36px;
        height: 36px;
    }

    .stat-card .icon-box svg {
        width: 18px;
        height: 18px;
    }

    .flex-between {
        flex-direction: column;
        align-items: stretch;
    }

    .flex-between>div {
        text-align: center;
    }

    .flex-between>button,
    .flex-between>a.btn,
    .flex-between>a.btn-accent {
        width: 100%;
    }

    /* Tables Mobile */
    .table-responsive {
        margin: 0 -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    th,
    td {
        padding: 0.75rem 0.875rem;
        font-size: 0.8rem;
    }

    th {
        font-size: 0.65rem;
    }

    /* Hide less important columns */
    th:nth-child(n+4):not(:last-child),
    td:nth-child(n+4):not(:last-child) {
        display: none;
    }

    /* Forms Mobile */
    input,
    select,
    textarea {
        padding: 0.875rem 1rem;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    /* Modal Mobile */
    .modal-content {
        max-width: 100%;
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        border-radius: var(--radius-md);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .stat-card .header {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .stat-card .icon-box {
        align-self: flex-end;
    }

    .public-card {
        padding: 1.5rem;
    }

    .login-card {
        padding: 2rem;
    }
}

/* Desktop: Hide mobile elements */
@media (min-width: 993px) {
    .mobile-nav {
        display: none !important;
    }

    .top-header .mobile-logo {
        display: none !important;
    }
}

/* ================================
   PRINT STYLES
================================ */
@media print {

    .sidebar,
    .mobile-nav,
    .top-header {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .modal-overlay {
        position: absolute;
        background: white !important;
    }

    button,
    .btn {
        display: none;
    }
}

/* ================================
   MOBILE CARD TABLES & ENHANCEMENTS
   ================================ */
@media (max-width: 992px) {

    /* Transform Tables to Cards */
    .table-responsive table,
    .table-responsive thead,
    .table-responsive tbody,
    .table-responsive th,
    .table-responsive td,
    .table-responsive tr {
        display: block;
    }

    /* Hide Header Row */
    .table-responsive thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-responsive tr {
        border: 1px solid var(--border-color);
        margin-bottom: 1rem;
        background: var(--bg-card);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        padding: 0;
        overflow: hidden;
    }

    .table-responsive td {
        border: none;
        border-bottom: 1px solid var(--border-light);
        position: relative;
        padding: 0.875rem 1rem;
        padding-left: 40%;
        text-align: right;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        min-height: 48px;
    }

    .table-responsive td:before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 35%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.75rem;
        color: var(--text-secondary);
        top: 50%;
        transform: translateY(-50%);
    }

    /* Override hidden columns rule */
    th:nth-child(n+4):not(:last-child),
    td:nth-child(n+4):not(:last-child) {
        display: flex !important;
    }

    /* Actions Row */
    .table-responsive td:last-child {
        border-bottom: none;
        display: flex;
        justify-content: center;
        padding: 1rem;
        padding-left: 1rem;
        background: var(--bg-main);
    }

    .table-responsive td:last-child:before {
        display: none;
    }

    .table-responsive td:last-child div {
        width: 100%;
        justify-content: space-between !important;
    }

    .table-responsive td:last-child button {
        flex: 1;
    }

    /* Make QR Button Full Width in Mobile */
    .qr-btn {
        width: 100% !important;
        margin-top: 5px;
        margin-bottom: 5px;
    }

    /* Modal Mobile Fixes */
    .modal-content {
        margin: 1rem;
        width: auto;
        max-width: none;
    }

    /* Additional Mobile Overflow Fixes */
    .container {
        max-width: 100%;
        overflow-x: hidden;
    }

    .main-content {
        max-width: 100vw;
        overflow-x: hidden;
    }

    .top-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    .top-header>div {
        flex-wrap: wrap;
        max-width: 100%;
    }

    /* Text overflow handling */
    .table-responsive td,
    .card,
    .stat-card {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Badge text no wrap */
    .badge {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Header role badge hide on small screens */
    .top-header>div:last-child>div[style*="border-radius: 50px"] {
        max-width: 120px;
        overflow: hidden;
    }
}

/* ================================
   CLI ACTIVITY LOGS WIDGET
================================ */
.cli-widget {
    position: relative;
}

.cli-icon-box {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1e1e2f 0%, #2d2d44 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00d26a;
}

.cli-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 210, 106, 0.1);
    border-radius: 50px;
    font-size: 0.75rem;
    color: #00d26a;
}

.cli-status-dot {
    width: 8px;
    height: 8px;
    background: #00d26a;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.85);
    }
}

.cli-terminal {
    background: linear-gradient(180deg, #0d0d12 0%, #1a1a24 100%);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    min-height: 200px;
    max-height: 280px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cli-output {
    height: calc(100% - 24px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.cli-output::-webkit-scrollbar {
    width: 6px;
}

.cli-output::-webkit-scrollbar-track {
    background: transparent;
}

.cli-output::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.cli-line {
    display: flex;
    gap: 0.6rem;
    padding: 0.15rem 0;
    animation: fadeInLine 0.3s ease;
    flex-wrap: wrap;
}

@keyframes fadeInLine {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cli-timestamp {
    color: #6c7086;
    flex-shrink: 0;
    min-width: 60px;
}

.cli-level {
    font-weight: 600;
    padding: 0 0.4rem;
    border-radius: 3px;
    flex-shrink: 0;
    min-width: 44px;
    text-align: center;
    font-size: 0.7rem;
}

.log-info {
    background: rgba(0, 210, 106, 0.2);
    color: #00d26a;
}

.log-warn {
    background: rgba(255, 183, 77, 0.2);
    color: #ffb74d;
}

.log-error {
    background: rgba(239, 83, 80, 0.2);
    color: #ef5350;
}

.log-system {
    background: rgba(100, 149, 237, 0.2);
    color: #6495ed;
}

.log-inventory {
    background: rgba(156, 39, 176, 0.2);
    color: #ce93d8;
}

.log-scan {
    background: rgba(0, 188, 212, 0.2);
    color: #00bcd4;
}

.cli-msg {
    color: #a6adc8;
    flex: 1;
    word-break: break-word;
}

.cli-input-line {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.5rem;
}

.cli-prompt {
    color: #00d26a;
    font-weight: 600;
}

.cli-cursor {
    color: #00d26a;
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Dark theme adjustments for CLI widget */
[data-theme="dark"] .cli-widget .card {
    background: var(--bg-card);
}

/* Light theme CLI still dark (intentional for terminal feel) */
.cli-terminal {
    background: linear-gradient(180deg, #0d0d12 0%, #1a1a24 100%) !important;
}

/* Mobile adjustments for CLI */
@media (max-width: 768px) {
    .cli-terminal {
        font-size: 0.7rem;
        padding: 0.75rem;
        min-height: 180px;
        max-height: 240px;
    }

    .cli-timestamp {
        min-width: 50px;
        font-size: 0.65rem;
    }

    .cli-level {
        font-size: 0.6rem;
        min-width: 36px;
        padding: 0 0.25rem;
    }

    .cli-status-text {
        display: none;
    }

    .cli-prompt {
        font-size: 0.7rem;
    }
}