/**
 * Inventory System - iOS Vibe CSS
 * Based on CRM CSS Visual Style Guide
 */

:root {
    /* Colors */
    --bg-app: #f2f2f3;
    --bg-app-alt: #f5f5f7;
    --text-main: #141414;
    --text-secondary: #666;
    --brand-dark-1: #151515;
    --brand-dark-2: #2b2b2b;
    --accent: #f7a736;
    --success: #34c759;
    --warning: #ff9500;
    --error: #ff3b30;
    --info: #007aff;

    /* Borders */
    --border-color: rgba(0, 0, 0, 0.1);
    --border-color-light: rgba(0, 0, 0, 0.05);

    /* Radius */
    --radius-sm: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 18px;

    /* Shadows */
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-modal: 0 10px 26px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --ease-fast: all 0.2s ease;
    --ease-drawer: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base */
body {
    font-family: -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, Arial, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-main);
}

.header-brand {
    margin-top: 0px;
    margin-bottom: 0px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    transition: var(--ease-fast);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--border-color-light);
    padding: 1rem 1.125rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--ease-fast);
    border: none;
    padding: 0.2rem 0.5rem;
    font-size: 14px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-dark-1), var(--brand-dark-2));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-dark-2), var(--brand-dark-1));
    color: white;
}

.btn-add-product {
    transition: background-color 0.5s ease, color 0.5s ease, transform 0s !important;
}

.btn-add-product:hover {
    background: var(--accent) !important;
    color: white !important;
    transform: none !important;
}

.btn-add-product:active {
    transform: none !important;
}

.btn-accent {
    background-color: var(--accent);
    color: white;
}

.btn-accent:hover {
    background-color: #e89625;
    color: white;
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-danger {
    background-color: var(--error);
    color: white;
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-icon-only {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0.3rem;
    gap: 0;
    justify-content: center;
}

.btn-icon-only i {
    font-size: 14px;
    line-height: 1;
}

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 13px;
}

.btn-lg {
    padding: 0.75rem 1.25rem;
    font-size: 15px;
}

/* Form Controls */
.form-control,
.form-select {
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 14px;
    transition: var(--ease-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(247, 167, 54, 0.2);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

/* Header */
.app-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.72rem 0;
    position: static;
}

.app-header .container-fluid {
    max-width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.header-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
}

.header-brand-logo-image {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-weight: 600;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
    text-indent: -9999px;
    opacity: .9;
    box-shadow: 2px 2px 9px #0000008a;
}

.header-brand-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    text-transform: uppercase;
}

.header-brand .logo-square {
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-radius: 14px;
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.14);
}

.header-actions {
    scale: .86;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.header-actions .language-switcher {
    margin-right: 0.05rem;
    border-radius: 16px;
    padding: 3px;
    gap: 3px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08), 0 2px 5px rgba(0, 0, 0, 0.08);
}

.header-actions .language-switcher button {
    padding: 5px 11px;
    font-size: 12px;
    border-radius: 13px;
}

.header-initials {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #121212, #3a3a3a);
    color: white;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    margin: 0 0 0 6px;
}

.header-initials-btn {
    border: none;
    padding: 0;
    position: relative;
    cursor: pointer;
}

.header-initials-btn:hover,
.header-initials-btn:focus-visible {
    transform: translateY(0);
    filter: brightness(1.08);
}

.header-initials-btn:focus-visible {
    outline: 3px solid rgba(247, 167, 54, 0.36);
    outline-offset: 2px;
}

.header-initials-text {
    line-height: 1;
}

.header-icon-btn {
    width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #f4f4f4;
    color: var(--text-main);
    padding: 0;
    justify-content: center;
}

.header-icon-btn i {
    font-size: 24px;
    line-height: 1;
}

.header-icon-btn:hover {
    background: #ebebeb;
    transform: translateY(0);
}

.pwa-notification-dropdown {
    position: relative;
}

.pwa-status-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--error);
    border: 2px solid #2a3f78;
}

.pwa-initials-dropdown .pwa-popup-menu {
    margin-top: 0.45rem;
}

