:root {
    --brand: #F26822;
    --accent: #F6BC38;
    --bg: #000000;
    --surface: #111111;
    --text: #f5f5f5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
}

body {
    background: radial-gradient(circle at top, rgba(242,104,34,0.25), transparent),
                var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
    position: relative;
}

.global-search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text);
}

.global-search-input:focus {
    border-color: var(--brand);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--accent);
}

.search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    margin-top: 0.25rem;
    max-height: 400px;
    overflow-y: auto;
}

.search-suggestions a {
    display: block;
}

.user-info {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-email {
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.user-menu-wrapper {
    display: inline-block;
    position: relative;
}

.user-menu-btn {
    cursor: pointer;
}

.user-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    min-width: 200px;
    padding: 0.5rem 0;
}

.user-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
}

.user-menu a:hover {
    background: rgba(242, 104, 34, 0.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.brand--home {
    cursor: pointer;
}

.brand--home:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.brand__logo-img {
    height: 45px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.brand__logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand);
}

.brand__name {
    font-size: 1rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    color: var(--text);
}

.btn-light {
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--text);
}

.page {
    padding: 2rem;
    max-width: 100%;
    overflow-x: hidden;
}

/* Ensure all pages use responsive container */
.page > section {
    max-width: 100%;
    overflow-x: hidden;
}

.auth {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
}

