/* =============================================
   Sistema Marisol - Design System
   Clean, Modern, Pastel Colors
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

/* =============================================
   CSS Variables
   ============================================= */
:root {
    /* Primary Pastel Palette */
    --primary: #9B8AB8;
    --primary-light: #C4B5D9;
    --primary-lighter: #E8E0F0;
    --primary-dark: #7B6A98;

    /* Secondary */
    --secondary: #E8B4B8;
    --secondary-light: #F2D7D5;
    --secondary-lighter: #FBF0EF;

    /* Accent */
    --accent: #8CC5D6;
    --accent-light: #A8D8EA;
    --accent-lighter: #D4ECF4;

    /* Mint/Green accents */
    --mint: #A8D5BA;
    --mint-light: #C8E6D4;

    /* Warm accents */
    --warm: #E8C89E;
    --warm-light: #F5E0C3;

    /* Backgrounds */
    --bg-primary: #FAFAFA;
    --bg-secondary: #F5F0F6;
    --bg-card: #FFFFFF;
    --bg-overlay: rgba(155, 138, 184, 0.08);

    /* Sidebar */
    --sidebar-bg: #2D2B3D;
    --sidebar-hover: #3D3A50;
    --sidebar-active: #4D4A63;
    --sidebar-text: #B8B5C8;
    --sidebar-text-active: #FFFFFF;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;

    /* Text */
    --text-primary: #2D2B3D;
    --text-secondary: #6B6880;
    --text-muted: #9B98AD;
    --text-light: #C4C1D4;

    /* Status Colors */
    --success: #6DBE8B;
    --success-bg: #E8F5ED;
    --warning: #E8BC6A;
    --warning-bg: #FEF7E8;
    --danger: #E87E7E;
    --danger-bg: #FDECEC;
    --info: #7EB8E8;
    --info-bg: #E8F2FD;

    /* Borders & Shadows */
    --border: #E8E5F0;
    --border-light: #F0EDF5;
    --shadow-sm: 0 1px 3px rgba(45, 43, 61, 0.06);
    --shadow-md: 0 4px 12px rgba(45, 43, 61, 0.08);
    --shadow-lg: 0 8px 30px rgba(45, 43, 61, 0.12);
    --shadow-xl: 0 16px 48px rgba(45, 43, 61, 0.16);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 50%;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
}

/* =============================================
   Reset & Base
   ============================================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* =============================================
   Login Page
   ============================================= */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-lighter) 0%, var(--secondary-lighter) 50%, var(--accent-lighter) 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    top: -150px;
    right: -100px;
    opacity: 0.4;
    animation: float 8s ease-in-out infinite;
}

.login-container::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--secondary-light) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    opacity: 0.4;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

.login-header-logo {
    margin-bottom: 24px;
    z-index: 2;
    animation: slideDown 0.6s ease-out;
}

.login-header-img {
    width: 140px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header-text {
    text-align: center;
    margin-bottom: 28px;
}

.login-header-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-header-text p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.login-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: all var(--transition-normal);
    outline: none;
}

.login-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(155, 138, 184, 0.15);
}

.login-form .form-control::placeholder {
    color: var(--text-light);
}

.login-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(155, 138, 184, 0.35);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn.loading {
    pointer-events: none;
    opacity: 0.85;
}

.login-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.login-error {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: none;
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* =============================================
   Main Layout
   ============================================= */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-slow);
    overflow: hidden;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
}

.sidebar-brand h2 {
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.sidebar-brand span {
    color: var(--sidebar-text);
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--sidebar-hover);
    border-radius: 3px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    color: var(--sidebar-text);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 0 12px 8px;
    opacity: 0.6;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    position: relative;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(155, 138, 184, 0.3);
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item .nav-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}

.nav-item .nav-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sidebar-user:hover {
    background: var(--sidebar-hover);
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
}

.sidebar-user-info .name {
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
}

.sidebar-user-info .role {
    color: var(--sidebar-text);
    font-size: 0.7rem;
}

.btn-logout {
    margin-left: auto;
    color: var(--sidebar-text);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    background: none;
    border: none;
}

