* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --warning-color: #ea580c;
    --info-color: #0891b2;
    --secondary-color: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    margin-right: 400px;
}

header {
    background: var(--card-bg);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.spotify-player {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, #1db954 0%, #191414 100%);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(29, 185, 84, 0.4);
}

.spotify-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.spotify-controls label {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.playlist-select {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: white;
    color: #191414;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.playlist-select:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.playlist-select:focus {
    outline: 2px solid #1db954;
    outline-offset: 2px;
}

.spotify-player iframe {
    border-radius: 8px;
    display: block;
}

.tables-section h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 22px;
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.table-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.table-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.table-card.available {
    border-color: var(--success-color);
}

.table-card.occupied {
    border-color: var(--warning-color);
    background: linear-gradient(135deg, #fff 0%, #fef3c7 100%);
}

.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.table-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.table-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.table-status.available {
    background: #dcfce7;
    color: var(--success-color);
}

.table-status.occupied {
    background: #fed7aa;
    color: var(--warning-color);
}

.table-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.table-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.table-info-row .label {
    color: var(--text-secondary);
}

.table-info-row .value {
    color: var(--text-primary);
    font-weight: 600;
}

.table-current-summary {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

.summary-row .summary-label {
    color: var(--text-secondary);
    font-size: 12px;
}

.summary-row .summary-value {
    font-weight: 600;
    color: var(--text-primary);
}

.summary-row.summary-total {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 2px solid var(--primary-color);
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
}

.summary-row.summary-total .summary-label,
.summary-row.summary-total .summary-value {
    color: var(--primary-color);
    font-weight: 700;
}

.open-tables-summary {
    margin-top: 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.open-tables-summary h2 {
    color: white;
    margin-bottom: 20px;
    font-size: 22px;
}

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

.summary-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.summary-item .summary-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
}

.summary-item .summary-value {
    color: white;
    font-size: 24px;
    font-weight: 700;
}

.summary-item.summary-total {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.summary-item.summary-total .summary-value {
    font-size: 28px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--card-bg);
    margin: 50px auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content.modal-small {
    max-width: 500px;
}

.modal-content.modal-large {
    max-width: 1000px;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 24px;
}

.session-info {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row.total {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    border-top: 2px solid var(--primary-color);
    margin-top: 10px;
    padding-top: 15px;
}

.info-row .label {
    color: var(--text-secondary);
}

.info-row .value {
    font-weight: 600;
    color: var(--text-primary);
}

.session-items {
    margin: 20px 0;
}

.session-items h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

table thead {
    background: var(--bg-color);
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:hover {
    background: var(--bg-color);
}

.products-section {
    margin: 20px 0;
}

.products-section h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.product-btn {
    padding: 16px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.product-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.product-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.product-price {
    color: var(--text-secondary);
    font-size: 14px;
}

.product-btn:hover .product-price {
    color: white;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.close-session-info {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.split-info {
    background: #dbeafe;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.report-content {
    margin-top: 20px;
}

.report-summary h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.summary-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
}

.report-tables h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--text-primary);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    animation: slideIn 0.3s ease;
    z-index: 2000;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.info {
    background: var(--info-color);
}

.btn-remove {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.btn-remove:hover {
    opacity: 0.8;
}

.management-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.table-container {
    overflow-x: auto;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: var(--success-color);
}

.badge-secondary {
    background: #f1f5f9;
    color: var(--text-secondary);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.info-box {
    background: #dbeafe;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.summary-card.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
}

.summary-card.warning .summary-label {
    color: #78350f;
}

.summary-card.warning .summary-value {
    color: #92400e;
    font-weight: 700;
}

.summary-card.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left: 4px solid #10b981;
}

.summary-card.success .summary-label {
    color: #064e3b;
}

.summary-card.success .summary-value {
    color: #065f46;
    font-weight: 700;
}

.cash-summary {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.cash-card {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(30, 64, 175, 0.3);
    min-width: 400px;
}

.cash-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.cash-value {
    color: white;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.cash-formula {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-style: italic;
}

.report-date-controls {
    margin-bottom: 20px;
}

.date-inputs {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 15px;
}

.date-inputs .form-group {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.date-inputs .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 13px;
}

.date-inputs .form-control {
    min-width: 150px;
}

.date-shortcuts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.credits-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    height: calc(100vh - 250px);
}

.customers-panel {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.panel-header h3 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.customers-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.customer-item {
    padding: 15px;
    margin-bottom: 8px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customer-item:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.customer-item.active {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.customer-item.has-debt {
    border-left: 4px solid #dc2626;
}

.customer-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.customer-balance {
    font-weight: 700;
    font-size: 16px;
}

.customer-balance.debt {
    color: #dc2626;
}

.customer-balance.paid {
    color: #059669;
}

.customer-details-panel {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-y: auto;
    padding: 30px;
}

.details-content .empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #9ca3af;
    font-size: 16px;
}

.customer-header {
    margin-bottom: 30px;
}

.customer-header h2 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 28px;
}

.customer-header .phone {
    margin: 0 0 20px 0;
    color: #6b7280;
    font-size: 14px;
}

.balance-card {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.balance-card.debt {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 4px solid #dc2626;
}

.balance-card.paid {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left: 4px solid #059669;
}

.balance-card .label {
    font-size: 14px;
    color: #374151;
    font-weight: 600;
}

.balance-card .amount {
    font-size: 24px;
    font-weight: 700;
}

.balance-card.debt .amount {
    color: #dc2626;
}

.balance-card.paid .amount {
    color: #059669;
}

.transactions-section h3 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    font-size: 20px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.transaction-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.transaction-item.debt {
    border-left-color: #dc2626;
    background: linear-gradient(90deg, #fef2f2 0%, white 10%);
}

.transaction-item.payment {
    border-left-color: #059669;
    background: linear-gradient(90deg, #f0fdf4 0%, white 10%);
}

.transaction-left {
    flex: 1;
}

.transaction-type {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 5px;
}

.transaction-item.debt .transaction-type {
    color: #dc2626;
}

.transaction-item.payment .transaction-type {
    color: #059669;
}

.transaction-date {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 5px;
}

.transaction-desc {
    font-size: 14px;
    color: #374151;
    font-style: italic;
}

.transaction-right {
    text-align: right;
}

.transaction-amount {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.transaction-item.debt .transaction-amount {
    color: #dc2626;
}

.transaction-item.payment .transaction-amount {
    color: #059669;
}

.transaction-balance {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
    font-size: 15px;
}

.report-controls {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.date-filters {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.date-filters .form-group {
    margin-bottom: 0;
}

.date-filters .form-control {
    min-width: 150px;
}

.search-box {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.search-box .form-control {
    width: 100%;
}

.date-shortcuts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.performance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.performance-summary .summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.performance-summary .summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.performance-summary .summary-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 10px;
    font-weight: 500;
}

.performance-summary .summary-value {
    font-size: 28px;
    font-weight: 700;
}

#performanceTable .top-customer {
    background: linear-gradient(90deg, #fef3c7 0%, white 20%);
    font-weight: 600;
}

#performanceTable .badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

#performanceTable .badge-info {
    background: #3b82f6;
    color: white;
}

#performanceTable .badge-success {
    background: #10b981;
    color: white;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

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

    .modal-content {
        width: 95%;
        margin: 20px auto;
        padding: 20px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    table {
        font-size: 14px;
    }
}
