.symbol-icon {
    display: block;
    align-items: center;
    padding-left: 5px;
    position: absolute;
    top: 6px;
}
.symbol-icon span {
    margin-left: 5px; margin-top: -1px;
}
.symbol-icon img {
    width: 20px;
    height: 20px;
}
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* overflow: hidden; */ /* Commented out for mobile scrolling */
  }

  #main {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 120px; /* Tăng padding để tránh bị che bởi CommandButtonBar */
    -webkit-overflow-scrolling: touch;
  }

  #CommandButtonBar {
    position: fixed;
    /* top: 0px; */
    bottom: 0;
    left: 0;
    right: -1px;
    /* Use theme background and border */
    background-color: var(--bs-body-bg);
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); /* Shadow might need adjustment, keeping for now */
    padding: 3px;
    border-top: 1px solid var(--bs-border-color);
    height: auto;   
  }

  .btn-container {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 0px !important;
  }

  .btn-container::-webkit-scrollbar {
    display: none;
  }

  .btn-icon-text {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
  }

  .btn-icon-text i {
    font-size: 1.2em;
  }

  .input-group {
    margin-top: 5px;
    position: relative;
    z-index: 1001;
  }

  #command-input {
    border-radius: 20px 0 0 20px;
    border-right: none;
    height: 40px;
    padding: 0 15px;
  }


   



  /* Đảm bảo card cuối cùng không bị che */
  .card:last-child {
    margin-bottom: 180px;
  }
/* Modern Table Styles */
.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    /* Use theme background */
    background-color: var(--bs-body-bg);
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Shadow might need adjustment */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
}

.modern-table thead th {
    /* background: linear-gradient(135deg, #1a62b1 0%, #1e40af 100%); */
    color: white;
    border: none;
    padding: 0.4rem 0.75rem;
}

.modern-table thead th:first-child {
    border-top-left-radius: 8px;
}

.modern-table thead th:last-child {
    border-top-right-radius: 8px;
}

.modern-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 16px;
}

.modern-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 16px;
}

/* Logo Styles */
.table-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-family: 'Arial Black', 'Helvetica Black', sans-serif;
    background: linear-gradient(135deg, #1a62b1 0%, #1e40af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.table-title i {
    font-size: 2rem;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 2s infinite;
}

.table-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #1a62b1 0%, #22c55e 50%, #1e40af 100%);
    border-radius: 2px;
    animation: gradient 3s ease infinite;
    background-size: 200% auto;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Header Styles */
.header-row {
    background: linear-gradient(135deg, #1a62b1 0%, #1e40af 100%);
    line-height: 1.2;
}

.table-header {
    padding: 0.4rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    border-bottom: 2px solid #e2e8f0;
}

/* Row Styles - Use theme variables */
.even-row {
    background-color: var(--bs-body-bg);
}

.odd-row {
    background-color: var(--bs-tertiary-bg);
}

.row-hover:hover {
    background-color: var(--bs-secondary-bg);
    transition: background-color 0.2s ease;
}

/* Today Column Style */
td[data-column="Today"] {
    background: none !important;
}

td[data-column="Today"] span {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
}

/* Cell Styles - Use theme border */
td {
    padding: 7 0 7 0;
    border-bottom: 1px solid var(--bs-border-color);
    background: none !important;
}

/* Status Cell */
td:last-child {
    background: none !important;
}

.symbol-cell {
    font-weight: 400;
    /* font-size: 0.7rem; */
}

.status-cell {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-align: center;
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.5em 0.75em;
    font-size: 0.85em;
    font-weight: 500;
    border-radius: 6px;
    background: none;
}

/* Crypto-style colors */
.bg-primary-transparent {
    color: #2fabff;
    --badge-rgb: 47, 171, 255;
}

.bg-secondary-transparent {
    color: #808a9d;
    --badge-rgb: 128, 138, 157;
}

.bg-success-transparent {
    color: #18b479;
    --badge-rgb: 22, 199, 132;
}

.bg-danger-transparent {
    color: #ff996f;
    --badge-rgb: 234, 57, 67;
}

.bg-warning-transparent {
    color: #ffb600;
    --badge-rgb: 255, 182, 0;
}

.bg-info-transparent {
    color: #5d7fff;
    --badge-rgb: 56, 97, 251;
}

.bg-light-transparent {
    color: #808a9d;
    --badge-rgb: 128, 138, 157;
}

/* Status Colors */
.badge-empty {
    color: #808a9d;
}

.badge-protecting {
    color: #ffb600;
}

.badge-investing, .badge-invested {
    color: #5d7fff;
}

.badge-signal, .badge-signal-up, .badge-signal-down, .badge-signal-us, .badge-signal-ds {
    color: #f7931a;
}

.badge-wait-up, .badge-wait-down {
    color: #aa67ff;
}

.badge-buy-delay, .badge-sell-delay {
    color: #0dcaf0;
}

.badge-indi {
    color: #20c997;
}

.badge-pf, .badge-pfd, .badge-pfu {
    color: #6f42c1;
}

.badge-stopped {
    color: #dc3545;
}

.badge-new, .badge-filled {
    color: #198754;
}

.badge-partially {
    color: #ffc107;
}

.badge-error {
    color: #dc3545;
}

.badge-skip-signal {
    color: #6c757d;
}

/* Animation keyframes */
@keyframes shield-animation {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-15deg) scale(1.1); }
    50% { transform: rotate(0deg) scale(1.2); }
    75% { transform: rotate(15deg) scale(1.1); }
    100% { transform: rotate(0deg) scale(1); }
}