.auth-card, .card {
    background: rgba(17, 17, 17, 0.9);
    padding: 2rem;
    border-radius: 1rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-card h1, .card h1 {
    margin-bottom: 0.5rem;
}

.muted {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.5rem;
}

.muted.small {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-form input {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text);
}

.auth-form button {
    background: linear-gradient(120deg, var(--brand), var(--accent));
    border: none;
    color: #000;
    font-weight: 600;
    padding: 0.9rem;
    border-radius: 0.5rem;
    cursor: pointer;
}

.dashboard {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
}

.sidebar {
    background: rgba(17, 17, 17, 0.9);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-home {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.home-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: rgba(242, 104, 34, 0.1);
    border: 1px solid rgba(242, 104, 34, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
}

.home-button:hover {
    background: rgba(242, 104, 34, 0.2);
    border-color: rgba(242, 104, 34, 0.5);
    transform: scale(1.05);
}

.home-logo {
    height: 50px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    display: block;
}

.home-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand);
    display: inline-block;
}

.sidebar ul,
.nav-menu {
    list-style: none;
    margin-top: 1rem;
}

.sidebar li,
.nav-item {
    margin-bottom: 0.5rem;
}

.sidebar a,
.nav-link {
    display: block;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
    color: var(--text);
    text-decoration: none;
}

.sidebar a:hover,
.nav-link:hover {
    background: rgba(242, 104, 34, 0.2);
}

.nav-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.nav-parent .nav-link {
    flex: 1;
}

.nav-toggle {
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    border-radius: 0.25rem;
}

.nav-toggle:hover {
    background: rgba(246, 188, 56, 0.1);
}

.nav-item.active .nav-toggle {
    transform: rotate(180deg);
}

.nav-submenu {
    list-style: none;
    margin: 0.5rem 0 0 1rem;
    padding-left: 0.5rem;
    border-left: 2px solid rgba(246, 188, 56, 0.3);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-item.active .nav-submenu {
    max-height: 500px;
}

.nav-sublink {
    display: block;
    padding: 0.4rem 0.75rem;
    border-radius: 0.4rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-sublink:hover {
    background: rgba(246, 188, 56, 0.15);
    color: var(--accent);
    padding-left: 1rem;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel {
    background: rgba(17, 17, 17, 0.9);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.badge {
    background: rgba(246, 188, 56, 0.2);
    color: var(--accent);
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 0.75rem 0.5rem;
}

thead {
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Flash messages removed - silent backend handling */

.module-placeholder, .access-denied {
    display: flex;
    justify-content: center;
    margin-top: 4rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.eyebrow {
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.btn-primary, .btn-secondary, .btn-danger, .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(120deg, var(--brand), var(--accent));
    color: #000;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(255, 92, 92, 0.2);
    color: #ff5c5c;
    border: 1px solid rgba(255, 92, 92, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--accent);
    border: 1px dashed rgba(246, 188, 56, 0.4);
}

.btn-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    opacity: 0.6;
    cursor: not-allowed;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.pagination {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

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

.summary-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1rem;
}

.summary-card p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.4rem;
}

.summary-card h2 {
    font-size: 1.5rem;
}

.quick-links {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.performance-body {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.chart-placeholder {
    flex: 1;
    display: flex;
    justify-content: center;
}

.chart-ring {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #111 64%, transparent 65%),
        conic-gradient(var(--accent) var(--progress), rgba(255, 255, 255, 0.08) 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.chart-ring small {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

.performance-stats {
    flex: 1;
}

.performance-stats ul {
    list-style: none;
    margin-top: 1rem;
}

.performance-stats li {
    margin-bottom: 0.5rem;
}

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

.form-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-control span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.form-control input,
.form-control select,
.form-control textarea {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text);
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.form-control--full {
    grid-column: 1 / -1;
}

.order-items,
.quote-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.order-item-row,
.quote-item-row {
    display: grid;
    grid-template-columns: 2fr 120px 40px;
    gap: 0.5rem;
}

.btn-icon {
    border-radius: 0.5rem;
    height: 100%;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
}

.hire-activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.activity-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.activity-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
}

.status-pill {
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    white-space: nowrap;
}

.status-pill.warning {
    border-color: rgba(246, 188, 56, 0.6);
    color: var(--accent);
}

.status-pill.success {
    border-color: rgba(46, 204, 113, 0.6);
    color: #2ecc71;
}

.empty-state {
    justify-content: center;
    text-align: center;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

.item-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: rgba(255, 255, 255, 0.8);
}

.quote-print {
    background: #fff;
    color: #111;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.quote-print h2,
.quote-print h3,
.quote-print h4 {
    color: #111;
}

.quote-print p {
    color: #333;
}

.quote-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.quote-header > div:first-child {
    display: flex;
    flex-direction: column;
}

.quote-party,
.quote-totals {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.quote-meta p {
    margin-bottom: 0.25rem;
}

.quote-party > div {
    flex: 1;
    min-width: 200px;
}

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

.quote-table th,
.quote-table td {
    color: #111;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.75rem 0.5rem;
}

.quote-totals > div {
    flex: 1;
    min-width: 200px;
}

.quote-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}

@media print {
    body {
        background: #fff;
        color: #111;
    }

    .topbar,
    .page-header,
    .flash-container,
    .btn-primary,
    .btn-secondary,
    .btn-ghost,
    .quick-links {
        display: none !important;
    }

    .page {
        padding: 0;
    }

    .quote-print {
        box-shadow: none;
        border: none;
        padding: 0;
    }
}

.responsive-table td[data-label] {
    position: relative;
}

@media (max-width: 600px) {
    .order-item-row {
        grid-template-columns: 1fr;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tr {
        display: flex;
        flex-direction: column;
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .responsive-table td[data-label]::before {
        content: attr(data-label);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: rgba(255, 255, 255, 0.5);
        display: block;
    }
}

@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .page {
        padding: 1rem;
    }
}

/* University Module Styles */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s, border-color 0.2s;
}

.course-card:hover {
    border-color: rgba(242, 104, 34, 0.4);
    transform: translateY(-2px);
}

.course-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.course-card__header h3 {
    font-size: 1.25rem;
    margin: 0;
    flex: 1;
}

.course-card__description {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    flex: 1;
}

.course-card__meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.course-card__actions {
    margin-top: auto;
}

.materials-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.material-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    flex-wrap: wrap;
}

.material-item__content {
    flex: 1;
    min-width: 200px;
}

.material-item__content h4 {
    margin-bottom: 0.25rem;
}

.material-item__actions {
    flex-shrink: 0;
}

.material-detail {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.material-detail__info dl {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.material-detail__info dt {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.material-detail__info dd {
    color: var(--text);
}

.material-detail__info code {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.9rem;
}

.material-detail__note {
    padding: 1rem;
    background: rgba(246, 188, 56, 0.1);
    border: 1px solid rgba(246, 188, 56, 0.2);
    border-radius: 0.5rem;
}

/* Logo Styles for Print Documents */
.invoice-logo,
.receipt-logo,
.quote-logo,
.run-sheet-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 1rem;
    display: block;
}

@media print {
    .invoice-logo,
    .receipt-logo,
    .quote-logo,
    .run-sheet-logo {
        max-width: 150px;
        margin-bottom: 0.75rem;
    }
}

/* Invoice and Receipt Print Styles */
.invoice-print,
.receipt-print {
    background: white;
    color: #000;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.invoice-header,
.receipt-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #000;
    align-items: flex-start;
}

.invoice-header > div:first-child,
.receipt-header > div:first-child {
    display: flex;
    flex-direction: column;
}

.invoice-meta,
.receipt-meta {
    text-align: right;
}

.invoice-party,
.receipt-party {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.invoice-summary,
.receipt-summary {
    margin: 2rem 0;
}

.invoice-totals,
.receipt-totals {
    text-align: right;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0.5rem;
}

.invoice-footer,
.receipt-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.7);
}

.invoice-payments {
    margin-top: 2rem;
}

.badge-draft,
.badge-issued,
.badge-paid,
.badge-overdue,
.badge-pending,
.badge-in-progress,
.badge-complete {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-draft {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.badge-issued {
    background: rgba(246, 188, 56, 0.3);
    color: var(--accent);
}

.badge-paid {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
}

.badge-overdue {
    background: rgba(255, 0, 0, 0.3);
    color: #ff6666;
}

.badge-pending {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.badge-in-progress {
    background: rgba(246, 188, 56, 0.3);
    color: var(--accent);
}

.badge-complete {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
}

@media print {
    .invoice-print,
    .receipt-print,
    .quote-print {
        background: white;
        color: #000;
    }

    .page-header,
    .quick-links {
        display: none;
    }
}

@media (max-width: 600px) {
    .topbar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .performance-body {
        flex-direction: column;
    }

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

    .material-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .material-detail__info dl {
        grid-template-columns: 1fr;
    }

    .invoice-party,
    .receipt-party {
        grid-template-columns: 1fr;
    }

    .invoice-header,
    .receipt-header {
        flex-direction: column;
    }

    .invoice-meta,
    .receipt-meta {
        text-align: left;
    }
}

/* Modern Form Layout Styles */
.form-modern {
    width: 100%;
}

.form-grid-modern {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group-modern {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group-modern label {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.02em;
}

.form-group-modern input,
.form-group-modern select,
.form-group-modern textarea {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s, background 0.2s;
}

.form-group-modern input:focus,
.form-group-modern select:focus,
.form-group-modern textarea:focus {
    outline: none;
    border-color: var(--brand);
    background: rgba(0, 0, 0, 0.6);
}

.form-group-modern textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-actions-modern {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 1.5rem;
}

/* Enhanced Table Styles */
.table-enhanced th,
.table-enhanced td {
    padding: 1rem 1.25rem;
    line-height: 1.6;
}

.table-enhanced tbody tr {
    transition: background 0.2s;
}

.table-enhanced tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Mobile Card Views */
.card-list-mobile {
    display: none;
}

.task-card,
.payroll-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: transform 0.2s, border-color 0.2s;
}

.task-card:hover,
.payroll-card:hover {
    border-color: rgba(242, 104, 34, 0.3);
    transform: translateY(-2px);
}

.task-card__header,
.payroll-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.task-card__header h4,
.payroll-card__header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.payroll-card__amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.task-card__body,
.payroll-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.task-card__field,
.payroll-card__field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.task-card__label,
.payroll-card__label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
}

.task-card__value,
.payroll-card__value {
    font-size: 0.95rem;
    color: var(--text);
}

.task-card__actions,
.payroll-card__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(120deg, var(--brand), var(--accent));
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(242, 104, 34, 0.4);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 1000;
    text-decoration: none;
    border: none;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(242, 104, 34, 0.6);
}

.fab:active {
    transform: scale(0.95);
}

.fab-icon {
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
}

.btn-desktop-only {
    display: inline-flex;
}

/* Responsive Styles for Forms and Cards */
@media (max-width: 768px) {
    .form-grid-modern {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .form-group-modern {
        gap: 0.5rem;
    }

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

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

    .table-desktop {
        display: none;
    }

    .card-list-mobile {
        display: block;
    }

    .btn-desktop-only {
        display: none;
    }

    .fab {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 56px;
        height: 56px;
    }
}

@media (min-width: 769px) {
    .card-list-mobile {
        display: none;
    }

    .table-desktop {
        display: block;
    }
}

/* Dashboard KPI Cards */
.kpi-bar {
    margin-bottom: 1.5rem;
}

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

.kpi-card {
    background: rgba(242, 104, 34, 0.15);
    border: 1px solid rgba(242, 104, 34, 0.3);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(242, 104, 34, 0.3);
}

.kpi-card.kpi-primary {
    background: linear-gradient(135deg, rgba(242, 104, 34, 0.2), rgba(246, 188, 56, 0.15));
    border-color: rgba(246, 188, 56, 0.4);
}

.kpi-icon {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
}

.kpi-content p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.kpi-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #F6BC38;
    margin: 0;
}

/* Charts Section */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-panel {
    min-height: 350px;
}

.chart-container {
    position: relative;
    height: 300px;
    margin-top: 1rem;
}

/* Events List */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.event-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: transform 0.2s, border-color 0.2s;
}

.event-card:hover {
    border-color: rgba(246, 188, 56, 0.4);
    transform: translateY(-2px);
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.event-card-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.event-card-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.event-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.event-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.event-value {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
}

.event-card-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Pipeline Preview */
.pipeline-preview {
    margin-bottom: 1.5rem;
}

.pipeline-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.pipeline-column {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1rem;
}

.pipeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.pipeline-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.pipeline-count {
    background: rgba(246, 188, 56, 0.2);
    color: var(--accent);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pipeline-progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.pipeline-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    transition: width 0.3s;
}

.pipeline-empty {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 0.5rem 0;
}

/* Tasks & Alerts Panel */
.tasks-alerts-panel {
    margin-bottom: 1.5rem;
}

.tasks-alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.tasks-section h4,
.alerts-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tasks-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
}

.tasks-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.task-header strong {
    font-size: 0.9rem;
    font-weight: 600;
}

.task-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.alerts-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    padding: 1rem;
}

.alert-item.alert-warning {
    border-left: 4px solid var(--accent);
}

.alert-item.alert-danger {
    border-left: 4px solid #ff5c5c;
}

.alert-item.alert-info {
    border-left: 4px solid #3498db;
}

.alert-item strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.alert-item p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.alert-link {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
}

.alert-link:hover {
    text-decoration: underline;
}

/* ============================================================================
   MOBILE RESPONSIVE STYLES
   ============================================================================ */

/* Mobile Navigation */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
}

.mobile-nav-drawer.active {
    left: 0;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
}

.mobile-nav-logo img {
    height: 32px;
    width: auto;
}

.mobile-nav-close {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.mobile-nav-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-nav-content {
    padding: 1rem 0;
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    margin: 0;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
    border-left: 3px solid transparent;
}

.mobile-nav-link:hover {
    background: rgba(242, 104, 34, 0.1);
    border-left-color: var(--brand);
}

.mobile-nav-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-nav-toggle {
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.mobile-nav-item.active .mobile-nav-toggle {
    transform: rotate(180deg);
}

.mobile-nav-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.mobile-nav-item.active .mobile-nav-submenu {
    max-height: 500px;
}

.mobile-nav-submenu li a {
    display: block;
    padding: 0.5rem 1rem 0.5rem 2rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.mobile-nav-submenu li a:hover {
    background: rgba(246, 188, 56, 0.15);
    color: var(--accent);
    padding-left: 2.5rem;
}

/* Table Responsive Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 600px;
}

/* Responsive Container */
.container-responsive {
    width: 100%;
    max-width: 100%;
    padding: 0 1rem;
    margin: 0 auto;
}

/* ============================================================================
   TABLET & MOBILE BREAKPOINTS (max-width: 768px)
   ============================================================================ */

@media (max-width: 768px) {
    /* Header & Topbar */
    .topbar {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

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

    .brand__name {
        font-size: 0.85rem;
    }

    .brand__logo-img {
        height: 35px;
        max-width: 100px;
    }

    .search-container {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 0;
        flex: 1 1 100%;
    }

    .global-search-input {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem 0.5rem 2rem;
    }

    .user-info {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.25rem;
    }

    .user-email {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    .user-role {
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.6);
    }

    /* Page Layout */
    .page {
        padding: 1rem;
    }

    /* Dashboard */
    .dashboard {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sidebar {
        display: none; /* Hide desktop sidebar on mobile */
    }

    /* Content */
    .content {
        gap: 1rem;
    }

    .panel {
        padding: 1rem;
        border-radius: 0.75rem;
    }

    /* Page Header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem 0;
    }

    .page-header .btn-primary,
    .page-header .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* Tables */
    .table-wrapper,
    .table-responsive {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .table-responsive table {
        font-size: 0.85rem;
    }

    .table-responsive th,
    .table-responsive td {
        padding: 0.5rem 0.25rem;
    }

    /* Forms */
    .form-grid,
    .form-grid-modern {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .form-control input,
    .form-control select,
    .form-control textarea,
    .form-group-modern input,
    .form-group-modern select,
    .form-group-modern textarea {
        width: 100%;
        font-size: 0.9rem;
        padding: 0.65rem 0.85rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

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

    /* Buttons */
    .btn-primary,
    .btn-secondary,
    .btn-ghost,
    .btn-danger {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        justify-content: center;
    }

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

    /* Cards & Grids */
    .kpi-grid,
    .charts-grid,
    .event-card-body,
    .pipeline-mini,
    .tasks-alerts-grid,
    .hire-activity-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Statistics Cards */
    .stat-card {
        padding: 1rem;
    }

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

    /* Quick Links */
    .quick-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .quick-links a {
        width: 100%;
        text-align: center;
    }

    /* Images */
    img {
        max-width: 100%;
        height: auto;
    }

    .brand__logo-img,
    .home-logo {
        max-width: 100%;
    }

    /* Flash messages removed */

    /* Panel Header */
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ============================================================================
   SMALL MOBILE BREAKPOINT (max-width: 480px)
   ============================================================================ */

@media (max-width: 480px) {
    /* Topbar */
    .topbar {
        padding: 0.5rem 0.75rem;
    }

    .brand__name {
        font-size: 0.75rem;
        letter-spacing: 0.1rem;
    }

    .brand__logo-img {
        height: 30px;
    }

    /* Page */
    .page {
        padding: 0.75rem;
    }

    /* Panel */
    .panel {
        padding: 0.75rem;
        border-radius: 0.5rem;
    }

    /* Typography */
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .eyebrow {
        font-size: 0.75rem;
    }

    /* Tables */
    .table-responsive table {
        font-size: 0.8rem;
        min-width: 500px;
    }

    .table-responsive th,
    .table-responsive td {
        padding: 0.4rem 0.2rem;
        font-size: 0.75rem;
    }

    /* Forms */
    .form-control input,
    .form-control select,
    .form-control textarea {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Buttons */
    .btn-primary,
    .btn-secondary,
    .btn-ghost {
        padding: 0.65rem 0.85rem;
        font-size: 0.85rem;
    }

    /* Mobile Nav */
    .mobile-nav-drawer {
        width: 260px;
    }

    /* User Menu */
    .user-menu {
        min-width: 180px;
        right: 0;
    }
}

/* ============================================================================
   FLOOR PLANNER MOBILE SUPPORT
   ============================================================================ */

@media (max-width: 768px) {
    .floorplanner-canvas-container {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .floorplanner-canvas {
        max-width: 100%;
        height: auto;
        touch-action: pan-x pan-y;
    }

    .floorplanner-toolbar {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    .floorplanner-toolbar button {
        flex-shrink: 0;
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }
}

/* ============================================================================
   CHART RESPONSIVE CONTAINERS
   ============================================================================ */

.chart-container-responsive {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 250px;
}

.chart-container-responsive canvas {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .chart-container-responsive {
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    .chart-container-responsive {
        min-height: 180px;
    }
}

/* ============================================================================
   PWA APP SHELL STYLES
   ============================================================================ */

/* PWA Body */
.pwa-body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* Safe area insets for iOS */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Loading Skeleton */
.loading-skeleton {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.skeleton-header {
    height: 60px;
    background: rgba(17, 17, 17, 0.9);
    margin-bottom: 1rem;
}

.skeleton-content {
    padding: 1rem;
}

.skeleton-card {
    height: 120px;
    background: rgba(17, 17, 17, 0.9);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* App Topbar (Sticky) */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.app-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.app-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.app-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.app-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.app-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
}

.app-logo {
    height: 32px;
    width: auto;
}

.app-brand-name {
    color: var(--brand);
}

.app-search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.app-search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text);
    outline: none;
    transition: all 0.2s;
}

.app-search-input:focus {
    border-color: var(--brand);
    background: rgba(0, 0, 0, 0.6);
}

.app-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--accent);
}

.app-search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    margin-top: 0.25rem;
    max-height: 400px;
    overflow-y: auto;
}

.app-search-results {
    padding: 0.5rem;
}

.app-search-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
}

.app-search-result:hover {
    background: rgba(242, 104, 34, 0.1);
}

.app-search-title {
    font-weight: 500;
}

.app-search-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.app-search-empty {
    padding: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.app-user-menu-wrapper {
    position: relative;
}

.app-user-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.app-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand);
    color: #000;
    font-weight: 700;
    font-size: 0.9rem;
}

.app-user-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    min-width: 200px;
    padding: 0.5rem 0;
}

.app-user-menu.active {
    display: block;
}

.app-user-info {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.5rem;
}

.app-user-info strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.app-user-info small {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.app-user-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
}

.app-user-menu a:hover {
    background: rgba(242, 104, 34, 0.1);
}

/* App Drawer (Side Navigation) */
.app-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.app-drawer-overlay.active {
    display: block;
    opacity: 1;
}

.app-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 999;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
}

.app-drawer.active {
    left: 0;
}

.app-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-drawer-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.app-drawer-close {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.app-drawer-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.app-drawer-content {
    padding: 1rem 0;
}

.app-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.app-nav-item {
    margin: 0;
}

.app-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
    border-left: 3px solid transparent;
}

.app-nav-link:hover {
    background: rgba(242, 104, 34, 0.1);
    border-left-color: var(--brand);
}

.app-nav-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-nav-toggle {
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.app-nav-item.active .app-nav-toggle {
    transform: rotate(180deg);
}

.app-nav-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.app-nav-item.active .app-nav-submenu {
    max-height: 500px;
}

.app-nav-submenu li a {
    display: block;
    padding: 0.5rem 1rem 0.5rem 2rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.app-nav-submenu li a:hover {
    background: rgba(246, 188, 56, 0.15);
    color: var(--accent);
    padding-left: 2.5rem;
}

/* App Main Content */
.app-main {
    min-height: calc(100vh - 60px - 60px); /* Subtract topbar and bottom nav */
    padding: 1rem;
    padding-bottom: calc(1rem + 60px); /* Space for bottom nav */
}

/* Bottom Navigation Bar (Mobile) */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.app-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s;
    flex: 1;
    max-width: 80px;
}

.app-bottom-nav-item.active {
    color: var(--brand);
}

.app-bottom-nav-icon {
    font-size: 1.5rem;
}

.app-bottom-nav-label {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Flash Messages */
/* Flash messages removed - silent backend handling */

/* Table to Card Conversion on Mobile */
@media (max-width: 768px) {
    .table-responsive table {
        display: block;
    }

    .table-responsive thead {
        display: none;
    }

    .table-responsive tbody {
        display: block;
    }

    .table-responsive tr {
        display: block;
        margin-bottom: 1rem;
        background: rgba(17, 17, 17, 0.9);
        border-radius: 0.5rem;
        padding: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .table-responsive td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

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

    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        color: rgba(255, 255, 255, 0.7);
        margin-right: 1rem;
    }

    .table-responsive .table-actions {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .table-responsive .table-actions a,
    .table-responsive .table-actions button {
        width: 100%;
    }
}

/* PWA Forms - Full Width Mobile */
@media (max-width: 768px) {
    .form-grid,
    .form-grid-modern {
        grid-template-columns: 1fr;
    }

    .form-control input,
    .form-control select,
    .form-control textarea,
    .form-group-modern input,
    .form-group-modern select,
    .form-group-modern textarea {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
    }

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

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

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
    .app-bottom-nav {
        display: none;
    }

    .app-main {
        padding-bottom: 1rem;
    }
}

/* Desktop: Show search container */
@media (min-width: 769px) {
    .app-search-container {
        display: block;
    }
}

/* Mobile: Hide search on very small screens */
@media (max-width: 480px) {
    .app-search-container {
        display: none;
    }
}

/* ============================================================================
   COMPREHENSIVE RESPONSIVE ENHANCEMENTS FOR ALL DEVICES
   ============================================================================ */

/* App Topbar - Mobile Responsive */
@media (max-width: 768px) {
    .app-topbar {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .app-brand {
        font-size: 1rem;
    }

    .app-logo {
        height: 28px;
    }

    .app-user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .app-user-menu {
        right: -0.5rem;
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .app-topbar {
        padding: 0.5rem;
    }

    .app-brand-name {
        font-size: 0.9rem;
    }

    .app-menu-toggle {
        padding: 0.25rem;
    }
}

/* App Drawer - Enhanced Mobile Support */
@media (max-width: 768px) {
    .app-drawer {
        width: 280px;
        max-width: 90vw;
    }

    .app-drawer-header {
        padding: 0.75rem;
    }

    .app-drawer-header h3 {
        font-size: 1rem;
    }

    .app-nav-link {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .app-nav-submenu li a {
        padding: 0.5rem 0.75rem 0.5rem 1.5rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .app-drawer {
        width: 260px;
        max-width: 85vw;
    }
}

/* Main Content - Responsive Padding */
@media (max-width: 768px) {
    .app-main {
        padding: 1rem 0.75rem;
        padding-bottom: calc(1rem + 60px);
    }
}

@media (max-width: 480px) {
    .app-main {
        padding: 0.75rem 0.5rem;
        padding-bottom: calc(0.75rem + 60px);
    }
}

/* Super Admin Badge - Mobile */
@media (max-width: 768px) {
    .super-admin-badge {
        font-size: 12px;
        padding: 6px 12px;
        top: 50px;
    }
}

/* Page Headers - Responsive */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header .btn-group {
        width: 100%;
        flex-direction: column;
    }

    .page-header .btn-group .btn {
        width: 100%;
    }
}

/* KPI Cards - Responsive Grid */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .kpi-card {
        padding: 1rem;
    }

    .kpi-icon {
        font-size: 2rem;
    }

    .kpi-content h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .kpi-card {
        flex-direction: row;
        align-items: center;
    }

    .kpi-icon {
        font-size: 1.75rem;
    }

    .kpi-content h2 {
        font-size: 1.25rem;
    }
}

/* Charts - Responsive */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .chart-container {
        height: 250px;
    }

    .chart-panel {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 200px;
    }

    .chart-panel {
        min-height: 250px;
    }
}

/* Cards - Responsive */
@media (max-width: 768px) {
    .card,
    .event-card,
    .task-card,
    .payroll-card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    .card-header,
    .event-card-header,
    .task-card__header,
    .payroll-card__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .card-actions,
    .event-card-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .card-actions .btn,
    .event-card-actions .btn {
        width: 100%;
    }
}

/* Tables - Enhanced Mobile Support */
@media (max-width: 768px) {
    .table-responsive {
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
    }

    .table-enhanced {
        font-size: 0.9rem;
    }

    .table-enhanced th,
    .table-enhanced td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .table-enhanced {
        font-size: 0.85rem;
    }

    .table-enhanced th,
    .table-enhanced td {
        padding: 0.5rem 0.25rem;
    }
}

/* Forms - Enhanced Mobile Support */
@media (max-width: 768px) {
    .form-grid,
    .form-grid-modern {
        gap: 1rem;
    }

    .form-group,
    .form-group-modern {
        margin-bottom: 1rem;
    }

    .form-actions,
    .form-actions-modern {
        gap: 0.75rem;
    }

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

/* Buttons - Mobile Touch Targets */
@media (max-width: 768px) {
    .btn {
        min-height: 44px; /* iOS recommended touch target */
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }

    .btn-sm {
        min-height: 36px;
        padding: 0.5rem 1rem;
    }
}

/* Flash messages removed */

/* Pipeline - Responsive */
@media (max-width: 768px) {
    .pipeline-mini {
        grid-template-columns: 1fr;
    }

    .pipeline-column {
        padding: 0.75rem;
    }
}

/* Tasks & Alerts - Responsive */
@media (max-width: 768px) {
    .tasks-alerts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Quote/Invoice/Receipt Print - Mobile */
@media (max-width: 768px) {
    .quote-print,
    .invoice-print,
    .receipt-print {
        padding: 1rem;
    }

    .quote-header,
    .invoice-header,
    .receipt-header {
        flex-direction: column;
        gap: 1rem;
    }

    .quote-party,
    .invoice-party,
    .receipt-party {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .quote-totals,
    .invoice-totals,
    .receipt-totals {
        text-align: left;
    }
}

/* Events List - Mobile */
@media (max-width: 768px) {
    .event-card-body {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* Quick Links - Mobile */
@media (max-width: 768px) {
    .quick-links {
        flex-direction: column;
        gap: 0.75rem;
    }

    .quick-links a {
        width: 100%;
        text-align: center;
    }
}

/* Pagination - Mobile */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }

    .pagination a,
    .pagination span {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Modal/Dialog - Mobile */
@media (max-width: 768px) {
    .modal,
    .dialog {
        width: 95%;
        max-width: 95%;
        margin: 1rem auto;
        padding: 1rem;
    }

    .modal-header,
    .dialog-header {
        padding: 0.75rem;
    }

    .modal-body,
    .dialog-body {
        padding: 1rem 0.75rem;
    }

    .modal-footer,
    .dialog-footer {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-footer .btn,
    .dialog-footer .btn {
        width: 100%;
    }
}

/* Filter/Search Bars - Mobile */
@media (max-width: 768px) {
    .filter-bar,
    .search-bar {
        flex-direction: column;
        gap: 0.75rem;
    }

    .filter-bar input,
    .filter-bar select,
    .search-bar input {
        width: 100%;
    }
}

/* Badges - Mobile */
@media (max-width: 480px) {
    .badge-draft,
    .badge-issued,
    .badge-paid,
    .badge-overdue,
    .badge-pending,
    .badge-in-progress,
    .badge-complete {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Utility Classes for Responsive */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    .full-width-mobile {
        width: 100% !important;
    }
}

@media (min-width: 769px) {
    .show-mobile {
        display: none !important;
    }

    .hide-desktop {
        display: none !important;
    }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .app-topbar {
        padding: 0.5rem;
    }

    .app-main {
        padding: 0.75rem;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .app-logo,
    .mobile-nav-logo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles - Ensure Print Works */
@media print {
    .app-topbar,
    .app-drawer,
    .app-bottom-nav,
    .app-menu-toggle,
    .app-search-container,
    .app-user-menu-wrapper,
    .super-admin-badge {
        display: none !important;
    }

    .app-main {
        padding: 0 !important;
        margin: 0 !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

/* Accessibility - Touch Target Sizes */
@media (max-width: 768px) {
    a,
    button,
    input[type="button"],
    input[type="submit"],
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .app-menu-toggle,
    .app-user-btn,
    .app-drawer-close {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Prevent Text Size Adjustment on iOS */
@media (max-width: 768px) {
    input,
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

