@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css');

:root {
    --primary: #8c5a35;
    --primary-dark: #6f4e37;
    --primary-light: #dcb8a3;
    --bg-main: #fcfaf8;
    --bg-sidebar: #3a2b24;
    --surface: #ffffff;
    --text-main: #2b1f1aba;
    --text-dark: #1b120c;
    --text-light: #8d7e76;
    --success: #2ea043;
    --success-bg: #e6f6eb;
    --danger: #cf222e;
    --warning: #d29922;
    --radius: 12px;
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 30px rgba(140, 90, 53, 0.08);
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 100;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header i {
    font-size: 2rem;
    color: var(--primary-light);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.2rem;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    border-left: 4px solid var(--primary-light);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.topbar {
    background: var(--surface);
    padding: 1.5rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.content-wrapper {
    padding: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Dashboard Widgets */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.widget-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(0,0,0,0.03);
    transition: var(--transition);
}

.widget-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.widget-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(140, 90, 53, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.widget-icon.success {
    background: var(--success-bg);
    color: var(--success);
}

.widget-info h4 {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.widget-info .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--primary);
}

.card.concluido::before { background: var(--success); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.card-body {
    margin-bottom: 1.5rem;
}

.pedido-texto {
    background: var(--bg-main);
    padding: 1rem;
    border-radius: 8px;
    font-style: italic;
    color: var(--text-main);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    border: 1px dashed rgba(140, 90, 53, 0.3);
}

.items-list {
    background: var(--success-bg);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(46, 160, 67, 0.2);
}

.items-list h5 {
    color: var(--success);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.items-list ul {
    list-style: none;
    color: #1a5c27;
    font-size: 0.9rem;
}

.items-list ul li {
    margin-bottom: 0.25rem;
    padding-left: 12px;
    position: relative;
}

.items-list ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--success);
}

.card-total {
    text-align: right;
    font-weight: 700;
    color: var(--success);
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 1rem;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(140, 90, 53, 0.1);
    color: var(--primary);
}

.status-badge.concluido {
    background: var(--success-bg);
    color: var(--success);
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

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

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

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    color: rgba(140, 90, 53, 0.2);
    margin-bottom: 1rem;
    display: block;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

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

.modal-card {
    background: var(--surface);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(140, 90, 53, 0.1);
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--surface);
    color: var(--text-dark);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    transform: translateX(120%);
    animation: slideIn 0.3s forwards;
    border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.success i { color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.error i { color: var(--danger); }

@keyframes slideIn {
    to { transform: translateX(0); }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}

/* Utilities */
.hidden { display: none !important; }

/* QR Overlay Override */
.qr-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}
.qr-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
}
.qr-card h2 { color: var(--primary-dark); margin-top: 0; font-size: 1.5rem; }
.qr-card p { color: #555; margin-bottom: 20px; line-height: 1.5; }
#qr-canvas { margin: 0 auto; display: block; }
#qr-loader { border: 4px solid #f3f3f3; border-top: 4px solid var(--primary); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 30px auto; }
