:root {
    --primary-color: #CD7F32;
    --primary-dark: #A0522D;
    --primary-light: #DEB887;
    --primary-gradient: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --bg-light: #f8f9fa;
    --bg-dark: #2c3e50;
    --border-color: #e9ecef;
    --sidebar-width: 260px;
    --header-height: 60px;
}

* {
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-light);
    min-height: 100vh;
    margin: 0;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-dark);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.admin-sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    height: 40px;
    width: auto;
}

.sidebar-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-light);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.nav-item.active {
    background: rgba(205, 127, 50, 0.15);
    color: var(--primary-light);
    border-left-color: var(--primary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger-color);
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 1rem 0;
}

.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    max-width: 100%;
}

.admin-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    display: none;
}

.admin-user {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-content {
    flex: 1;
    padding: 1.5rem;
    overflow-x: hidden;
    width: 100%;
}

.admin-content > .row {
    margin-left: 0;
    margin-right: 0;
}

.admin-content > .row > [class*="col-"] {
    padding-left: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-primary .stat-icon {
    background: rgba(205, 127, 50, 0.15);
    color: var(--primary-color);
}

.stat-success .stat-icon {
    background: rgba(40, 167, 69, 0.15);
    color: var(--success-color);
}

.stat-warning .stat-icon {
    background: rgba(255, 193, 7, 0.15);
    color: #c79100;
}

.stat-info .stat-icon {
    background: rgba(23, 162, 184, 0.15);
    color: var(--info-color);
}

.stat-info-text {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.admin-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.admin-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.admin-card .card-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-card .card-body {
    padding: 1.25rem;
}

.admin-table {
    margin-bottom: 0;
}

.admin-table thead th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: none;
    padding: 0.875rem 1rem;
}

.admin-table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-color: var(--border-color);
}

.admin-table tbody tr:hover {
    background: rgba(0,0,0,0.02);
}

.admin-table .btn-group .btn {
    padding: 0.35rem 0.5rem;
}

.pedido-row.highlight-pendente {
    background: rgba(255, 193, 7, 0.05);
}

.status-badge {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.pendente {
    background: rgba(255, 193, 7, 0.15);
    color: #c79100;
}

.status-badge.em-preparo {
    background: rgba(0, 123, 255, 0.15);
    color: #0056b3;
}

.status-badge.pronto {
    background: rgba(40, 167, 69, 0.15);
    color: #1e7e34;
}

.status-badge.entregue {
    background: rgba(108, 117, 125, 0.15);
    color: #545b62;
}

.status-badge.cancelado {
    background: rgba(220, 53, 69, 0.15);
    color: #bd2130;
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-indicator.pendente {
    background: #ffc107;
}

.status-indicator.em-preparo {
    background: #007bff;
}

.status-indicator.pronto {
    background: #28a745;
}

.status-indicator.entregue {
    background: #6c757d;
}

.status-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.status-count {
    font-weight: 600;
    color: var(--text-primary);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
}

.quick-action-btn.warning:hover {
    background: var(--warning-color);
    color: var(--text-primary);
}

.quick-action-btn i {
    font-size: 1.25rem;
}

.quick-action-btn span {
    font-size: 0.8rem;
    font-weight: 500;
}

.status-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.status-tab:hover {
    border-color: var(--primary-color);
}

.status-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.status-tab .count {
    background: rgba(0,0,0,0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.status-tab.active .count {
    background: rgba(255,255,255,0.2);
}

.item-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.item-thumb-placeholder {
    width: 50px;
    height: 50px;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
}

.admin-toast {
    min-width: 280px;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    color: white;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.admin-toast.success {
    background: var(--success-color);
}

.admin-toast.error {
    background: var(--danger-color);
}

.admin-toast.warning {
    background: var(--warning-color);
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(205, 127, 50, 0.15);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.modal-content {
    border: none;
    border-radius: 12px;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

.nav-tabs {
    border-bottom: 1px solid var(--border-color);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

@media (max-width: 768px) {
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .nav-tabs .nav-item {
        flex-shrink: 0;
    }
    
    .nav-tabs .nav-link {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

@media (max-width: 1200px) {
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .row > [class*="col-lg"] {
        margin-bottom: 1rem;
    }
    
    .admin-main {
        margin-left: 0;
        width: 100%;
        max-width: 100vw;
    }
}

@media (max-width: 768px) {
    .admin-content {
        padding: 1rem;
        overflow-x: hidden;
    }
    
    .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .admin-header {
        padding: 0 1rem;
    }
    
    .header-left h1 {
        font-size: 1rem;
    }
    
    .stat-card {
        padding: 0.875rem;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .status-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .status-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .status-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .admin-table {
        font-size: 0.8rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .admin-content {
        padding: 0.75rem;
    }
    
    .admin-header {
        padding: 0 0.75rem;
    }
    
    .header-left h1 {
        font-size: 0.9rem;
    }
    
    .stat-card {
        padding: 0.75rem;
        border-radius: 8px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .table-responsive {
        margin: 0;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-table {
        font-size: 0.75rem;
        min-width: 500px;
    }
    
    .hide-mobile {
        display: none !important;
    }
    
    .card {
        border-radius: 8px;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    .btn-group-sm {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-group-sm .btn {
        width: 100%;
    }
    
    .row-cols-2 > * {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .row-cols-4 > * {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (hover: none) and (pointer: coarse) {
    .nav-item,
    .btn,
    .status-tab {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

@media (max-width: 576px) {
    .admin-sidebar {
        width: 280px;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .sidebar-logo {
        height: 35px;
    }
    
    .sidebar-title {
        font-size: 1rem;
    }
    
    .nav-item {
        padding: 1rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .admin-header {
        height: 56px;
        padding: 0 12px;
    }
    
    .header-left h1 {
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
    
    .sidebar-toggle {
        font-size: 1.1rem;
        padding: 8px;
        margin-right: 8px;
    }
    
    .admin-user {
        font-size: 0;
    }
    
    .admin-user i {
        font-size: 1.2rem;
    }
    
    .admin-content {
        padding: 12px;
        overflow-x: hidden;
    }
    
    .admin-content > .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .row.g-4,
    .row.g-3 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
        margin: 0;
    }
    
    .col-6,
    .col-lg-3.col-md-6,
    [class*="col-"] {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    
    .stat-card {
        padding: 12px;
        border-radius: 10px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
        margin: 0 auto;
    }
    
    .stat-info {
        text-align: center;
    }
    
    .stat-value {
        font-size: 1.2rem;
        display: block;
    }
    
    .stat-label {
        font-size: 0.65rem;
        line-height: 1.2;
    }
    
    .admin-card,
    .card {
        border-radius: 12px;
        margin-bottom: 12px;
    }
    
    .card-header {
        padding: 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .card-header h5 {
        font-size: 0.9rem;
        flex: 1;
    }
    
    .card-header .btn {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .card-body.p-0 {
        padding: 0 !important;
    }
    
    .table-responsive {
        margin: 0;
        border-radius: 0 0 12px 12px;
        overflow-x: auto;
    }
    
    .admin-table {
        font-size: 0.75rem;
        margin-bottom: 0;
    }
    
    .admin-table th {
        font-size: 0.7rem;
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    .admin-table td {
        padding: 10px 8px;
        vertical-align: middle;
    }
    
    .admin-table .btn-group-sm {
        flex-direction: row;
        gap: 4px;
    }
    
    .admin-table .btn-group-sm .btn {
        padding: 6px 8px;
        font-size: 0.7rem;
        width: auto;
    }
    
    .status-badge {
        font-size: 0.65rem;
        padding: 4px 8px;
    }
    
    .status-tabs {
        gap: 6px;
        padding: 0 0 8px 0;
        margin: 0 -12px;
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .status-tab {
        padding: 8px 12px;
        font-size: 0.75rem;
        border-radius: 20px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .action-btn {
        padding: 12px;
        font-size: 0.8rem;
    }
    
    .action-btn i {
        font-size: 1.2rem;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .page-link {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    #paginationInfo {
        font-size: 0.75rem;
        text-align: center;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .d-flex.justify-content-between.align-items-center.mt-4 {
        flex-direction: column;
        gap: 12px;
    }
    
    .modal-dialog {
        margin: 8px;
        max-width: calc(100% - 16px);
    }
    
    .modal-dialog-lg {
        max-width: calc(100% - 16px);
    }
    
    .modal-content {
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 12px 16px;
    }
    
    .modal-title {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 16px;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .modal-footer .btn {
        flex: 1;
        min-width: 100px;
    }
    
    .form-control,
    .form-select {
        font-size: 16px;
        padding: 10px 12px;
    }
    
    .form-label {
        font-size: 0.85rem;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 10px 16px;
    }
    
    .btn-sm {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
    
    .row.mb-3 {
        margin-bottom: 12px !important;
    }
    
    .col-6 {
        padding-left: 6px;
        padding-right: 6px;
    }
}

@media (max-width: 400px) {
    .col-lg-3.col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.6rem;
    }
    
    .header-left h1 {
        max-width: 120px;
        font-size: 0.8rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px 6px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .admin-sidebar {
        overflow-y: auto;
    }
    
    .modal-body {
        max-height: 50vh;
    }
}
