/* ============================================
   Sistema de Gestão - Cintas de Elevação
   Design System & Global Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Variables ---- */
:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-card: #1e2538;
    --bg-card-hover: #252d42;
    --bg-input: #151b28;
    --bg-modal: rgba(0, 0, 0, 0.7);

    --accent-primary: #f59e0b;
    --accent-primary-hover: #d97706;
    --accent-primary-glow: rgba(245, 158, 11, 0.15);
    --accent-secondary: #3b82f6;
    --accent-secondary-hover: #2563eb;
    --accent-secondary-glow: rgba(59, 130, 246, 0.15);

    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.12);
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.12);
    --color-danger: #ef4444;
    --color-danger-bg: rgba(239, 68, 68, 0.12);
    --color-info: #3b82f6;
    --color-info-bg: rgba(59, 130, 246, 0.12);
    --color-purple: #8b5cf6;
    --color-purple-bg: rgba(139, 92, 246, 0.12);

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f1419;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);

    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 0px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(245, 158, 11, 0.1);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, var(--accent-primary-glow) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 50%, var(--accent-secondary-glow) 0%, transparent 50%);
    animation: loginBgPulse 8s ease-in-out infinite alternate;
}

@keyframes loginBgPulse {
    0% { transform: scale(1) rotate(0deg); opacity: 0.5; }
    100% { transform: scale(1.1) rotate(5deg); opacity: 0.8; }
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    z-index: 1;
}

.login-card {
    background: rgba(30, 37, 56, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: loginCardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

/* ---- Brand Logo ---- */
.brand-logo {
    object-fit: contain;
    max-width: 100%;
    height: auto;
}

.login-brand-logo {
    max-height: 120px;
    margin: 0 auto 24px;
    display: block;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-logo p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .form-control {
    padding-left: 44px;
}

.input-icon-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-icon-wrapper .form-control:focus + i,
.input-icon-wrapper .form-control:focus ~ i {
    color: var(--accent-primary);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8.825L.35 3.175l.7-.7L6 7.425l4.95-4.95.7.7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    white-space: nowrap;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
    color: var(--text-inverse);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger), #dc2626);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success), #059669);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.btn-outline:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn i {
    font-size: 0.85rem;
}

/* ---- Login Error ---- */
.login-error {
    background: var(--color-danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: none;
    animation: shakeX 0.4s ease;
}

@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.login-error.show {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.sidebar-brand-logo {
    max-height: 48px;
    max-width: 100px;
    flex-shrink: 0;
}

.sidebar-brand-text h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.sidebar-brand-text span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 16px 12px 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--accent-primary-glow);
    color: var(--accent-primary);
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-secondary-hover));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.sidebar-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.sidebar-logout:hover {
    color: var(--color-danger);
    background: var(--color-danger-bg);
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
}

.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    align-items: center;
    justify-content: space-between;
}

.mobile-header .hamburger {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.mobile-header .hamburger:hover {
    background: rgba(255,255,255,0.05);
}

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

.mobile-brand-logo {
    max-height: 36px;
    max-width: 120px;
    flex-shrink: 0;
}

.mobile-header .mobile-brand h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.page-content {
    padding: 32px;
}

/* ---- Page Header ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header-left h1 {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.page-header-left p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.page-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================
   DASHBOARD
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: default;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.stat-card:nth-child(1)::before { background: linear-gradient(90deg, var(--accent-secondary), #60a5fa); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, var(--color-success), #34d399); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, var(--color-warning), #fbbf24); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, var(--color-purple), #a78bfa); }

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-card:nth-child(1) .stat-card-icon { background: var(--color-info-bg); color: var(--accent-secondary); }
.stat-card:nth-child(2) .stat-card-icon { background: var(--color-success-bg); color: var(--color-success); }
.stat-card:nth-child(3) .stat-card-icon { background: var(--color-warning-bg); color: var(--color-warning); }
.stat-card:nth-child(4) .stat-card-icon { background: var(--color-purple-bg); color: var(--color-purple); }

.stat-card-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -1px;
}

.stat-card-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ---- Charts Grid ---- */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.chart-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-wrapper {
    position: relative;
    height: 260px;
}

/* ---- Recent Activity ---- */
.activity-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.activity-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* ============================================
   DATA TABLE
   ============================================ */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    flex-wrap: wrap;
}

