/* ============================================
   QLReview - Theme Red & Gold (May Mắn Tiền Bạc)
   ============================================ */

/* === Color Variables === */
:root {
    --primary-red: #B71C1C;
    --primary-red-dark: #7F0000;
    --primary-red-light: #C62828;
    --gold: #FFD700;
    --gold-light: #FFEB3B;
    --gold-dark: #FFC107;
    --cream: #FFF8E1;
    --cream-dark: #FFECB3;
    --text-dark: #333;
    --text-light: #666;
    --success: #2E7D32;
    --danger: #C62828;
    --shadow: rgba(183, 28, 28, 0.3);
    --shadow-light: rgba(183, 28, 28, 0.15);
}

/* === Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    min-height: 100vh;
    overflow-x: hidden !important;
}

.main-content {
    overflow-x: hidden !important;
}

.order-list {
    overflow-x: hidden !important;
    width: 100% !important;
}

/* === Card Styles === */
.card {
    background: linear-gradient(145deg, #FFFFFF 0%, #FFF3E0 100%);
    border: 2px solid rgba(183, 28, 28, 0.2);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(183, 28, 28, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #B71C1C, #FFD700, #B71C1C);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(183, 28, 28, 0.2);
    border-color: #B71C1C;
}

.card h3 {
    color: #7F0000;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card p, .card span {
    font-size: 26px;
    font-weight: 700;
    color: #B71C1C;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.card .profit {
    color: #FFD700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.card .loss {
    color: #FF5252;
}

/* === Dashboard Grid === */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
}

.dashboard-section {
    background: white;
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 32px;
    box-shadow: 0 10px 40px rgba(183, 28, 28, 0.15);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.dashboard-section h2 {
    font-size: 1.3em;
    color: white;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #B71C1C 0%, #7F0000 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.3);
}

.dashboard-section h2::before {
    content: '💰';
    font-size: 1.2em;
}

/* === Main Content === */
.main-content {
    margin-left: 280px;
    padding: 24px 32px;
    height: 100vh;
    width: calc(100vw - 280px);
    box-sizing: border-box;
    overflow-y: auto;
}

.main-content h1 {
    color: #7F0000;
    text-shadow: 2px 2px 4px rgba(183, 28, 28, 0.1);
    font-size: 2em;
    margin-bottom: 24px;
    padding: 20px 28px;
    background: linear-gradient(135deg, white 0%, #FFF8E1 100%);
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 24px rgba(183, 28, 28, 0.15);
    border: 2px solid rgba(255, 215, 0, 0.5);
}

.main-content h1 i {
    color: #FFD700;
}

/* === Sidebar === */
.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    border: none;
    background: linear-gradient(180deg, #B71C1C 0%, #7F0000 100%);
    box-shadow: 4px 0 20px rgba(127, 0, 0, 0.4);
    z-index: 999;
    transform: translateX(0);
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

.sidebar-overlay.active {
    display: block;
}

/* === Buttons === */
.btn-login, .add-btn, .btn-primary {
    background: linear-gradient(135deg, #FFD700 0%, #FFEB3B 100%);
    border: none;
    border-radius: 10px;
    color: #7F0000;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.2);
}

.btn-login:hover, .add-btn:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(183, 28, 28, 0.3);
    background: linear-gradient(135deg, #FFEB3B 0%, #FFD700 100%);
}

.edit-btn {
    background: #FFD700;
    color: #7F0000;
    border: none;
    border-radius: 6px;
    padding: 6px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.edit-btn:hover {
    background: #FFEB3B;
    transform: scale(1.05);
}

.delete-btn {
    background: #B71C1C;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.delete-btn:hover {
    background: #C62828;
    transform: scale(1.05);
}

/* === Tables === */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(183, 28, 28, 0.1);
}

thead {
    background: linear-gradient(135deg, #B71C1C 0%, #7F0000 100%);
    color: white;
}

th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.5px;
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(183, 28, 28, 0.1);
}

tr:hover {
    background: rgba(255, 215, 0, 0.08);
}

/* === Modal === */
.modal-content h2 {
    color: #B71C1C;
    border-bottom: 3px solid #FFD700;
    padding-bottom: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-content h2 i {
    color: #FFD700;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-content label {
    font-weight: 600;
    color: #7F0000;
    margin-bottom: 4px;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    padding: 12px;
    border: 2px solid #FFD700;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #B71C1C;
    box-shadow: 0 0 0 4px rgba(183, 28, 28, 0.1);
}

/* === Form Inputs === */
input, select, textarea {
    border: 2px solid #FFD700;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #B71C1C;
    box-shadow: 0 0 0 4px rgba(183, 28, 28, 0.1);
}

/* === Search Bar === */
.search-bar input {
    border: 2px solid #FFD700;
    border-radius: 10px;
    padding: 12px 16px;
}

.search-bar select {
    border: 2px solid #FFD700;
    border-radius: 10px;
    padding: 12px 16px;
    background: white;
}

/* === Pagination === */
.pagination button {
    background: linear-gradient(135deg, #FFD700 0%, #FFEB3B 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #7F0000;
    transition: all 0.3s;
}

.pagination button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.2);
}

.pagination select {
    border: 2px solid #FFD700;
    border-radius: 8px;
    padding: 10px;
}

/* === Hamburger Menu === */
.hamburger {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, #FFD700 0%, #FFEB3B 100%);
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(183, 28, 28, 0.3);
    color: #7F0000;
    font-size: 24px;
}

/* === Mobile Sort Bar === */
.mobile-sort-bar {
    display: none;
    margin-bottom: 16px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(183, 28, 28, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.mobile-sort-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #7F0000;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-sort-label i {
    color: #FFD700;
    margin-right: 6px;
}

.mobile-sort-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mobile-sort-btn {
    padding: 8px 14px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #7F0000;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-sort-btn:active {
    background: #FFD700;
    color: #7F0000;
    transform: scale(0.95);
}

.mobile-sort-btn.active {
    background: linear-gradient(135deg, #FFD700 0%, #FFEB3B 100%);
    color: #7F0000;
    border-color: #FFD700;
}

/* === Responsive === */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    #orderTable {
        min-width: 100% !important;
    }
}

/* Standard Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    #orderTable {
        min-width: 1300px !important;
    }
}

/* Small Desktop / Large Tablet (1025px - 1199px) */
@media (min-width: 1025px) and (max-width: 1199px) {
    .main-content {
        margin-left: 240px;
        padding: 20px;
        width: calc(100vw - 240px) !important;
        max-width: calc(100vw - 240px) !important;
    }
    
    .sidebar {
        width: 240px;
    }
}

/* Tablet (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: 70px 16px 16px;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    
    .sidebar {
        width: 260px;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    .mobile-sort-bar {
        display: block;
    }
    
    .hamburger {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
        top: 0;
        height: 100vh;
        width: 280px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 70px 10px 16px !important;
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        position: relative !important;
    }
    
    .main-content h1 {
        font-size: 1.4em !important;
        padding: 12px 16px !important;
        margin: 0 !important;
    }
    
    .add-btn {
        margin: 0 !important;
        padding: 10px 16px !important;
        font-size: 13px !important;
    }
    
    .dashboard {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 16px;
        padding: 16px;
    }
    
    .card p, .card span {
        font-size: 20px;
    }
    
    .card {
        padding: 16px;
    }
    
    /* Mobile Table Styles - Hide table headers, show as cards */
    #orderTable thead {
        display: none;
    }
    
    #orderTable tbody tr {
        display: block !important;
        padding: 0 !important;
        margin-bottom: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border: none !important;
        background: transparent !important;
    }
    
    #orderTable tbody td {
        display: block !important;
        padding: 0 !important;
        border: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
        vertical-align: top !important;
    }
    
    /* Mobile Order List */
    .order-list {
        padding: 0 !important;
        overflow-x: visible !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    .order-list table {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: visible !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    
    /* Mobile Search Bar */
    .search-bar {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .search-bar input,
    .search-bar select {
        width: 100%;
        box-sizing: border-box;
        font-size: 14px;
    }
    
    /* Mobile Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 10px 0;
        font-size: 13px;
    }
    
    .pagination button {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    /* Mobile Modal */
    .modal {
        padding: 10px;
        align-items: flex-start;
        overflow-y: auto;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 20px;
    }
    
    .modal-content h2 {
        font-size: 18px;
    }
    
    /* Mobile Badge */
    .badge {
        font-size: 9px !important;
        padding: 4px 8px !important;
        white-space: nowrap !important;
        text-align: center;
        line-height: 1.2;
    }
    
    .mobile-card-right {
        min-width: 40px !important;
        width: auto !important;
    }
    
    .toggle-btn {
        width: 20px !important;
        height: 20px !important;
        font-size: 10px !important;
    }
    
    /* Mobile Action Buttons */
    .mobile-card-actions {
        padding: 4px 2px !important;
        gap: 4px !important;
    }
    
    .mobile-card-actions button {
        padding: 10px 2px !important;
        font-size: 10px !important;
        gap: 2px !important;
        border-radius: 4px !important;
    }
    
    /* Very small screens - icon only */
    @media (max-width: 380px) {
        .mobile-card-actions button {
            padding: 10px 4px !important;
        }
        .mobile-card-actions button span:not(.fa) {
            display: none;
        }
        .mobile-card-actions button .fa {
            margin: 0;
        }
    }
    
    /* Fix detail grid overflow */
    .mobile-card-details {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    .mobile-detail-grid {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Extra Small Mobile (< 480px) */
@media (max-width: 480px) {
    .main-content {
        padding: 60px 6px 12px !important;
    }
    
    .main-content h1 {
        font-size: 1.2em !important;
        padding: 10px 12px !important;
    }
    
    .search-bar {
        gap: 8px;
    }
    
    .mobile-sort-bar {
        padding: 10px;
    }
    
    .mobile-sort-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* === Loading Animation === */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading {
    background: linear-gradient(90deg, #FFF8E1 25%, #FFEB3B 50%, #FFF8E1 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* === Badge === */
.badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFEB3B 100%);
    color: #7F0000;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.badge-danger {
    background: linear-gradient(135deg, #B71C1C 0%, #7F0000 100%) !important;
    color: white !important;
}

.badge-warning {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%) !important;
    color: white !important;
}

.badge-info {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%) !important;
    color: white !important;
}

.badge-success {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%) !important;
    color: white !important;
}

/* === Summary Box === */
.summary {
    background: linear-gradient(135deg, #B71C1C 0%, #7F0000 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.3);
}

/* === Order List === */
.order-list {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(183, 28, 28, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    overflow-x: auto !important;
    overflow-y: visible !important;
    position: relative !important;
}

.order-list::-webkit-scrollbar {
    height: 10px;
}

.order-list::-webkit-scrollbar-track {
    background: #FFF8E1;
    border-radius: 5px;
}

.order-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #B71C1C 0%, #7F0000 100%);
    border-radius: 5px;
}

.order-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #C62828 0%, #8B0000 100%);
}

/* Table Styles */
#orderTable {
    border-collapse: collapse;
    width: 100% !important;
    table-layout: fixed !important;
}

#orderTable thead, #orderTable tbody {
    width: 100% !important;
}

#orderTable thead th {
    background: linear-gradient(135deg, #B71C1C 0%, #7F0000 100%);
    color: white;
    font-weight: 600;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
}

#orderTable thead th:first-child {
    border-radius: 8px 0 0 0;
}

#orderTable thead th:last-child {
    border-radius: 0 8px 0 0;
}

#orderTable td {
    vertical-align: middle;
}

#orderTable tbody tr {
    height: auto !important;
    transition: background 0.2s ease;
}