.btn-logout:hover {
    color: var(--danger);
    background: rgba(232, 126, 126, 0.1);
}

.btn-logout svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
}

/* Top Header */
.top-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.page-title-area {
    display: flex;
    flex-direction: column;
}

.page-title-area .breadcrumb {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.page-title-area h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.top-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Content Area */
.content-area {
    padding: 28px 32px;
}

/* =============================================
   Cards
   ============================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 22px;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.stat-card.purple::before {
    background: var(--primary);
}

.stat-card.pink::before {
    background: var(--secondary);
}

.stat-card.blue::before {
    background: var(--accent);
}

.stat-card.green::before {
    background: var(--mint);
}

.stat-card.warning::before {
    background: var(--warning);
}

.stat-card.danger::before {
    background: var(--danger);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.stat-card-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}

.stat-card.purple .stat-card-icon {
    background: var(--primary-lighter);
    color: var(--primary);
}

.stat-card.pink .stat-card-icon {
    background: var(--secondary-lighter);
    color: var(--secondary);
}

.stat-card.blue .stat-card-icon {
    background: var(--accent-lighter);
    color: var(--accent);
}

.stat-card.green .stat-card-icon {
    background: rgba(168, 213, 186, 0.2);
    color: var(--mint);
}

.stat-card.warning .stat-card-icon {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-card.danger .stat-card-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-card-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* =============================================
   Buttons
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(155, 138, 184, 0.35);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    border-color: var(--primary-light);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #5AAF79 100%);
    color: white;
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 8px;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* =============================================
   Tables
   ============================================= */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table td {
    padding: 12px 16px;
    font-size: 0.88rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

table tr {
    transition: background var(--transition-fast);
}

table tbody tr:hover {
    background: var(--bg-overlay);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* =============================================
   Forms
   ============================================= */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: all var(--transition-normal);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(155, 138, 184, 0.12);
}

.form-control::placeholder {
    color: var(--text-light);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239B98AD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* =============================================
   Modal
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45, 43, 61, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    transition: transform var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 22px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-muted);
}

.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.modal-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* =============================================
   Badges & Tags
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-primary {
    background: var(--primary-lighter);
    color: var(--primary);
}

.badge-secondary {
    background: var(--secondary-lighter);
    color: var(--secondary);
}

/* =============================================
   Filters Bar
   ============================================= */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    padding: 18px 22px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.filters-bar .form-group {
    margin-bottom: 0;
    min-width: 160px;
    flex: 1;
}

.filters-bar .form-group label {
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.filters-bar .form-control {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.filters-bar .btn {
    height: 38px;
}

/* =============================================
   Tabs
   ============================================= */
.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    width: fit-content;
}

.tab {
    padding: 8px 20px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* =============================================
   Pagination
   ============================================= */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 12px;
}

.pagination-info {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    gap: 4px;
}

.pagination-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.pagination-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* =============================================
   Empty State
   ============================================= */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    stroke: var(--border);
    stroke-width: 1.2;
    fill: none;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.88rem;
}

/* =============================================
   Alerts & Notifications
   ============================================= */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.4s ease;
    background: var(--bg-card);
    border-left: 4px solid;
    min-width: 280px;
}

.toast.toast-success {
    border-color: var(--success);
}

.toast.toast-error {
    border-color: var(--danger);
}

.toast.toast-warning {
    border-color: var(--warning);
}

.toast.toast-info {
    border-color: var(--info);
}

.toast svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
}

/* =============================================
   Chart Container
   ============================================= */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* =============================================
   Dashboard Layout
   ============================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.dashboard-grid .card.full-width {
    grid-column: 1 / -1;
}

/* =============================================
   Low Stock Alert List
   ============================================= */
.alert-list {
    list-style: none;
}

.alert-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.alert-list-item:last-child {
    border-bottom: none;
}

.alert-list-item .item-info {
    display: flex;
    flex-direction: column;
}

.alert-list-item .item-name {
    font-weight: 500;
    font-size: 0.88rem;
}

.alert-list-item .item-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.stock-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.stock-indicator.critical {
    color: var(--danger);
}