@keyframes graph-animation {
    0% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-3px) scale(1.1); }
    50% { transform: translateY(0) scale(1.2); }
    75% { transform: translateY(3px) scale(1.1); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Animation classes */
.spinning {
    display: inline-block;
    animation: spin 2s linear infinite;
}

.shield-animation {
    display: inline-block;
    animation: shield-animation 2s ease-in-out infinite;
}

.graph-animation {
    display: inline-block;
    animation: graph-animation 2s ease-in-out infinite;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    .badge {
        font-size: 0.8em;
        padding: 0.4em 0.6em;
    }
    .badge::before {
        font-size: 0.9em;
    }
    .modern-table thead th {
        padding: 0.3rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .table-header {
        padding: 0.3rem 0.5rem;
    }
}

/* Selected Row Style */
.selected-row {
    background-color: #e8f4ff !important;
    border-left: 4px solid #1a62b1;
    animation: highlight 1s ease-out;
}

/* Button Styles */
.btn-container {
    padding: 2px 0px 0px 0px;
}

.btn-icon-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    gap: 0.35rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    min-width: 100px;
}

.btn-icon-text:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 2;
}

.btn-icon-text:active {
    z-index: 3;
}

.btn-icon-text i {
    font-size: 1.1em;
    display: inline-flex;
    align-items: center;
}

/* Button Color Variants */
.btn-danger-soft {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
    color: white;
}

.btn-danger-soft:hover, .btn-danger-soft:focus, .btn-danger-soft:active {
    background-color: #fa5252 !important;
    border-color: #fa5252 !important;
    color: white !important;
}

.btn-info-soft {
    background-color: #4dabf7;
    border-color: #4dabf7;
    color: white;
}

.btn-info-soft:hover, .btn-info-soft:focus, .btn-info-soft:active {
    background-color: #339af0 !important;
    border-color: #339af0 !important;
    color: white !important;
}

.btn-warning-soft {
    background-color: #ffd43b;
    border-color: #ffd43b;
    color: #664d03;
}

.btn-warning-soft:hover, .btn-warning-soft:focus, .btn-warning-soft:active {
    background-color: #fcc419 !important;
    border-color: #fcc419 !important;
    color: #664d03 !important;
}

.btn-success-soft {
    background-color: #51cf66;
    border-color: #51cf66;
    color: white;
}

.btn-success-soft:hover, .btn-success-soft:focus, .btn-success-soft:active {
    background-color: #40c057 !important;
    border-color: #40c057 !important;
    color: white !important;
}
.btn-red-hard {
    background-color: #ff4963;
    border-color: #ff4963;
    color: white;
}
.btn-red-hard:hover, .btn-red-hard:focus, .btn-red-hard:active {
    background-color: #f35970 !important;
    border-color: #f35970 !important;
    color: white !important;
}
.btn-purple-soft {
    background-color: #845ef7;
    border-color: #845ef7;
    color: white;
}

.btn-purple-soft:hover, .btn-purple-soft:focus, .btn-purple-soft:active {
    background-color: #7950f2 !important;
    border-color: #7950f2 !important;
    color: white !important;
}

.btn-orange-soft {
    background-color: #ff922b;
    border-color: #ff922b;
    color: white;
}