.pwa-popup-menu {
    width: min(370px, calc(100vw - 1.5rem));
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color-light);
    box-shadow: var(--shadow-modal);
    padding: 0;
    overflow: hidden;
}

.pwa-popup-section {
    padding: 0.9rem 1rem;
}

.pwa-popup-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.pwa-popup-title {
    font-size: 0.92rem;
    font-weight: 700;
}

.pwa-popup-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.pwa-popup-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.pwa-popup-actions .btn {
    min-height: 34px;
}

.pwa-pill {
    border-radius: 999px;
    font-size: 0.69rem;
    font-weight: 700;
    padding: 0.2rem 0.56rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.pwa-pill.state-ready {
    background: rgba(247, 167, 54, 0.18);
    color: #8c5b10;
}

.pwa-pill.state-unavailable {
    background: rgba(120, 120, 128, 0.16);
    color: #555;
}

.pwa-pill.state-installed,
.pwa-pill.state-granted {
    background: rgba(52, 199, 89, 0.16);
    color: #1f7f39;
}

.pwa-pill.state-default {
    background: rgba(0, 122, 255, 0.14);
    color: #0e61c2;
}

.pwa-pill.state-denied {
    background: rgba(255, 59, 48, 0.16);
    color: #b22720;
}

.pwa-ios-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 2100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.pwa-ios-overlay.is-open {
    display: flex;
}

.pwa-ios-card {
    width: min(460px, 100%);
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--border-color-light);
    padding: 1rem 1rem 0.95rem;
    position: relative;
}

.pwa-ios-close {
    position: absolute;
    top: 0.72rem;
    right: 0.72rem;
}

.pwa-ios-steps {
    margin: 0.4rem 0 0.9rem;
    padding-left: 1.2rem;
    color: var(--text-main);
    font-size: 0.88rem;
}

.pwa-ios-steps li {
    margin-bottom: 0.35rem;
}

.pwa-ios-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pwa-notification-onboarding {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 2000;
    display: none;
}

.pwa-notification-onboarding.is-open {
    display: block;
}

.pwa-notification-card {
    width: min(380px, calc(100vw - 2rem));
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color-light);
    box-shadow: var(--shadow-modal);
    padding: 0.95rem 1rem;
}

/* Offcanvas Menu */
.offcanvas {
    border: none;
    box-shadow: var(--shadow-modal);
}

.offcanvas-header {
    border-bottom: 1px solid var(--border-color-light);
    padding: 1.5rem;
}

.offcanvas-body {
    padding: 1.5rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-square {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand-dark-1), var(--brand-dark-2));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.logo-square-bcg {
    width: 56px;
    height: 56px;
    font-size: 14px;
    letter-spacing: 1px;
}

/* Navigation */
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    margin-bottom: 0.5rem;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.875rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--ease-fast);
    font-weight: 500;
}

.nav-menu a:hover {
    background-color: var(--bg-app);
    color: var(--text-main);
}

.nav-menu a.active {
    background-color: var(--accent);
    color: white;
}

/* Language Switcher (Pill Style) */
.language-switcher {
    display: inline-flex;
    background: #dcdcdc;
    border-radius: 20px;
    padding: 4px;
    gap: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

.language-switcher button {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    border-radius: 16px;
    transition: var(--ease-fast);
    cursor: pointer;
}

.language-switcher button.active {
    background: white;
    color: var(--text-main);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.language-switcher button:hover:not(.active) {
    color: var(--text-main);
}

/* Main Container */
.main-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.5rem 1.5rem;
}

@media (max-width: 768px) {
    .main-container {
        padding: 1.25rem 1rem;
    }
}

/* Tables */
.table {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table thead th {
    background-color: var(--bg-app);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-main);
    padding: 0.75rem;
    font-size: 13px;
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: var(--bg-app-alt);
}

/* Badges */
.badge {
    padding: 0.28rem 0.68rem;
    font-weight: 700;
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0.2px;
    line-height: 1.15;
    border-radius: 6px;
}

.badge-success {
    background-color: var(--success);
    color: white;
}

.badge-warning {
    background-color: var(--warning);
    color: white;
}

.badge-danger {
    background-color: var(--error);
    color: white;
}

.badge-info {
    background-color: var(--info);
    color: white;
}

.badge-secondary {
    background: linear-gradient(135deg, #334155 0%, #1f2937 100%);
    color: #f8fafc;
    border: 1px solid #475569;
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}

.alert-success {
    background-color: rgba(52, 199, 89, 0.1);
    color: #1f7a3d;
    border-left: 3px solid var(--success);
}

.alert-danger {
    background-color: rgba(255, 59, 48, 0.1);
    color: #c72020;
    border-left: 3px solid var(--error);
}

.alert-warning {
    background-color: rgba(255, 149, 0, 0.1);
    color: #cc7700;
    border-left: 3px solid var(--warning);
}

.alert-info {
    background-color: rgba(0, 122, 255, 0.1);
    color: #005ebb;
    border-left: 3px solid var(--info);
}

/* Modal */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
}

.modal-header {
    border-bottom: 1px solid var(--border-color-light);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color-light);
    padding: 1.5rem;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, var(--bg-app), var(--bg-app-alt));
    min-height: 100vh;
}

