/* =====================================================
   STOCK BEACH BAR - Complete Stylesheet
   Version: 2.0 - Sidebar Layout
   ===================================================== */

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #eef2f5;
    min-height: 100vh;
    color: #1a2a2a;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   FLASH MESSAGE
   ============================================ */
.flash-message {
    background: #4cafb0;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    margin: 0 0 15px 0;
    animation: slideDown 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.flash-message i {
    font-size: 16px;
}

@keyframes slideDown {
    from {
        transform: translateY(-15px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid #e8f0f0;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border-color: #4cafb0;
}

.stat-icon {
    font-size: 30px;
    opacity: 0.8;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: #f5f8f8;
}

.stat-icon i {
    font-size: 28px;
}

.stat-info h4 {
    font-size: 11px;
    color: #6a8a8a;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 3px;
}

.stat-info h4 i {
    font-size: 11px;
    margin-right: 4px;
}

.stat-number {
    font-size: 26px;
    font-weight: 700;
    color: #0d3b3b;
}

.stat-number.danger {
    color: #e74c3c;
}
.stat-number.warning {
    color: #f39c12;
}
.stat-number.success {
    color: #27ae60;
}

.stat-card-internal {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    border: 1px solid #ffc107;
}

.stat-card-internal .stat-icon {
    background: rgba(255, 193, 7, 0.15);
}

.stat-card-internal .stat-number {
    color: #856404;
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e8f0f0;
    overflow: hidden;
    margin-top: 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.table-header {
    padding: 12px 18px;
    background: #f5f8f8;
    border-bottom: 1px solid #e8f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.table-header h3 {
    color: #0d3b3b;
    font-size: 14px;
    font-weight: 600;
}

.table-header h3 i {
    margin-right: 6px;
    color: #4cafb0;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.table-scroll {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 700px;
}

th {
    background: #f5f8f8;
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #2c4a4a;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 2px solid #dce8e8;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

th i {
    margin-right: 4px;
    font-size: 11px;
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid #e8f0f0;
    font-size: 12px;
    vertical-align: middle;
}

tr:hover {
    background: #f8fbfb;
}

tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.badge i {
    font-size: 10px;
    margin-right: 3px;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}
.badge-danger {
    background: #f8d7da;
    color: #721c24;
}
.badge-warning {
    background: #fff3cd;
    color: #856404;
}
.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}
.badge-active {
    background: #d4edda;
    color: #155724;
}
.badge-paid {
    background: #cce5ff;
    color: #004085;
}
.badge-cancelled {
    background: #f8d7da;
    color: #721c24;
}
.badge-primary {
    background: #cce5ff;
    color: #004085;
}
.badge-secondary {
    background: #e8f0f0;
    color: #2c4a4a;
}

/* ============================================
   ROW COLORS
   ============================================ */
.low-stock-row {
    background: #fff8e1 !important;
}
.low-stock-row td:first-child {
    border-left: 3px solid #f39c12;
}

.out-of-stock-row {
    background: #fde8e8 !important;
}
.out-of-stock-row td:first-child {
    border-left: 3px solid #e74c3c;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.btn i {
    font-size: 12px;
}

.btn-primary {
    background: #0d3b3b;
    color: white;
}
.btn-primary:hover {
    background: #1a5a5a;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(13, 59, 59, 0.25);
}

.btn-success {
    background: #27ae60;
    color: white;
}
.btn-success:hover {
    background: #1e8449;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.25);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}
.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.25);
}

.btn-warning {
    background: #f39c12;
    color: white;
}
.btn-warning:hover {
    background: #d68910;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.25);
}

.btn-info {
    background: #3498db;
    color: white;
}
.btn-info:hover {
    background: #2471a3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.25);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}
.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
}
.btn-sm i {
    font-size: 11px;
}

.btn-xs {
    padding: 2px 6px;
    font-size: 10px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #0d3b3b;
    font-size: 12px;
}

.form-group label i {
    width: 18px;
    color: #4cafb0;
    margin-right: 4px;
}

.form-group label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dce8e8;
    border-radius: 8px;
    font-size: 12px;
    font-family: inherit;
    transition: all 0.3s;
    background: #ffffff;
    color: #1a2a2a;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4cafb0;
    box-shadow: 0 0 0 3px rgba(76, 175, 176, 0.12);
}

.form-group input:disabled {
    background: #f5f8f8;
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group .help-text {
    font-size: 11px;
    color: #6a8a8a;
    margin-top: 3px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-content-large {
    max-width: 700px;
}
.modal-content-small {
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e8f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f5f8f8;
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    color: #0d3b3b;
    font-size: 16px;
    font-weight: 600;
}

.modal-header h3 i {
    margin-right: 8px;
    color: #4cafb0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #6a8a8a;
    transition: color 0.3s;
    line-height: 1;
    padding: 0 4px;
}

.modal-close:hover {
    color: #0d3b3b;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e8f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #fafcfc;
    border-radius: 0 0 16px 16px;
}

/* ============================================
   MENU GRID
   ============================================ */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 12px 0;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.menu-item-card {
    background: #f5f8f8;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.menu-item-card:hover {
    background: #0d3b3b;
    color: white;
    transform: scale(1.03);
    border-color: #0d3b3b;
    box-shadow: 0 4px 12px rgba(13, 59, 59, 0.15);
}

.menu-item-card .item-name {
    font-weight: 600;
    font-size: 12px;
}

.menu-item-card .item-price {
    font-size: 11px;
    color: #27ae60;
    margin-top: 3px;
}

.menu-item-card:hover .item-price {
    color: #ddd;
}

/* ============================================
   INTERNAL TABS
   ============================================ */
.internal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid #dce8e8;
    padding-bottom: 8px;
    flex-wrap: wrap;
}

.internal-tabs .tab-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
    background: #e8f0f0;
    color: #2c4a4a;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
}

.internal-tabs .tab-btn.active {
    background: #0d3b3b;
    color: white;
}

.internal-tabs .tab-btn:hover:not(.active) {
    background: #d4e4e4;
}

.internal-tabs .tab-btn .tab-count {
    background: rgba(255,255,255,0.2);
    padding: 0 6px;
    border-radius: 8px;
    font-size: 10px;
    margin-left: 3px;
}

.internal-tabs .tab-btn.active .tab-count {
    background: rgba(255,255,255,0.2);
}

/* ============================================
   PRODUCT NAME DISPLAY (Internal)
   ============================================ */
.product-name-display {
    font-size: 16px;
    font-weight: 700;
    color: #0d3b3b;
    padding: 6px 12px;
    background: #f5f8f8;
    border-radius: 8px;
    display: inline-block;
}

/* ============================================
   REPORT FILTERS
   ============================================ */
.report-filters {
    background: #f5f8f8;
    padding: 16px 18px;
    border-radius: 12px;
    margin: 12px 0 20px;
    border: 1px solid #e8f0f0;
}

.report-filters .filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.report-filters .filter-row .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 130px;
}

.report-filters .filter-row .form-group label {
    font-size: 11px;
    margin-bottom: 3px;
}

.report-filters .filter-row .form-group input,
.report-filters .filter-row .form-group select {
    padding: 6px 10px;
    font-size: 12px;
}

/* ============================================
   ORDER SUMMARY
   ============================================ */
.order-summary {
    background: #f5f8f8;
    padding: 14px;
    border-radius: 10px;
    margin: 12px 0;
    border: 1px solid #e8f0f0;
}

.order-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #dce8e8;
    font-size: 12px;
}