.btn-orange-soft:hover, .btn-orange-soft:focus, .btn-orange-soft:active {
    background-color: #fd7e14 !important;
    border-color: #fd7e14 !important;
    color: white !important;
}

/* Table Container Styles - Use theme background */
.table-container {
    background: var(--bs-body-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); /* Shadow might need adjustment */
    padding: 0.2rem;
    margin: 0.2rem 0;
}

.table-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center; 
    flex-wrap: nowrap;
}

.table-title {
    font-size: 1.5rem;
    font-weight: 600;
    /* Use theme text color */
    color: var(--bs-body-color);
    margin: 0;
    white-space: nowrap;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-grow: 1;
    justify-content: flex-end;
}

/* Search Styles */
.search-container {
    position: relative;
    width: 300px;
    min-width: 200px;
    margin-left: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    /* Use theme border and background */
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-color: var(--bs-tertiary-bg);
}

.search-input:focus {
    outline: none;
    border-color: #3498db; /* Keep focus color for now */
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1); /* Keep focus shadow for now */
    /* Use theme background on focus */
    background-color: var(--bs-body-bg);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
}

.table-responsive {
    border-radius: 16px;
    /* Use theme background */
    background: var(--bs-body-bg);
    padding: 0;
    box-shadow: 0 0 20px rgba(0,0,0,0.05); /* Shadow might need adjustment */
    overflow: hidden;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .table-header-container {
        flex-direction: row;
        gap: 0.5rem; 
    }

    .table-title {
        font-size: 1.3rem;
    }

    .table-title i {
        font-size: 1.3rem;
    }

    .search-container {
        width: auto;
        flex-grow: 1;
        margin-left: 0.5rem;
    }

    .search-input {
        font-size: 0.85rem;
        padding: 0.5rem 1rem 0.5rem 2rem;
    }

    .search-icon {
        font-size: 0.9rem;
        left: 0.5rem;
    }

    .table-container {
        padding: 0.2rem;
    }

    .table-header, td {
        padding: 10 0 10 0;
        font-size: 0.9rem;
    }
    
    .symbol-cell {
        font-size: 0.9rem;
    }
}

/* Animation */
@keyframes highlight {
    0% {
        background-color: #cce5ff;
    }
    100% {
        background-color: #e8f4ff;
    }
}

/* Custom Scrollbar - Adjust track for dark theme */
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--bs-secondary-bg); /* Darker track */
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #1a62b1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #1e40af;
}

/* Command Input Group Styles */
.input-group {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    /* Use theme background */
    background: var(--bs-body-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); /* Shadow might need adjustment */
    padding: 1rem;
    margin: 1rem 0;
    width: 100% !important;
    margin: 0px !important;
}

.input-group .form-control-lg {
    flex: 1;
    min-width: 0;
    /* Use theme border and background */
    border: 1px solid var(--bs-border-color);
    border-radius: 8px !important;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background-color: var(--bs-tertiary-bg);
    margin: 0;
}