.bg-dark-brand {
    background: linear-gradient(135deg, var(--brand-dark-1), var(--brand-dark-2));
}

.login-brand-title {
    color: #ffffff;
    letter-spacing: 0.2px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.login-brand-subtitle {
    font-weight: 600;
    letter-spacing: 0.2px;
    background: linear-gradient(90deg, #f7a736, #ffd29b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}

.login-page .logo-square {
    width: 96px;
    height: 96px;
    font-size: 24px;
    letter-spacing: 1.5px;
    box-shadow: 0px 0px 24px #f7a736;
}

/* Clickable Stats/Counts */
.stat-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--ease-fast);
}

.stat-link:hover {
    color: #e89625;
    text-decoration: underline;
}

/* Loading Spinner */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 2px;
}

/* Device Add - Scanner Hybrid UI */
.scanner-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.125rem;
    background: linear-gradient(135deg, #ffffff, var(--bg-app-alt));
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-md);
}

.scanner-toolbar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.scanner-toggle-btn {
    min-width: 190px;
}

.scanner-toggle-btn.is-active {
    background: rgba(255, 59, 48, 0.12);
    color: #be2d24;
    border: 1px solid rgba(255, 59, 48, 0.25);
}

.scanner-panel {
    background: #ffffff;
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-card);
}

.scanner-preview-shell {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #0f0f10;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.scanner-preview-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.scan-reader-box {
    min-height: 300px;
    width: 100%;
}

.scan-reader-box>div {
    border: none !important;
}

.scan-reader-box video {
    width: 100% !important;
    height: auto !important;
}

.scan-image-reader {
    position: fixed;
    left: -9999px;
    top: -9999px;
    width: 320px;
    height: 240px;
    opacity: 0;
    pointer-events: none;
}

.scan-priority-list {
    padding-left: 1.2rem;
}

.scan-priority-list li {
    margin-bottom: 0.45rem;
}

.scan-priority-list li:last-child {
    margin-bottom: 0;
}

.scanner-actions .btn {
    min-width: 210px;
}

.photo-preview-thumb {
    max-width: 220px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
}

/* AI Extraction Loader Overlay */
.ai-extraction-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-extraction-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    text-align: center;
    max-width: 320px;
}

.ai-extraction-text {
    color: var(--text-primary);
}

.ai-extraction-text small {
    font-size: 0.875rem;
}

/* Reusable compact list filters */
.list-filters .form-label {
    font-size: 12px;
    margin-bottom: 0.35rem;
}

.list-filters .form-control,
.list-filters .form-select {
    min-height: 38px;
    padding: 0.4rem 0.65rem;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.list-filters .select2-container--bootstrap-5 .select2-selection {
    min-height: 38px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.list-filters .select2-container--bootstrap-5 .select2-selection--single {
    display: flex;
    align-items: center;
    padding: 0 2rem 0 0.65rem;
}

.list-filters .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 1.2;
    padding-left: 0;
    padding-right: 0;
    margin: 0;
}

.list-filters .select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
    color: var(--text-secondary);
}

.list-filters .select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 100%;
    top: 0;
    right: 0.5rem;
}

.list-filters-row>[class*="col-"] {
    display: flex;
    flex-direction: column;
}