#orderTable tbody tr:hover {
    background: rgba(255, 215, 0, 0.12) !important;
}

#orderTable td, #orderTable th {
    padding: 12px 16px !important;
}

/* Copy Icon in Table Cells */
.table-copy-icon {
    margin-left: 6px;
    font-size: 11px;
    opacity: 0.4;
    cursor: pointer;
    color: #B71C1C;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.table-copy-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

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

/* Hover effect for copyable cells */
#orderTable tbody tr td[onclick*="copyCellText"] {
    cursor: pointer;
    transition: background 0.2s ease;
}

#orderTable tbody tr td[onclick*="copyCellText"]:hover {
    background: rgba(255, 215, 0, 0.15) !important;
}

#orderTable tbody tr td[onclick*="copyCellText"]:hover .table-copy-icon {
    opacity: 1;
}

/* Desktop Table - Clickable Row */
#orderTable tbody tr[onclick] {
    transition: background 0.2s ease;
}

#orderTable tbody tr[onclick]:hover {
    background: rgba(255, 215, 0, 0.15) !important;
}

/* Compact Action Buttons */
#orderTable .action-btn {
    padding: 4px 8px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    border: none !important;
    display: inline-block !important;
    margin: 0 2px !important;
}

#orderTable .action-btn:hover {
    transform: scale(1.05);
}