.stock-indicator.low {
    color: var(--warning);
}

/* =============================================
   Search Bar
   ============================================= */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 38px;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: var(--text-light);
    stroke-width: 2;
    fill: none;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar .nav-label,
    .sidebar .nav-section-title,
    .sidebar-brand,
    .sidebar-user-info,
    .btn-logout,
    .nav-badge {
        display: none;
    }

    .sidebar-header {
        justify-content: center;
        padding: 24px 12px;
    }

    .sidebar-user {
        justify-content: center;
    }

    .main-content {
        margin-left: var(--sidebar-collapsed);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar .nav-label,
    .sidebar .nav-section-title,
    .sidebar-brand,
    .sidebar-user-info,
    .btn-logout,
    .nav-badge {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 20px 16px;
    }

    .top-header {
        padding: 12px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filters-bar {
        flex-direction: column;
    }

    .filters-bar .form-group {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal {
        margin: 16px;
        max-height: calc(100vh - 32px);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        margin: 16px;
        padding: 32px 24px;
    }
}

/* =============================================
   Mobile Menu Toggle
   ============================================= */
.mobile-menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.mobile-menu-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

/* Mobile overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* =============================================
   Utility Classes
   ============================================= */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.text-muted {
    color: var(--text-muted);
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.gap-1 {
    gap: 8px;
}

.gap-2 {
    gap: 16px;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.w-full {
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 40px auto;
}

/* Confirm dialog */
.confirm-dialog {
    text-align: center;
    padding: 20px 0;
}

.confirm-dialog .confirm-icon {
    width: 56px;
    height: 56px;
    background: var(--warning-bg);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.confirm-dialog .confirm-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--warning);
    stroke-width: 2;
    fill: none;
}

.confirm-dialog h3 {
    margin-bottom: 8px;
}

.confirm-dialog p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =============================================
   PDV Fullscreen Mode
   ============================================= */

/* Fullscreen transition on app container */
.app-container.pdv-fullscreen .sidebar {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.app-container.pdv-fullscreen .sidebar-overlay {
    display: none;
}

.app-container.pdv-fullscreen .main-content {
    margin-left: 0;
    width: 100%;
}

.app-container.pdv-fullscreen .top-header {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.app-container.pdv-fullscreen .content-area {
    padding: 0;
    height: 100vh;
    overflow: hidden;
    max-width: none;
}

/* Transition animations */
.app-container {
    transition: none;
}

.app-container .sidebar {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.app-container .main-content {
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-container .top-header {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, height 0.35s ease, padding 0.35s ease;
}

.app-container .content-area {
    transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.4s ease;
}

/* PDV Top Bar (fullscreen only) */
.pdv-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text-active);
    height: 56px;
    box-sizing: border-box;
    animation: pdvSlideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

.pdv-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pdv-topbar-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.08);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--sidebar-text);
}

.pdv-topbar-back svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.pdv-topbar-back:hover {
    background: rgba(255,255,255,0.15);
    color: var(--sidebar-text-active);
}

.pdv-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdv-topbar-brand .logo {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
}

.pdv-topbar-brand span {
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.pdv-topbar-center {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--sidebar-text);
}

.pdv-topbar-center svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    opacity: 0.6;
}

.pdv-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pdv-topbar-clock {
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--sidebar-text);
    letter-spacing: 0.03em;
}

.pdv-topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--sidebar-text);
}

.pdv-topbar-user .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.72rem;
    color: white;
}

@keyframes pdvSlideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* PDV main body (fullscreen) */
.pdv-fullscreen-body {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
    overflow: hidden;
    background: var(--bg-primary);
}

.pdv-fullscreen-tabs {
    display: flex;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    padding: 0 24px;
    animation: pdvFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
}