.filter-action-group {
    min-height: 38px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
}

.filter-action-group .btn {
    padding: 0.42rem 0.75rem;
    font-size: 13px;
    width: 100%;
    justify-content: center;
}

.filter-reset-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.42rem 0.75rem;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    width: 100%;
    text-decoration: none;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    transition: var(--ease-fast);
}

.filter-reset-link:hover {
    background: var(--bg-app-alt);
    color: var(--text-main);
}

/* Compact and consistent actions in tables */
.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.table-actions form {
    margin: 0;
}

.table-actions .btn {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    justify-content: center;
}

.table-actions .btn i {
    font-size: 14px;
}

/* Utility Classes */
.text-muted {
    color: var(--text-secondary) !important;
}

.border-light {
    border-color: var(--border-color-light) !important;
}

.bg-light-gray {
    background-color: var(--bg-app);
}

.shadow-card {
    box-shadow: var(--shadow-card);
}

.shadow-hover {
    box-shadow: var(--shadow-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        padding: 0.58rem 0;
    }

    .app-header .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .header-actions {
        gap: 0.4rem;
    }

    .header-actions .language-switcher {
        border-radius: 15px;
        padding: 3px;
        gap: 3px;
    }

    .header-actions .language-switcher button {
        padding: 4px 9px;
        font-size: 11px;
        border-radius: 12px;
    }

    .header-initials,
    .header-icon-btn {
        width: 38px;
        height: 38px;
        min-height: 38px;
    }

    .header-initials {
        font-size: 15px;
    }

    .header-icon-btn {
        border-radius: 10px;
    }

    .header-icon-btn i {
        font-size: 20px;
    }

    .pwa-popup-menu {
        width: min(360px, calc(100vw - 1rem));
    }

    .pwa-ios-card,
    .pwa-notification-card {
        width: min(420px, calc(100vw - 1rem));
    }

    .pwa-notification-onboarding {
        right: 0.5rem;
        left: 0.5rem;
        bottom: 0.6rem;
    }

    .pwa-notification-card {
        width: 100%;
    }

    .pwa-popup-actions .btn,
    .pwa-ios-actions .btn {
        flex: 1 1 100%;
    }

    .app-header .badge-secondary {
        display: none;
    }

    .page-title {
        font-size: 22px;
    }

    .page-subtitle {
        font-size: 13px;
    }

    .btn {
        min-height: 44px;
        justify-content: center;
    }

    .btn-icon-only {
        width: 36px;
        height: 36px;
        min-height: 36px;
        padding: 0.25rem;
    }

    .scanner-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .scanner-toggle-btn {
        width: 100%;
        min-width: 0;
    }

    .scanner-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .photo-preview-thumb {
        max-width: 100%;
    }

    .filter-action-group {
        width: 100%;
        grid-template-columns: 1fr 1fr;
    }

    .filter-action-group .btn,
    .filter-action-group .filter-reset-link {
        width: 100%;
    }

    /* Hide desktop table on mobile */
    .desktop-table {
        display: none !important;
    }

    /* Show mobile cards only on mobile */
    .mobile-cards {
        display: block !important;
    }
}

/* Mobile card styles */
.mobile-cards {
    display: none;
}

.mobile-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-card);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Zmiana z flex-start na center, aby elementy były równo w pionie */
    flex-wrap: nowrap;
    /* Wymusza zachowanie jednego wiersza */
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color-light);
}

.mobile-card-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin: 0;
}

.mobile-card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.mobile-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.mobile-card-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.mobile-card-value {
    font-size: 14px;
    color: var(--text-primary);
    text-align: right;
}

.mobile-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color-light);
    flex-wrap: wrap;
}

.mobile-card-actions .btn {
    flex: 1;
    font-size: 13px;
    padding: 0.5rem;
    min-width: 90px;
}

.mobile-card-actions form {
    flex: 1;
    display: flex;
}

.mobile-card-actions form .btn {
    width: 100%;
}

/* Desktop: show table, hide mobile cards */
@media (min-width: 769px) {
    .desktop-table {
        display: block !important;
    }

    .mobile-cards {
        display: none !important;
    }
}