.table-search {
    position: relative;
    flex: 1;
    max-width: 360px;
}

.table-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: all var(--transition-fast);
}

.table-search input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.table-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.table-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--text-inverse);
    font-weight: 600;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 20px;
    font-size: 0.88rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.data-table .text-muted {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.data-table .actions {
    display: flex;
    gap: 6px;
}

/* ---- Status Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-pendente {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-em_producao {
    background: var(--color-info-bg);
    color: var(--accent-secondary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-separado {
    background: var(--color-purple-bg);
    color: var(--color-purple);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-entregue {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

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

.badge-saida {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.badge-stock-ok {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-stock-low {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge-stock-empty {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-modal);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-wide {
    max-width: 720px;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--color-danger);
    background: var(--color-danger-bg);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ---- Form Row ---- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ---- Order Items in Modal ---- */
.order-items-list {
    margin-top: 12px;
}

.order-item-row {
    display: grid;
    grid-template-columns: 1fr 100px 40px;
    gap: 10px;
    align-items: end;
    margin-bottom: 10px;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.order-item-row .remove-item-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: var(--color-danger);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.order-item-row .remove-item-btn:hover {
    background: var(--color-danger);
    color: white;
}

.add-item-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px;
    background: none;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--accent-secondary);
    cursor: pointer;
    width: 100%;
    justify-content: center;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 8px;
    transition: all var(--transition-fast);
}

.add-item-btn:hover {
    border-color: var(--accent-secondary);
    background: var(--accent-secondary-glow);
}

/* ---- Order Detail ---- */
.order-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.order-detail-item {
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.order-detail-item label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.order-detail-item span {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ---- Status Pipeline ---- */
.status-pipeline {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 16px 0;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.pipeline-step {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
    transition: all var(--transition-normal);
    position: relative;
}

.pipeline-step.active {
    color: var(--accent-primary);
    background: var(--accent-primary-glow);
}

.pipeline-step.completed {
    color: var(--color-success);
    background: var(--color-success-bg);
}

.pipeline-arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* ============================================
   CONFIRM DIALOG
   ============================================ */
.confirm-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-modal);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirm-overlay.show {
    display: flex;
}

.confirm-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-icon {
    width: 56px;
    height: 56px;
    background: var(--color-danger-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
    color: var(--color-danger);
}

.confirm-dialog h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.confirm-dialog p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 420px;
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--color-success); }
.toast-error .toast-icon { color: var(--color-danger); }
.toast-warning .toast-icon { color: var(--color-warning); }
.toast-info .toast-icon { color: var(--accent-secondary); }

.toast-success { border-left: 3px solid var(--color-success); }
.toast-error { border-left: 3px solid var(--color-danger); }
.toast-warning { border-left: 3px solid var(--color-warning); }
.toast-info { border-left: 3px solid var(--accent-secondary); }

.toast-content {
    flex: 1;
}

.toast-content strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.toast-content span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.85rem;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.88rem;
}

/* ============================================
   ESTOQUE PAGE SPECIFIC
   ============================================ */
.estoque-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.estoque-action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.estoque-action-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.estoque-action-card h3 .icon-entrada {
    color: var(--color-success);
}

.estoque-action-card h3 .icon-saida {
    color: var(--color-danger);
}

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

/* ============================================
   SECTION VISIBILITY
   ============================================ */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
    animation: pageIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-overlay.show {
        display: block;
    }

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .page-content {
        padding: 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card-value {
        font-size: 1.5rem;
    }

    .estoque-actions-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .table-search {
        max-width: 100%;
    }

    .table-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .data-table th,
    .data-table td {
        padding: 12px 14px;
        font-size: 0.82rem;
    }

    .modal {
        margin: 10px;
        max-height: 95vh;
    }

    .order-item-row {
        grid-template-columns: 1fr;
    }

    .order-detail-grid {
        grid-template-columns: 1fr;
    }

    .status-pipeline {
        flex-direction: column;
        gap: 8px;
    }

    .pipeline-arrow {
        transform: rotate(90deg);
    }

    .toast-container {
        top: auto;
        bottom: 20px;
        left: 16px;
        right: 16px;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }

    .login-card {
        padding: 32px 24px;
    }

    .confirm-actions {
        flex-direction: column;
    }

    .confirm-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-header-left h1 {
        font-size: 1.3rem;
    }
}

