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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: white;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}


header, footer {
    background-color: #1a1a1a;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header {
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 100;
}

main {
    flex: 1;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.screen { display: none; width: 100%; }
.screen.active { display: block; }

#admin-view { display: none; }

.app-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header-cart-btn {
    background: none;
    padding: 5px;
    font-size: 14px;
    color: #b0b0b0;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-cart-btn:hover { color: white; background: none; }
.header-cart-btn span { color: #ff3366; font-weight: bold; }

.header-logout-btn {
    background-color: #333;
    color: #b0b0b0;
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
    margin-left: 10px;
}

.header-logout-btn:hover { background-color: #444; color: white; }

#header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

h1 {
    font-weight: 700;
    font-size: 32px;
    margin-bottom: 16px;
    text-align: center;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.1s;
    margin: 5px;
}

.big-btn {
    background-color: #ff3366;
    color: white;
    width: 100%;
    max-width: 400px;
    font-size: 20px;
    padding: 20px;
    margin-top: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.big-btn:hover { background-color: #ff0044; }

.secondary-btn {
    background-color: #333;
    color: #ddd;
}

.secondary-btn:hover { background-color: #444; }

#screen-home.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#screen-home h1 {
    font-size: 36px;
    margin-bottom: 6px;
}

.home-subtitle {
    color: #b0b0b0;
    font-size: 16px;
    margin-bottom: 10px;
}

.circle-btn-container {
    display: flex;
    justify-content: center;
    margin: 36px 0 28px;
}

.circle-btn {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background-color: #ff3366;
    color: white;
    font-size: 20px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
    transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 30px rgba(255, 51, 102, 0.45);
    margin: 0;
}

.circle-btn:hover {
    transform: scale(1.06);
    background-color: #ff0044;
    box-shadow: 0 10px 36px rgba(255, 0, 68, 0.55);
}

.circle-btn:active {
    transform: scale(0.92);
    box-shadow: 0 3px 12px rgba(255, 51, 102, 0.3);
}

.circle-btn.joined {
    background-color: #28a745;
    box-shadow: 0 8px 30px rgba(40, 167, 69, 0.45);
}

.circle-btn.joined:hover {
    background-color: #218838;
    box-shadow: 0 10px 36px rgba(40, 167, 69, 0.55);
}

.menu-layout {
    display: flex;
    gap: 28px;
    width: 100%;
    align-items: flex-start;
}

.menu-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 180px;
    width: 180px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    margin-right: auto;
}

.category-btn {
    background-color: #2a2a2a;
    color: #b0b0b0;
    padding: 18px 20px;
    border-radius: 12px;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    transition: background-color 0.2s, color 0.2s;
}

.category-btn:hover {
    background-color: #ff3366;
    color: white;
}

#menu-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.back-btn {
    margin-top: 20px;
}

.category-header {
    font-size: 24px;
    font-weight: 700;
    color: #ff3366;
    text-align: left;
    margin-top: 24px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #2a2a2a;
    scroll-margin-top: 20px;
}

.category-header:first-child {
    margin-top: 0;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.menu-item-card {
    background-color: #1a1a1a;
    border-radius: 14px;
    overflow: hidden;
    text-align: left;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.menu-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.menu-card-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.menu-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.menu-card-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 3px;
}

.menu-card-price {
    font-size: 16px;
    font-weight: 700;
    color: #ff3366;
    margin-bottom: 4px;
}

.menu-card-desc {
    font-size: 12px;
    color: #b0b0b0;
    margin-bottom: 6px;
    flex: 1;
}

.menu-card-stock {
    font-size: 11px;
    font-weight: bold;
    color: #ffc107;
    margin-bottom: 8px;
}

.menu-card-btn {
    background-color: #ff3366;
    color: white;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    margin: 0;
    width: 100%;
}

.menu-card-btn:hover:not([disabled]) { background-color: #ff0044; }

.menu-card-btn[disabled] {
    background-color: #444;
    color: #888;
    cursor: not-allowed;
}

#cart-list {
    list-style: none;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

#cart-list li {
    background-color: #1a1a1a;
    padding: 14px 18px;
    margin: 8px 0;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-name {
    font-size: 15px;
    font-weight: 500;
    margin-right: 12px;
}

.cart-item-price {
    font-size: 15px;
    font-weight: 700;
    color: #ff3366;
}

.cart-empty {
    color: #888;
    text-align: center;
    background: none !important;
    justify-content: center !important;
}

.cart-total {
    font-size: 22px;
    font-weight: 700;
    color: #ff3366;
    text-align: right;
    width: 100%;
    max-width: 560px;
    margin: 12px auto 4px;
    padding-right: 4px;
}

#screen-checkout.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.checkout-summary {
    background-color: #1a1a1a;
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 520px;
    margin-bottom: 24px;
}

.checkout-summary ul {
    list-style: none;
    margin-bottom: 0;
}

.checkout-summary li {
    padding: 12px 0;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.checkout-summary li:last-child {
    border-bottom: none;
}

.checkout-summary li span:last-child {
    font-weight: 700;
    color: #ff3366;
}

.checkout-total {
    font-size: 24px;
    font-weight: 700;
    color: #ff3366;
    text-align: right;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 2px solid #333;
}

#auth-view {
    width: 100%;
}

.auth-screen { display: none; width: 100%; max-width: 420px; margin: 0 auto; }

.auth-form {
    background-color: #1a1a1a;
    border-radius: 16px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-form input {
    background-color: #333;
    border: none;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 15px;
    color: white;
    font-family: inherit;
    outline: none;
    transition: background-color 0.2s;
}

.auth-form input:focus { background-color: #3d3d3d; }
.auth-form input::placeholder { color: #888; }

.auth-error {
    font-size: 13px;
    color: #ff3366;
    min-height: 18px;
    margin: 0;
}

.auth-switch-btn {
    width: 100%;
    font-size: 14px;
    margin-top: 0;
}

#admin-view-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px;
}

#admin-queue-list {
    list-style: none;
    width: 100%;
    max-width: 600px;
}

#admin-queue-list li {
    background-color: #1a1a1a;
    padding: 16px 20px;
    margin: 10px 0;
    border-radius: 10px;
    width: 100%;
    font-size: 15px;
    display: flex;
    gap: 8px;
}

#notification-toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: #28a745;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    pointer-events: none;
}

#notification-toast.show {
    transform: translateX(-50%) translateY(0px);
}

.queue-item {
    cursor: pointer;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
}

.queue-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.queue-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.queue-expand-hint {
    font-size: 12px;
    color: #888;
    transition: transform 0.2s;
    user-select: none;
}

.queue-item-order {
    display: none;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #333;
    animation: expandIn 0.2s ease;
}

.queue-item.expanded .queue-item-order {
    display: block;
}

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

.queue-order-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.queue-order-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #c0c0c0;
    background: none !important;
    padding: 4px 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

.queue-order-list li span:last-child {
    color: #ff3366;
    font-weight: 600;
}

.queue-no-order {
    justify-content: center !important;
    color: #666 !important;
    font-style: italic;
}

.queue-order-total {
    text-align: right;
    font-weight: 700;
    color: #ff3366;
    font-size: 15px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #333;
}

.queue-ready-btn {
    background-color: #28a745;
    color: white;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    flex-shrink: 0;
    font-weight: 600;
    transition: background-color 0.15s;
}

.queue-ready-btn:hover { background-color: #1e8035; }

.queue-remove-btn {
    background-color: #ff3366;
    color: white;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    margin: 0 0 0 auto;
    flex-shrink: 0;
}

.queue-remove-btn:hover { background-color: #ff0044; }

.admin-section-title {
    font-size: 24px;
    font-weight: 700;
    margin: 32px 0 16px;
    color: white;
    width: 100%;
    max-width: 600px;
    text-align: left;
}

.admin-form {
    background-color: #1a1a1a;
    border-radius: 16px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 600px;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    background-color: #333;
    border: none;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 15px;
    color: white;
    font-family: inherit;
    outline: none;
    transition: background-color 0.2s;
    width: 100%;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus { background-color: #3d3d3d; }

.admin-form input::placeholder,
.admin-form textarea::placeholder { color: #888; }

.admin-form select option { background-color: #333; }

.admin-form-row {
    display: flex;
    gap: 12px;
}

.admin-form-row input { flex: 1; }

.admin-error {
    font-size: 13px;
    color: #ff3366;
    min-height: 18px;
    margin: 0;
}

.circle-btn.served {
    background-color: #007bff;
    box-shadow: 0 8px 30px rgba(0, 123, 255, 0.45);
    cursor: default;
}

.circle-btn.served:hover {
    transform: none;
    background-color: #007bff;
    box-shadow: 0 8px 30px rgba(0, 123, 255, 0.45);
}

.circle-btn.cooldown,
.circle-btn.locked {
    background-color: #555;
    box-shadow: 0 8px 30px rgba(80, 80, 80, 0.3);
    cursor: not-allowed;
}

.circle-btn.cooldown:hover,
.circle-btn.locked:hover {
    transform: none;
    background-color: #555;
    box-shadow: 0 8px 30px rgba(80, 80, 80, 0.3);
}

.cart-remove-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background-color 0.15s;
    flex-shrink: 0;
    line-height: 1;
    margin-left: 8px;
}

.cart-remove-btn:hover {
    color: #ff3366;
    background-color: rgba(255, 51, 102, 0.12);
}

.menu-card-rating {
    font-size: 13px;
    color: #ffc107;
    font-weight: 700;
    margin-bottom: 2px;
}

.menu-card-review-count {
    font-size: 11px;
    color: #888;
    font-weight: 400;
}

.menu-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.tag-loved {
    background-color: #3a2a00 !important;
    color: #ffc107 !important;
    border: 1px solid #6a4e00 !important;
}

.review-section {
    border-top: 1px solid #2a2a2a;
    padding-top: 20px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.review-toggle-btn {
    align-self: flex-start;
}

.review-form {
    background-color: #111;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-form-label {
    font-size: 13px;
    font-weight: 600;
    color: #aaa;
    margin: 0;
}

.star-widget {
    display: flex;
    gap: 2px;
}

.star-widget .star {
    font-size: 26px;
    cursor: pointer;
    color: #444;
    transition: color 0.1s ease, transform 0.1s ease;
    user-select: none;
    line-height: 1;
}

.star-widget .star.selected {
    color: #ffc107;
    transform: scale(1.15);
}

.star-widget .star.hover {
    color: #ffda60;
    transform: scale(1.1);
}

.star-hint {
    font-size: 13px;
    color: #888;
    margin: 0;
}

.review-form textarea {
    background-color: #222;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    color: white;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.review-form textarea:focus {
    border-color: #ff3366;
}

.review-form textarea::placeholder { color: #666; }

.detail-rating-summary {
    font-size: 17px;
    color: #ffc107;
    font-weight: 700;
    margin: 0;
}

.detail-rating-count {
    font-size: 13px;
    color: #888;
    font-weight: 400;
}

.detail-rating-summary.no-rating {
    color: #666;
    font-size: 14px;
    font-weight: 400;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-item {
    background-color: #111;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-author {
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.review-stars {
    font-size: 14px;
    color: #ffc107;
    font-weight: 600;
}

.review-text {
    font-size: 14px;
    color: #c0c0c0;
    line-height: 1.5;
    margin: 0;
}

.review-date {
    font-size: 11px;
    color: #555;
    margin: 0;
}

#screen-item-detail.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 32px;
}

#item-detail-content {
    background-color: #1a1a1a;
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    max-width: 620px;
}

.detail-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.detail-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.detail-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.detail-price {
    font-size: 24px;
    font-weight: 700;
    color: #ff3366;
    white-space: nowrap;
}

.detail-category {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
}

.detail-desc {
    font-size: 15px;
    color: #c0c0c0;
    line-height: 1.65;
    margin: 0;
}

.detail-nutrition {
    background-color: #111;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-nutrition-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-nutrition-label {
    font-size: 13px;
    font-weight: 600;
    color: #aaa;
    min-width: 110px;
    flex-shrink: 0;
}

.detail-nutrition-value {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.detail-allergens {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.allergen-badge {
    background-color: #ff3366;
    color: white;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.no-allergens {
    color: #28a745;
    font-size: 13px;
    font-weight: 600;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 2px;
}

.diet-tag {
    background-color: #1a3a1a;
    color: #6fcf6f;
    padding: 4px 13px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #2a5a2a;
}

.detail-stock {
    font-size: 13px;
    font-weight: 700;
    margin: 0;
}

.detail-add-btn {
    margin-top: 4px;
}

.admin-dashboard {
    width: 100%;
    max-width: 680px;
    background-color: #1a1a1a;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 32px;
}

.sales-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.sales-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.sales-table thead th {
    position: sticky;
    top: 0;
    background-color: #222;
    padding: 13px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    border-bottom: 1px solid #333;
    white-space: nowrap;
}

.sales-table thead th:first-child { text-align: left; }

.sales-table tbody {
    display: block;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1a1a;
}

.sales-table tbody::-webkit-scrollbar { width: 6px; }
.sales-table tbody::-webkit-scrollbar-track { background: #1a1a1a; }
.sales-table tbody::-webkit-scrollbar-thumb { background-color: #444; border-radius: 3px; }

.sales-table thead tr,
.sales-table tfoot tr,
.sales-table tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.sales-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #222;
    font-size: 14px;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sales-table td:first-child { text-align: left; color: white; }

.num-col { text-align: right !important; }

.item-name-col { text-align: left; }

.profit-positive { color: #28a745 !important; font-weight: 600; }
.profit-zero { color: #666 !important; }

.sales-totals-row td {
    background-color: #222;
    border-top: 2px solid #444;
    border-bottom: none;
    font-size: 14px;
    color: white;
    padding: 13px 14px;
}

.sales-totals-row td:first-child { text-align: left; }

.sales-empty {
    text-align: center !important;
    color: #666;
    padding: 28px !important;
    font-style: italic;
}

.sales-table tfoot { display: table-footer-group; }

.admin-ai-insights {
    background-color: #1a1a1a;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 680px;
    margin-bottom: 16px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#ai-insights-content {
    background-color: #111;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #ff3366;
}

#ai-insights-content ul {
    list-style-type: disc;
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#ai-insights-content li {
    font-size: 15px;
    color: #e0e0e0;
    line-height: 1.5;
}

#generate-insights-btn {
    align-self: flex-start;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 900px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .detail-img { height: 200px; }
    .detail-title { font-size: 20px; }
    .detail-price { font-size: 20px; }

    .menu-layout {
        flex-direction: column;
    }

    .menu-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        position: static;
        min-width: unset;
        width: 100%;
    }

    .category-btn {
        flex: 1;
        text-align: center;
        min-width: 80px;
        padding: 14px 12px;
    }

    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
