*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f5f7fb;
    color: #0f172a;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.sidebar__logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #22d3ee;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 20px;
    color: #0f172a;
}

.sidebar__title {
    font-weight: 600;
    margin: 0;
}

.sidebar__subtitle {
    margin: 0;
    color: #94a3b8;
    font-size: 0.875rem;
}

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

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: inherit;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar__link:hover {
    background-color: rgba(148, 163, 184, 0.12);
    color: #ffffff;
}

.sidebar__link.is-active {
    background-color: rgba(34, 211, 238, 0.18);
    color: #22d3ee;
}

.sidebar__icon {
    font-size: 1.1rem;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: inherit;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding: 20px 32px;
    border-bottom: 1px solid #e2e8f0;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(6px);
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar__name {
    font-weight: 600;
}

.theme-toggle {
    border: none;
    background: #1d4ed8;
    color: #ffffff;
    border-radius: 999px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background: #2563eb;
}

.theme-toggle__label {
    font-size: 0.875rem;
    font-weight: 500;
}

.link-button {
    border: none;
    background: none;
    color: #2563eb;
    padding: 0;
    cursor: pointer;
    font-weight: 500;
}

.link-button--danger {
    color: #dc2626;
}

.main-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.page-subtitle {
    margin: 4px 0 0;
    color: #64748b;
}

.page-actions {
    display: flex;
    gap: 12px;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
    border-radius: 16px;
    background-color: #ffffff;
    box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.2);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card--toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

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

.card__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.card__value {
    margin: 4px 0 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.card__label {
    margin: 0;
    color: #64748b;
}

.card__footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table thead {
    background-color: rgba(148, 163, 184, 0.12);
}

.table th,
.table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table--dense th,
.table--dense td {
    padding: 10px 12px;
}

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

.list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background-color: rgba(148, 163, 184, 0.1);
    border-radius: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button--primary {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    box-shadow: 0 10px 20px -12px rgba(37, 99, 235, 0.6);
}

/* Tornar apenas o primeiro caractere (emoji) branco */
.button--primary::first-letter {
    filter: brightness(0) invert(1);
    display: inline-block;
}

.button--primary:hover {
    transform: translateY(-1px);
}

.button--ghost {
    background-color: transparent;
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form__group label {
    font-weight: 600;
    font-size: 0.95rem;
}

.form__group input,
.form__group select,
.form__group textarea {
    border-radius: 10px;
    border: 1px solid #cbd5f5;
    padding: 10px 12px;
    font-size: 0.95rem;
    background-color: rgba(255, 255, 255, 0.9);
}

.form__group--checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.form__actions {
    display: flex;
    gap: 12px;
}

.form__error {
    color: #dc2626;
    font-size: 0.85rem;
}

.alert {
    border-radius: 12px;
    padding: 14px 16px;
    font-weight: 500;
}

.alert--success {
    background-color: rgba(34, 197, 94, 0.1);
    color: #15803d;
}

.alert--error {
    background-color: rgba(248, 113, 113, 0.1);
    color: #b91c1c;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(148, 163, 184, 0.18);
    color: #334155;
}

.badge--success {
    background: rgba(34, 197, 94, 0.18);
    color: #15803d;
}

.badge--muted {
    background: rgba(148, 163, 184, 0.25);
    color: #475569;
}

.badge--status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #b45309;
}

.badge--status-preparing {
    background: rgba(96, 165, 250, 0.2);
    color: #1d4ed8;
}

.badge--status-delivered {
    background: rgba(34, 197, 94, 0.2);
    color: #15803d;
}

.badge--status-cancelled {
    background: rgba(248, 113, 113, 0.2);
    color: #b91c1c;
}

.badge--payment-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #b45309;
}

.badge--payment-paid {
    background: rgba(74, 222, 128, 0.2);
    color: #15803d;
}

.badge--payment-cancelled {
    background: rgba(248, 113, 113, 0.2);
    color: #b91c1c;
}

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

.filters__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.definition-list {
    display: grid;
    gap: 12px;
}

.definition-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.definition-list dt {
    font-weight: 600;
    color: #475569;
}

.definition-list__highlight {
    font-size: 1.2rem;
    font-weight: 700;
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-weight: 600;
}

.order-summary__total {
    font-size: 1.25rem;
}

.section-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination__link {
    min-width: 34px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(100, 116, 139, 0.2);
    text-align: center;
    font-weight: 500;
}

.pagination__link.is-active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.pagination__link.is-disabled {
    color: #94a3b8;
    pointer-events: none;
}

.login-page {
    background: linear-gradient(135deg, #1d4ed8 0%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: min(400px, 90vw);
    background: #ffffff;
    padding: 32px;
    border-radius: 18px;
    box-shadow: 0 25px 50px -20px rgba(30, 64, 175, 0.45);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-card__header {
    display: flex;
    gap: 12px;
    align-items: center;
}

.login-card__logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #1d4ed8;
    color: #ffffff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 20px;
}

.login-card h1 {
    margin: 0;
}

.login-card__footer {
    margin: 0;
    color: #64748b;
    text-align: center;
}

.list__item,
.card,
.button--primary {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.list__item:hover,
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -20px rgba(30, 41, 59, 0.45);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: inherit;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.mobile-menu-toggle:hover {
    background-color: rgba(148, 163, 184, 0.1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.is-active {
    display: block;
    opacity: 1;
}

/* Tabs */
.tabs {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tabs__header {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 24px;
}

.tabs__button {
    padding: 12px 24px;
    border: none;
    background: none;
    color: #64748b;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.tabs__button:hover {
    color: #2563eb;
}

.tabs__button.is-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.tabs__content {
    position: relative;
}

.tabs__panel {
    display: none;
}

.tabs__panel.is-active {
    display: block;
}

@media (max-width: 960px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .topbar {
        justify-content: space-between;
    }
}

/* Dark theme */
.theme-dark {
    background-color: #0f172a;
    color: #e2e8f0;
}

.theme-dark .topbar {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.15);
}

.theme-dark .card {
    background: rgba(30, 41, 59, 0.9);
    box-shadow: 0 20px 40px -25px rgba(15, 23, 42, 0.9);
}

.theme-dark .card__label,
.theme-dark .page-subtitle {
    color: #94a3b8;
}

.theme-dark .table thead {
    background-color: rgba(148, 163, 184, 0.08);
}

.theme-dark .table th,
.theme-dark .table td {
    border-bottom-color: rgba(148, 163, 184, 0.12);
}

.theme-dark .button--ghost {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.35);
}

.theme-dark .form__group input,
.theme-dark .form__group select,
.theme-dark .form__group textarea {
    background-color: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.3);
}

.theme-dark .tabs__header {
    border-bottom-color: rgba(148, 163, 184, 0.15);
}

.theme-dark .tabs__button {
    color: #94a3b8;
}

.theme-dark .tabs__button:hover {
    color: #60a5fa;
}

.theme-dark .tabs__button.is-active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

.theme-dark .filters__group label,
.theme-dark label {
    color: #cbd5f5;
}

.theme-dark .pagination__link {
    border-color: rgba(148, 163, 184, 0.25);
}

.theme-dark .pagination__link.is-disabled {
    color: rgba(148, 163, 184, 0.5);
}

.theme-dark .alert--success {
    background-color: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

.theme-dark .alert--error {
    background-color: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
}

footer {
    text-align: right;
    padding: 10px 20px 10px 10px;
    color: #666;
    font-size: 12px;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

footer a {
    color: #0b3fa5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

footer a:hover {
    color: #0a2d7a;
    text-decoration: underline;
}

.theme-dark footer {
    color: #9ca3af;
    border-top-color: #374151;
}

.theme-dark footer a {
    color: #60a5fa;
}

.theme-dark footer a:hover {
    color: #93c5fd;
}

/* Choices.js Custom Styles */
.choices {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.choices__inner {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #cbd5f5;
    border-radius: 10px;
    padding: 10px 12px;
    min-height: auto;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.choices__inner:hover {
    border-color: #2563eb;
}

.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.choices__input {
    background-color: transparent;
    font-size: 0.95rem;
    padding: 0;
    margin: 0;
}

.choices__input--cloned {
    padding: 0;
}

.choices__list--single {
    padding: 0;
}

.choices__list--single .choices__item {
    padding: 0;
}

.choices__list--dropdown {
    border: 1px solid #cbd5f5;
    border-radius: 10px;
    margin-top: 4px;
    box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.2);
    background-color: #ffffff;
    z-index: 1000;
}

.choices__list--dropdown .choices__item {
    padding: 10px 12px;
    font-size: 0.95rem;
    color: #000000;
    background-color: #ffffff;
}

.choices__list--dropdown .choices__item--selectable {
    color: #000000;
}

.choices__list--dropdown .choices__item--selectable:hover {
    background-color: #9ca3af !important;
    color: #000000 !important;
    font-weight: 600 !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.choices__placeholder {
    opacity: 0.6;
}

.choices[data-type*="select-one"] .choices__inner {
    padding-right: 40px;
}

.choices[data-type*="select-one"]::after {
    border-color: #2563eb transparent transparent;
    border-width: 5px 5px 0;
    right: 12px;
    margin-top: -2.5px;
    transition: transform 0.2s ease;
}

.choices[data-type*="select-one"].is-open::after {
    margin-top: -7.5px;
    transform: rotate(180deg);
}

/* Dark mode styles for Choices.js */
.theme-dark .choices__inner {
    background-color: rgba(31, 41, 55, 0.9);
    border-color: #374151;
    color: #f3f4f6;
}

.theme-dark .choices__input {
    background-color: transparent;
    color: #f3f4f6;
}

.theme-dark .choices__list--dropdown {
    background-color: #1f2937;
    border-color: #374151;
}

.theme-dark .choices__list--dropdown .choices__item {
    color: #ffffff;
    background-color: #1f2937;
}

.theme-dark .choices__list--dropdown .choices__item--selectable {
    color: #ffffff;
}

.theme-dark .choices__list--dropdown .choices__item--selectable:hover {
    background-color: #9ca3af !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.theme-dark .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.theme-dark .choices__placeholder {
    color: #9ca3af;
}

.theme-dark .choices[data-type*="select-one"]::after {
    border-color: #60a5fa transparent transparent;
}

/* Choices.js in tables and forms */
.table .choices,
.form .choices {
    width: 100%;
}

.table .choices__inner {
    font-size: 0.9rem;
    padding: 8px 10px;
}

/* Order product selects - smaller and inline */
.order-item-row .choices {
    width: 100%;
}

.order-item-row .choices .choices__inner {
    font-size: 0.875rem;
    padding: 8px 10px;
    min-height: auto;
}

.order-item-row .choices .choices__list--dropdown {
    font-size: 0.875rem;
}

.order-item-row .choices .choices__list--dropdown .choices__item {
    padding: 8px 10px;
}