#orderTable .action-btn.edit {
    background: #FFD700 !important;
    color: #7F0000 !important;
}

#orderTable .action-btn.delete {
    background: #B71C1C !important;
    color: white !important;
}

/* Desktop Expanded Row Detail */
#orderTable tbody tr[id^="row-"] {
    background: linear-gradient(135deg, rgba(255,248,225,0.3) 0%, rgba(255,255,255,1) 100%);
}

#orderTable tbody tr[id^="row-"]:hover {
    background: linear-gradient(135deg, rgba(255,248,225,0.3) 0%, rgba(255,255,255,1) 100%) !important;
}

/* Detail Grid Cards */
.detail-card {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,215,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.detail-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.1);
}

/* Sort indicator */
#orderTable th[data-direction="asc"] i::before {
    content: '\f0de';
    color: #FFD700;
}

#orderTable th[data-direction="desc"] i::before {
    content: '\f0dd';
    color: #FFD700;
}

/* Chevron animation for expandable rows */
#orderTable tbody tr td i[id^="icon-row-"] {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* === Modal Buttons === */
.modal-content form button {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.modal-content form button:first-of-type {
    background: linear-gradient(135deg, #FFD700 0%, #FFEB3B 100%);
    color: #7F0000;
}

.modal-content form button:first-of-type:hover {
    background: linear-gradient(135deg, #FFEB3B 0%, #FFD700 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.3);
}

.modal-content form button:last-of-type {
    background: rgba(183, 28, 28, 0.1);
    color: #B71C1C;
    border: 2px solid #B71C1C;
}

.modal-content form button:last-of-type:hover {
    background: rgba(183, 28, 28, 0.2);
    transform: translateY(-2px);
}

/* === Modal Overlay === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(127, 0, 0, 0.6);
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: #FFF8E1;
    border: 3px solid #FFD700;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(183, 28, 28, 0.25);
    max-width: 600px;
    margin: auto;
}

/* === Mobile Order Card (always visible when created) === */
.mobile-order-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(183, 28, 28, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
    display: block;
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 8px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(183, 28, 28, 0.03) 0%, rgba(255, 215, 0, 0.03) 100%);
    transition: background 0.2s;
    width: 100%;
    box-sizing: border-box;
    gap: 6px;
}

.mobile-card-main {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 70px);
    overflow: hidden;
}

.mobile-card-row {
    display: flex;
    align-items: baseline;
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.3;
}

.mobile-label {
    color: #7F0000;
    font-weight: 600;
    min-width: 50px;
    flex-shrink: 0;
}

.mobile-value {
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.mobile-value.order-code {
    font-weight: 700;
    color: #B71C1C;
}

.mobile-value.price {
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0.5px 0.5px 1px rgba(0,0,0,0.2);
}

.mobile-card-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-left: 6px;
    flex-shrink: 0;
    width: auto;
}

.toggle-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #7F0000;
    font-size: 12px;
    transition: transform 0.3s;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #FAFAFA;
    border-top: 1px solid rgba(183, 28, 28, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.mobile-order-card.expanded .mobile-card-details {
    max-height: 500px;
}

.mobile-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(183, 28, 28, 0.1);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: 6px;
    background: white;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.detail-label {
    font-size: 9px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-value {
    font-size: 10px;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-note {
    padding: 6px;
    background: white;
    border-top: 1px solid rgba(183, 28, 28, 0.1);
    overflow: hidden;
    box-sizing: border-box;
}

.mobile-card-actions {
    display: flex;
    gap: 4px;
    padding: 4px 2px;
    background: white;
    border-top: 1px solid rgba(183, 28, 28, 0.1);
}

.mobile-card-actions button {
    flex: 1;
    padding: 8px 2px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}