.pdv-fullscreen-tabs .tab {
    padding: 12px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.pdv-fullscreen-tabs .tab:hover {
    color: var(--text-primary);
}

.pdv-fullscreen-tabs .tab.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.pdv-fullscreen-content {
    flex: 1;
    overflow: hidden;
    animation: pdvFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

@keyframes pdvFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   PDV Layout (sell mode)
   ============================================= */
.pdv-layout {
    display: grid;
    grid-template-columns: 1fr 440px;
    gap: 0;
    align-items: stretch;
    height: 100%;
}

.pdv-products-panel {
    padding: 20px 24px;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}

.pdv-products-panel .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pdv-products-panel .card-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pdv-cart-panel {
    border-left: 1px solid var(--border-light);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.pdv-cart-panel .card {
    border: none;
    border-radius: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

.pdv-cart-panel .card-header {
    border-radius: 0;
    flex-shrink: 0;
}

.pdv-cart-panel .card-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pdv-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.pdv-search-results {
    max-height: none;
    overflow-y: auto;
    flex: 1;
}

.pdv-product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pdv-product-item:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-light);
    transform: translateX(4px);
}

.pdv-product-item.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.pdv-product-item.out-of-stock:hover {
    transform: none;
    background: var(--danger-bg);
}

.pdv-product-info strong {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 4px;
}

.pdv-product-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.pdv-product-right {
    text-align: right;
    flex-shrink: 0;
}

.pdv-product-price {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.pdv-product-stock {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.pdv-product-stock.low {
    color: var(--warning);
}

.pdv-product-stock.critical {
    color: var(--danger);
    font-weight: 600;
}

.pdv-no-results {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* PDV Cart */
.pdv-cart-items {
    flex: 1;
    overflow-y: auto;
    max-height: none;
}

.pdv-cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    gap: 12px;
}

.pdv-cart-item:last-child {
    border-bottom: none;
}

.pdv-cart-item-info {
    flex: 1;
    min-width: 0;
}

.pdv-cart-item-info strong {
    display: block;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdv-cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdv-qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.pdv-qty-btn {
    width: 28px;
    height: 28px;
    background: var(--bg-secondary);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.pdv-qty-btn:hover {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.pdv-qty-input {
    width: 36px;
    height: 28px;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    -moz-appearance: textfield;
    appearance: textfield;
}

.pdv-qty-input::-webkit-inner-spin-button,
.pdv-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.pdv-cart-item-subtotal {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 80px;
    text-align: right;
}

/* PDV Cart Footer */
.pdv-cart-footer {
    padding: 16px;
    border-top: 2px solid var(--border-light);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.pdv-totals {
    margin-bottom: 4px;
}

.pdv-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.9rem;
}

.pdv-total-row.pdv-total-final {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 4px;
}

/* PDV History inside fullscreen */
.pdv-fullscreen-content .stats-grid {
    padding: 0 24px;
    padding-top: 20px;
}

.pdv-fullscreen-content > .d-flex,
.pdv-fullscreen-content > .card {
    margin-left: 24px;
    margin-right: 24px;
}

/* Responsive PDV */
@media (max-width: 900px) {
    .pdv-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .pdv-products-panel {
        height: auto;
    }
    
    .pdv-cart-panel {
        border-left: none;
        border-top: 1px solid var(--border-light);
        height: auto;
    }

    .pdv-cart-items {
        max-height: 300px;
    }

    .pdv-topbar {
        padding: 8px 12px;
    }

    .pdv-topbar-center {
        display: none;
    }

    .pdv-topbar-brand span {
        display: none;
    }
}

/* Crediário Items Section */
.crediario-items-section {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 16px;
}

.crediario-items-section h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.crediario-item-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 8px;
}

.crediario-item-row .form-group {
    margin-bottom: 0;
}

/* XML Import */
.xml-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--bg-secondary);
}

.xml-dropzone:hover,
.xml-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.xml-dropzone svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-muted);
    stroke-width: 1.5;
    fill: none;
    margin-bottom: 12px;
}

.xml-dropzone p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 8px;
}

.xml-preview-table {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 16px;
}

.xml-preview-table table {
    font-size: 0.82rem;
}

.xml-summary-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.xml-summary-stat {
    flex: 1;
    min-width: 120px;
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    text-align: center;
}

.xml-summary-stat .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.xml-summary-stat .label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    color: #856404;
}

/* Responsive PDV */
@media (max-width: 900px) {
    .pdv-layout {
        grid-template-columns: 1fr;
    }
}