.order-summary-item:last-child {
    border-bottom: none;
}

.order-summary-total {
    text-align: right;
    font-size: 16px;
    font-weight: 700;
    color: #0d3b3b;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 2px solid #dce8e8;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .stat-number {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .stat-card {
        padding: 12px 14px;
        gap: 10px;
    }
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    .stat-icon i {
        font-size: 20px;
    }
    .stat-number {
        font-size: 20px;
    }
    .stat-info h4 {
        font-size: 10px;
    }
    
    .table-scroll {
        max-height: 400px;
    }
    table {
        font-size: 11px;
        min-width: 600px;
    }
    th, td {
        padding: 8px 10px;
    }
    
    .modal-content {
        max-width: 95%;
        margin: 10px;
    }
    .modal-header h3 {
        font-size: 14px;
    }
    .modal-body {
        padding: 14px;
    }
    .modal-footer {
        padding: 10px 14px;
        flex-wrap: wrap;
    }
    .modal-footer .btn {
        flex: 1;
        justify-content: center;
    }
    
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .report-filters .filter-row {
        flex-direction: column;
    }
    .report-filters .filter-row .form-group {
        width: 100%;
        min-width: unset;
    }
    
    .internal-tabs {
        flex-direction: column;
        align-items: stretch;
    }
    .internal-tabs .tab-btn {
        justify-content: center;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stat-card {
        padding: 10px 12px;
    }
    .stat-number {
        font-size: 18px;
    }
    .stat-icon {
        width: 36px;
        height: 36px;
    }
    .stat-icon i {
        font-size: 18px;
    }
    
    .btn {
        font-size: 11px;
        padding: 5px 10px;
    }
    .btn-sm {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    table {
        font-size: 10px;
        min-width: 500px;
    }
    th, td {
        padding: 6px 8px;
    }
    
    .modal-content {
        max-width: 98%;
        padding: 0;
    }
    .modal-header {
        padding: 10px 14px;
    }
    .modal-body {
        padding: 12px;
    }
    .modal-footer {
        padding: 8px 12px;
        flex-direction: column;
    }
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    .menu-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #e8f0f0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #b0c8c8;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8aa8a8;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .no-print {
        display: none !important;
    }
    body {
        background: white;
        padding: 0;
        margin: 0;
    }
    .app-container {
        display: block;
    }
    .sidebar {
        display: none !important;
    }
    .main-content {
        padding: 20px;
    }
    .top-bar {
        border-bottom: 1px solid #ddd;
    }
    .flash-message,
    .top-actions {
        display: none !important;
    }
    .stat-card {
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    table {
        font-size: 10px;
    }
    th {
        background: #f5f8f8 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .badge {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .modal {
        display: none !important;
    }
}