/* ============================================
   TOP BAR (Desktop)
   ============================================ */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 32px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---- Alerts Bell ---- */
.alerts-area {
    position: relative;
}

.alerts-bell {
    position: relative;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: all var(--transition-fast);
}

.alerts-bell:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.alerts-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, var(--color-danger), #dc2626);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: badgePulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ---- Alerts Dropdown ---- */
.alerts-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: rgba(30, 37, 56, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 200;
    animation: dropdownIn 0.2s ease;
}

.alerts-dropdown.show {
    display: block;
}

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

.alerts-dropdown-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: var(--color-warning-bg);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-warning);
}

.alerts-dropdown-list {
    max-height: 320px;
    overflow-y: auto;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

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

.alert-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.alert-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.alert-item-low .alert-item-icon {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.alert-item-urgent .alert-item-icon {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.alert-item-critical .alert-item-icon {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.alert-item-info {
    flex: 1;
    min-width: 0;
}

.alert-item-info strong {
    display: block;
    font-size: 0.82rem;
    color: var(--accent-primary);
}

.alert-item-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.alert-item-stock {
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.alert-item-low .alert-item-stock { color: var(--color-warning); }
.alert-item-urgent .alert-item-stock { color: #f97316; }
.alert-item-critical .alert-item-stock { color: var(--color-danger); }

.alerts-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
}

.alerts-empty i {
    font-size: 2rem;
    color: var(--color-success);
    margin-bottom: 10px;
}

.alerts-empty p {
    font-size: 0.85rem;
}

/* ---- User Tag ---- */
.user-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--accent-secondary-glow);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-secondary);
    white-space: nowrap;
}

/* ============================================
   LIVE FEED PANEL (Bottom Right)
   ============================================ */
.live-feed-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background: rgba(30, 37, 56, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 90;
    overflow: hidden;
    animation: feedSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all var(--transition-normal);
}

.live-feed-panel.collapsed .live-feed-body {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}

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

.live-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
}

.live-feed-header:hover {
    background: rgba(0, 0, 0, 0.3);
}

.live-feed-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    animation: livePulse 2s ease-in-out infinite;
    box-shadow: 0 0 6px var(--color-success);
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.live-feed-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.live-feed-toggle:hover {
    color: var(--text-primary);
}

.live-feed-body {
    max-height: 200px;
    overflow-y: auto;
    transition: max-height var(--transition-normal), padding var(--transition-normal);
}

/* Custom scrollbar for live feed */
.live-feed-body::-webkit-scrollbar {
    width: 4px;
}

.live-feed-body::-webkit-scrollbar-track {
    background: transparent;
}

.live-feed-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.live-feed-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.feed-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
    animation: feedItemIn 0.3s ease;
}

@keyframes feedItemIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

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

.feed-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.feed-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.feed-entrada .feed-item-icon {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.feed-saida .feed-item-icon {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.feed-pedido .feed-item-icon {
    background: var(--color-info-bg);
    color: var(--accent-secondary);
}

.feed-status .feed-item-icon {
    background: var(--color-purple-bg);
    color: var(--color-purple);
}

.feed-item-content {
    flex: 1;
    min-width: 0;
}

.feed-item-content strong {
    font-size: 0.78rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 1px;
}

.feed-item-content span {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
    line-height: 1.3;
}

.feed-item-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 2px;
    white-space: nowrap;
}

.feed-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
}

.feed-empty i {
    font-size: 1.5rem;
    opacity: 0.3;
    margin-bottom: 8px;
}

.feed-empty p {
    font-size: 0.8rem;
}

/* ---- Mobile Header Actions ---- */
.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---- Responsive Adjustments ---- */
@media (max-width: 768px) {
    .top-bar {
        display: none;
    }

    .live-feed-panel {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
    }

    .alerts-dropdown {
        width: 300px;
        right: -10px;
    }
}