.button-group {
    display: flex !important;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.input-group .btn-outline-secondary {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.75rem;
    border: none;
    border-radius: 8px !important;
    font-weight: 600;
    color: white !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
    gap: 0.5rem;
    min-width: 60px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.input-group .btn-outline-secondary:first-child {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    height: 41px;
}

.input-group .btn-outline-secondary:last-child {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    height: 41px;
}

@media screen and (max-width: 768px) {
    .input-group {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .input-group .form-control-lg {
        font-size: 0.95rem;
        padding: 0.6rem 0.75rem;
    }

    .button-group {
        display: flex !important;
        gap: 0.35rem;
    }

    .input-group .btn-outline-secondary {
        padding: 0.6rem 1rem;
        min-width: 45px;
        height: 40px;
    }

    .input-group .btn-outline-secondary span {
        display: none;
    }

    .input-group .btn-outline-secondary i {
        font-size: 1.2rem;
        margin: 0;
        
    }
}

/* Card and Log Console Styles - Use theme background */
.card {
    background: var(--bs-body-bg);
    border-radius: 3px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); /* Shadow might need adjustment */
    border: 1px solid var(--bs-border-color); /* Add border for definition */
    margin: 0.5rem 0;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    padding: 0.75rem 1.25rem !important;
    border: none;
}

.card-header h1 {
    color: white;
    font-size: 1.4rem;
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header h1 i {
    font-size: 1.3rem;
    opacity: 0.9;
}



.scrollable-div {
    padding: 0px;
    /* Use theme background and text color */
    background-color: var(--bs-body-bg);
    font-family: 'Consolas', monospace;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    color: var(--bs-body-color);
    font-style: italic;
    white-space: normal;
}

.scrollable-div > div {
    white-space: nowrap;
    overflow: visible;
    display: block;
    width: 100%;
    padding: 2px 0;
    min-width: max-content;
}

@media screen and (max-width: 768px) {
    .scrollable-div {
        overflow-x: auto;
        white-space: normal;
        width: 100%;
        padding: 0;
    }

    .scrollable-div > div {
        white-space: nowrap;
        overflow: visible;
        display: block;
        width: 100%;
        padding: 2px 0;
        min-width: max-content;
    }
}

/* Command List Styles */
.list-group {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); /* Shadow might need adjustment */
    /* Use theme background */
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color); /* Add border */
}

.list-group-item:first-child {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.list-group-item:first-child:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}

.list-group-item:first-child .card-header {
    background: none !important;
    padding: 0.75rem 1.25rem !important;
}

.list-group-item:first-child h1 {
    color: white;
    font-size: 1.4rem;
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.list-group-item:first-child i {
    font-size: 1.3rem;
    opacity: 0.9;
}

.command-list-container {
    /* Use theme background and border */
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-top: none;
    max-height: 500px;
    overflow-y: auto;
}

.command-item {
    padding: 0.5rem 1rem;
    border-left: none;
    border-right: none;
    /* Use theme border */
    border-color: var(--bs-border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
    position: relative;
}

.command-item:hover {
    /* Use theme hover background */
    background-color: var(--bs-secondary-bg);
    padding-left: 1.5rem;
}

.command-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.command-item:hover::before {
    opacity: 1;
}

.command-type {
    font-weight: 600;
    min-width: 120px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    text-align: left;
}

/* Command Type Colors - Adjusted for dark theme */
.command-item:has(.command-type:contains("NORMAL")) .command-type {
    background: rgba(var(--bs-success-rgb), 0.15);
    color: var(--bs-success-text-emphasis);
}

.command-item:has(.command-type:contains("INVEST")) .command-type {
    background: rgba(var(--bs-primary-rgb), 0.15);
    color: var(--bs-primary-text-emphasis);
}

.command-item:has(.command-type:contains("SIGNAL")) .command-type {
    background: rgba(var(--bs-warning-rgb), 0.15);
    color: var(--bs-warning-text-emphasis);
}

.command-item:has(.command-type:contains("DELAY")) .command-type {
    background: rgba(var(--bs-purple-rgb), 0.15);
    color: var(--bs-purple-text-emphasis);
}

.command-item:has(.command-type:contains("PF")) .command-type {
    background: rgba(var(--bs-pink-rgb), 0.15); /* Assuming pink for PF */
    color: var(--bs-pink-text-emphasis);
}

.command-item:has(.command-type:contains("INDI")) .command-type {
    background: rgba(var(--bs-teal-rgb), 0.15); /* Assuming teal for INDI */
    color: var(--bs-teal-text-emphasis);
}

.command-item:has(.command-type:contains("FAKE")) .command-type {
    background: rgba(var(--bs-danger-rgb), 0.15);
    color: var(--bs-danger-text-emphasis);
}

.command-item:has(.command-type:contains("ALERT")) .command-type {
    background: rgba(var(--bs-orange-rgb), 0.15); /* Assuming orange for ALERT */
    color: var(--bs-orange-text-emphasis);
}

.command-item:has(.command-type:contains("ORDER")) .command-type {
    background: rgba(var(--bs-info-rgb), 0.15);
    color: var(--bs-info-text-emphasis);
}

.command-item:has(.command-type:contains("TEST")) .command-type {
    background: rgba(var(--bs-cyan-rgb), 0.15); /* Assuming cyan for TEST */
    color: var(--bs-cyan-text-emphasis);
}

.command-item:has(.command-type:contains("MEDIA")) .command-type,
.command-item:has(.command-type:contains("VOLUME")) .command-type {
    background: rgba(var(--bs-indigo-rgb), 0.15); /* Assuming indigo */
    color: var(--bs-indigo-text-emphasis);
}

.command-item:has(.command-type:contains("LOG")) .command-type,
.command-item:has(.command-type:contains("BUILD")) .command-type,
.command-item:has(.command-type:contains("GIT")) .command-type {
    background: rgba(var(--bs-secondary-rgb), 0.15);
    color: var(--bs-secondary-text-emphasis);
}

.command-item:has(.command-type:contains("RESTART")) .command-type,
.command-item:has(.command-type:contains("SHUTDOWN")) .command-type {
    background: rgba(var(--bs-danger-rgb), 0.25); /* Slightly stronger danger */
    color: var(--bs-danger-text-emphasis);
}

.command-syntax {
    /* Use theme secondary text color */
    color: var(--bs-secondary-color);
    font-family: 'Consolas', monospace;
    font-size: 0.95rem;
    flex-grow: 1;
}

.command-item:hover .command-type {
    transform: translateX(5px);
    transition: transform 0.2s ease;
}

@media screen and (max-width: 768px) {
    .card-header {
        padding: 0.6rem 1rem !important;
    }

    .card-header h1, 
    .list-group-item:first-child h1 {
        font-size: 1.0rem;
    }

    .card-header h1 i,
    .list-group-item:first-child i {
        font-size: 1.0rem;
    }

    #logConsole {
        font-size: 1.0rem;
    }

    .command-item {
        padding: 0.4rem 0.75rem;
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }

    .command-type {
        font-size: 0.75rem;
        min-width: auto;
        padding: 0.2rem 0.5rem;
        white-space: nowrap;
        text-align: left;
    }

    .command-syntax {
        font-size: 0.75rem;
        width: auto;
        word-break: normal;
        white-space: nowrap;
        overflow: auto;
    }

    .command-list-container {
        max-height: 500px;
        overflow-x: auto;
    }
}

/* Table Container */
.table-responsive {
    border-radius: 16px;
    background: white;
    padding: 0;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .table thead th {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    .table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .badge {
        font-size: 0.8em;
        padding: 0.6em 0.1em;
    }
}

/* Hide bottom border for last row */
.modern-table tbody tr:last-child td {
    border-bottom: none;
}

/* Form Edit Order Styles */
.form {
    max-width: 100%;
    padding: 10px;
    font-size: 0.85rem;
}

.form .form-group {
    margin-bottom: 0.5rem;
}

.form label {
    display: block;
    margin-bottom: 0.2rem;
    font-weight: 500;
    /* Use theme secondary text color */
    color: var(--bs-secondary-color);
    font-size: 0.8rem;
}

.form .form-control,
.form .form-select {
    width: 100%;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    line-height: 1.2;
    /* Use theme border, background, text */
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.form .form-control:focus,
.form .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 16px 12px;
    padding-right: 2rem;
}

@media screen and (max-width: 768px) {
    .form {
        font-size: 0.8rem;
        padding: 8px;
    }
    
    .form label {
        font-size: 0.75rem;
    }
    
    .form .form-control,
    .form .form-select {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* Log Time Style - Adjusted for dark theme */
.log-date {
    color: var(--bs-teal-text-emphasis); /* Teal for date */
    font-weight: 500;
    font-family: 'Consolas', monospace;
    background: rgba(var(--bs-teal-rgb), 0.15);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    display: inline-block;
    white-space: nowrap;
}

.log-time {
    color: var(--bs-primary-text-emphasis); /* Primary for time */
    font-weight: 600;
    font-family: 'Consolas', monospace;
    background: rgba(var(--bs-primary-rgb), 0.15);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    display: inline-block;
    white-space: nowrap;
}

@media screen and (max-width: 768px) {
    .scrollable-div {
        overflow-x: auto;
        white-space: normal;
        width: 100%;
        padding: 0;
    }

    .scrollable-div > div {
        white-space: nowrap;
        overflow: visible;
        display: block;
        width: 100%;
        padding: 2px 0;
        min-width: max-content;
    }

    .log-date, .log-time {
        font-size: 0.85rem;
        padding: 0.15rem 0.3rem;
        white-space: nowrap;
    }
}

.card-text.scrollable-div {
    font-size: 14px !important;
    font-style: normal;
    line-height: 21px !important;
    width: 100%;
    /* height: 280px; */
    padding: 4px;
    border-color: transparent;
    font-family: sans-serif;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media screen and (max-width: 768px) {
    .card-text.scrollable-div {
        white-space: pre-wrap;
        word-wrap: break-word;
        overflow-wrap: break-word;
        font-size: 13px !important;
        line-height: 19px !important;
        padding: 3px;
    }
}

.table-cell-edited {
    position: relative;
}

.table-cell-edited::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 10px solid red;
    border-left: 10px solid transparent;
}
 
 
