@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0');
  :root {
    --bg-color: #f4f6f8;
    --card-bg: #ffffff;
    --text-primary: #1a1c1e;
    --text-secondary: #44474e;
    --accent-color: #2E7D32;
    /* High contrast green */
    --accent-hover: #1B5E20;
    --border-color: #e0e0e0;
  }

  .material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    display: inline-block;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    vertical-align: middle;
    font-size: inherit;
    line-height: 1;
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  }

  html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
  }

  body {
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
  }

  .app-container {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
  }

  .view-section {
    display: none;
    flex-direction: column;
    flex: 1;
    width: 100%;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    animation: fadeIn 0.3s ease;
  }

  .view-section.active {
    display: flex;
  }

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

  /* Admin Table */
  .table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
  }
  .admin-table {
    width: 100%;
    border-collapse: collapse;
  }
  .admin-table th, .admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
  }
  .admin-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .admin-table tr:hover {
    background-color: #fafafa;
  }
  .status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
  }
  .status-active {
    background-color: #e8f5e9;
    color: #2e7d32;
  }
  .status-inactive {
    background-color: #ffebee;
    color: #c62828;
  }
  .drawer-action-btn:active {
    background-color: #2a7e2d;
    transform: scale(0.95);
  }

  /* Admin Drawer */
  .drawer-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }
  .drawer-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  .drawer-content {
    position: absolute;
    top: 0; bottom: 0;
    background-color: var(--card-bg);
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
  }
  .drawer-overlay.active .drawer-content {
    transform: translateX(0) !important;
  }
  
  .admin-drawer-btn {
    padding: 16px 20px;
    margin-bottom: 8px;
    background: none;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
  }
  .admin-drawer-btn:hover, .admin-drawer-btn:active {
    background-color: var(--background-color);
    color: var(--accent-color);
  }
  .text-danger {
    color: #d32f2f !important;
  }

  /* Toggle Switch */
  .toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
  }
  .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
  }
  .toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
  }
  input:checked + .toggle-slider {
    background-color: var(--accent-color);
  }
  input:checked + .toggle-slider:before {
    transform: translateX(26px);
  }

  .role-btn {
    width: 100%;
    margin-bottom: 16px;
    padding: 16px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: transform 0.1s, opacity 0.2s;
  }

  /* Toast Notification */
  .toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
  }
  .toast {
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
  }
  .toast.show {
    opacity: 1;
    transform: translateY(0);
  }
  .toast.success {
    background-color: var(--accent-color);
  }
  .toast.error {
    background-color: #d32f2f;
  }
  .role-btn:active {
    transform: scale(0.98);
  }
  .btn-kasir {
    background-color: var(--accent-color);
    color: white;
  }
  .btn-admin {
    background-color: #333333;
    color: white;
  }

  .login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 20px;
    height: 100%;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
  }

  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .brand-icon {
    font-size: 1.2rem;
    background-color: #e8f5e9;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .brand-text {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--accent-color), #4CAF50);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    margin: 0;
  }

  .user-icon {
    font-size: 1.5rem;
  }

  .menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 90px;
    align-content: start;
  }

  .menu-card {
    background-color: var(--card-bg);
    border-radius: 24px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    user-select: none;
  }

  .menu-card:active {
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
  }

  .menu-color-box {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    position: relative;
  }

  .qty-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #d32f2f;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s;
  }

  .qty-badge.active {
    opacity: 1;
    transform: scale(1);
  }

  .menu-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .menu-price {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
  }

  .cart-bar {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--card-bg);
    border-radius: 100px;
    padding: 8px 8px 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    cursor: pointer;
    z-index: 10;
  }

  .cart-info {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
  }

  .pay-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 100px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
  }

  .pay-btn:disabled {
    background-color: #a5d6a7;
    cursor: not-allowed;
  }

  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
    padding: 20px;
  }

  .modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  .modal-content {
    background-color: white;
    border-radius: 28px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12), 0 11px 15px -7px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.2s;
  }

  .modal-overlay.active .modal-content {
    transform: translateY(0);
  }

  .modal-content h2 {
    text-align: center;
    color: var(--accent-color);
    margin-bottom: 20px;
  }

  .receipt-details {
    margin-bottom: 16px;
    max-height: 50vh;
    overflow-y: auto;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 16px;
  }

  .receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
  }

  .receipt-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 24px;
  }

  .close-btn {
    width: 100%;
    background-color: var(--text-primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
  }

  .loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
  }

  .customer-input {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: #fcfcfc;
    margin-bottom: 16px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
  }

  .customer-input:focus {
    border-color: var(--accent-color);
  }

  .thermal-receipt {
    background-color: #fff;
    color: #111;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 20px 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    /* Jagged edge effect at bottom */
    position: relative;
  }
  .thermal-receipt::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background-size: 20px 20px;
    background-image: radial-gradient(circle at 10px 0, transparent 10px, #fff 11px);
  }

  .receipt-header {
    text-align: center;
    margin-bottom: 12px;
  }
  .receipt-logo svg {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
  }
  .receipt-title {
    font-weight: 700;
    text-transform: none;
    margin-bottom: 4px;
  }
  .receipt-divider {
    border-top: 2px dashed #999;
    margin: 12px 0;
  }
  .receipt-info {
    margin-bottom: 12px;
  }
  .receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    align-items: flex-start;
  }
  .receipt-item-name {
    flex: 1;
    padding-right: 8px;
    word-break: break-word;
  }
  .receipt-item-qty {
    width: 30px;
    text-align: center;
  }
  .receipt-item-price {
    width: 80px;
    text-align: right;
  }
  .receipt-total {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 0.95rem;
    margin-top: 12px;
  }

  .history-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
  }

  .history-list {
    margin-bottom: 16px;
    max-height: 50vh;
    overflow-y: auto;
  }

  .history-item-row {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
  }

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

  .history-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
  }

  .history-summary {
    font-size: 0.9rem;
    font-weight: 500;
  }

  .history-total {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-top: 4px;
  }

  .empty-history {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px 0;
  }

  .category-nav {
    position: sticky;
    top: 0;
    background-color: var(--card-bg);
    display: flex;
    overflow-x: auto;
    padding: 10px 16px;
    gap: 10px;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
  }

  .category-nav::-webkit-scrollbar {
    display: none;
  }

  .category-tab {
    padding: 8px 16px;
    background-color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
  }

  .category-tab.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
  }

  /* Expanding Search Bar */
  .search-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 20px;
    padding: 0 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 36px;
    height: 36px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 4px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
  }
  .search-wrapper.expanded {
    width: 200px;
    background: white;
    border: 1px solid var(--accent-color);
  }
  .search-wrapper input {
    border: none;
    background: transparent;
    outline: none;
    width: 0;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    color: var(--text-primary);
  }
  .search-wrapper.expanded input {
    width: 100%;
    opacity: 1;
    margin-left: 8px;
  }
  .search-icon {
    font-size: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
  }
  .search-wrapper.expanded .search-icon {
    color: var(--accent-color);
  }

  .qty-minus {
    position: absolute;
    bottom: -8px;
    left: -8px;
    background-color: #d32f2f;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5;
    box-shadow: 0 4px 8px rgba(211, 47, 47, 0.4);
  }

  .qty-minus.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }

  .drawer-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .drawer-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background-color: #eee;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* NEW DASHBOARD CSS */
  .dash-card {
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
  }
  .dash-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
  }
  .dash-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-top: 4px;
  }
  .dash-list {
    list-style: none;
    font-size: 0.85rem;
    padding: 0;
  }
  .dash-list li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed #eee;
  }
  .dash-list li:last-child {
    border-bottom: none;
  }
  .chart-container {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    height: 100px;
    gap: 8px;
    padding-top: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    min-width: 30px;
    height: 100%;
    justify-content: flex-end;
  }
  .chart-bar {
    width: 100%;
    max-width: 20px;
    background: var(--accent-color);
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
  }
  .chart-label {
    font-size: 0.6rem;
    color: var(--text-secondary);
    margin-top: 4px;
    text-align: center;
  }
  
  /* OPNAME STYLES */
  .opname-input {
    width: 60px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
  }
  .opname-input:focus {
    border-color: var(--accent-color);
    outline: none;
  }
  .diff-positive {
    color: #2e7d32;
    font-weight: bold;
  }
  .diff-negative {
    color: #c62828;
    font-weight: bold;
  }
  .diff-zero {
    color: var(--text-secondary);
    font-weight: bold;
  }