/* -------------------------------------------------------------
   SYSTEM VARIABLES & THEME DEFINITION
   ------------------------------------------------------------- */
:root {
    /* Fonts */
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Base Palette */
    --color-bg-base: #f4f6f9;
    --color-bg-sidebar: #0f172a;
    --color-text-dark: #1e293b;
    --color-text-muted: #64748b;
    --color-border-light: rgba(226, 232, 240, 0.8);
    
    /* Glassmorphism Defaults */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.45);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04);
    --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 8px -1px rgba(15, 23, 42, 0.02);

    /* Section Themes: Standard Neutrals */
    --theme-primary: #6366f1; /* Indigo */
    --theme-primary-hover: #4f46e5;
    --theme-bg-soft: #e0e7ff;
    
    /* Dynamic Color Classes */
    --color-red: #ef4444;
    --color-red-soft: #fee2e2;
    --color-red-hover: #dc2626;

    --color-green: #10b981;
    --color-green-soft: #d1fae5;
    --color-green-hover: #059669;

    --color-blue: #3b82f6;
    --color-blue-soft: #dbeafe;
    --color-blue-hover: #2563eb;

    --color-orange: #f97316;
    --color-orange-soft: #ffedd5;
    --color-orange-hover: #ea580c;
}

/* -------------------------------------------------------------
   GLOBAL RESET & BASE LAYOUT
   ------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-base);
    color: var(--color-text-dark);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* App Wrapper */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* -------------------------------------------------------------
   SIDEBAR STYLING
   ------------------------------------------------------------- */
.sidebar {
    width: 260px;
    background-color: var(--color-bg-sidebar);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.15);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--color-blue);
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.4));
}

.logo-highlight {
    color: var(--color-blue);
}

.sidebar-menu {
    flex: 1;
    padding: 20px 14px;
    overflow-y: auto;
}

.menu-group {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    color: #475569;
    margin: 20px 0 8px 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: none;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    color: #94a3b8;
    font-family: var(--font-primary);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.menu-item svg {
    width: 18px;
    height: 18px;
    color: #64748b;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: #f1f5f9;
}

.menu-item:hover svg {
    color: #cbd5e1;
}

/* Sidebar Active states based on current selection */
.menu-item.active {
    color: #ffffff;
    font-weight: 600;
}

/* Individual sidebar active indicators mapped by current theme */
.sidebar-menu .menu-item.active[data-target="dashboard"] {
    background-color: rgba(99, 102, 241, 0.15);
    border-left: 3px solid var(--theme-primary);
}
.sidebar-menu .menu-item.active[data-target="dashboard"] svg {
    color: var(--theme-primary);
}

.sidebar-menu .menu-item.active[data-target="inventario"] {
    background-color: rgba(59, 130, 246, 0.15);
    border-left: 3px solid var(--color-blue);
}
.sidebar-menu .menu-item.active[data-target="inventario"] svg {
    color: var(--color-blue);
}

.sidebar-menu .menu-item.active[data-target="clientes"],
.sidebar-menu .menu-item.active[data-target="nueva-venta"] {
    background-color: rgba(16, 185, 129, 0.15);
    border-left: 3px solid var(--color-green);
}
.sidebar-menu .menu-item.active[data-target="clientes"] svg,
.sidebar-menu .menu-item.active[data-target="nueva-venta"] svg {
    color: var(--color-green);
}

.sidebar-menu .menu-item.active[data-target="proveedores"],
.sidebar-menu .menu-item.active[data-target="nueva-compra"] {
    background-color: rgba(249, 115, 22, 0.15);
    border-left: 3px solid var(--color-orange);
}
.sidebar-menu .menu-item.active[data-target="proveedores"] svg,
.sidebar-menu .menu-item.active[data-target="nueva-compra"] svg {
    color: var(--color-orange);
}

.sidebar-menu .menu-item.active[data-target="historial"] {
    background-color: rgba(255, 255, 255, 0.08);
    border-left: 3px solid #e2e8f0;
}
.sidebar-menu .menu-item.active[data-target="historial"] svg {
    color: #ffffff;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background-color: #0b0f19;
}

.app-version {
    font-size: 0.72rem;
    color: #475569;
    font-weight: 600;
}

.app-author {
    font-size: 0.65rem;
    color: #334155;
    margin-top: 2px;
}

/* -------------------------------------------------------------
   MAIN CONTENT & HEADER
   ------------------------------------------------------------- */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px 40px;
    min-height: 100vh;
    transition: background-color 0.4s ease;
}

/* Dynamic color tints for sections */
.main-content.section-dashboard { background-color: #f4f6f9; }
.main-content.section-inventario { background-color: #f0f6ff; }
.main-content.section-ventas { background-color: #f0fbf5; }
.main-content.section-compras { background-color: #fff9f3; }
.main-content.section-historial { background-color: #f8fafc; }

.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

#current-section-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--color-text-dark);
}

#current-section-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.date-time-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #ffffff;
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-dark);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--color-border-light);
}

.date-time-badge svg {
    width: 14px;
    height: 14px;
    color: var(--color-text-muted);
}

/* -------------------------------------------------------------
   SPA ANIMATIONS AND SECTION HIDING
   ------------------------------------------------------------- */
.content-section {
    display: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.content-section.active-section {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* -------------------------------------------------------------
   GLASSMORPHIC CARDS AND UTILITIES
   ------------------------------------------------------------- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card {
    display: flex;
    flex-direction: column;
}

.dashboard-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 2px solid transparent;
    margin-bottom: 20px;
}

.dashboard-card .card-header.border-red { border-bottom-color: var(--color-red-soft); }
.dashboard-card .card-header.border-green { border-bottom-color: var(--color-green-soft); }
.dashboard-card .card-header.border-blue { border-bottom-color: var(--color-blue-soft); }
.dashboard-card .card-header.border-orange { border-bottom-color: var(--color-orange-soft); }
.dashboard-card .card-header.border-purple { border-bottom-color: #f3e8ff; }

.dashboard-card .card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-dark);
}

.card-body {
    flex: 1;
}

/* Spacing and Utilities */
.mt-4 { margin-top: 1.25rem; }
.mb-4 { margin-bottom: 1.25rem; }
.p-0 { padding: 0 !important; }
.h-full { height: 100%; }
.spacer { flex: 1; }
.font-semibold { font-weight: 600; }

/* -------------------------------------------------------------
   METRICS DASHBOARD CARDS
   ------------------------------------------------------------- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--color-border-light);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.metric-sales::before { background-color: var(--color-green); }
.metric-purchases::before { background-color: var(--color-orange); }
.metric-balance::before { background-color: var(--theme-primary); }
.metric-stock-alert::before { background-color: var(--color-red); }

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-sales .metric-icon { background-color: var(--color-green-soft); color: var(--color-green); }
.metric-purchases .metric-icon { background-color: var(--color-orange-soft); color: var(--color-orange); }
.metric-balance .metric-icon { background-color: var(--theme-bg-soft); color: var(--theme-primary); }
.metric-stock-alert .metric-icon { background-color: var(--color-red-soft); color: var(--color-red); }

.metric-icon svg {
    width: 24px;
    height: 24px;
}

.metric-info h3 {
    font-size: 0.82rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.metric-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--color-text-dark);
    margin: 4px 0 2px 0;
    letter-spacing: -0.5px;
}

.metric-trend {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.text-green { color: var(--color-green) !important; }
.text-orange { color: var(--color-orange) !important; }
.text-red { color: var(--color-red) !important; }

/* -------------------------------------------------------------
   DASHBOARD DETAIL LAYOUT
   ------------------------------------------------------------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
}

.dash-column {
    display: flex;
    flex-direction: column;
}

/* Alert list inside low stock card */
.alert-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 4px;
}

.alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(239, 68, 68, 0.04);
    border: 1px solid rgba(239, 68, 68, 0.12);
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.alert-item:hover {
    background-color: rgba(239, 68, 68, 0.08);
}

.alert-product-info h4 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-text-dark);
}

.alert-product-info span {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

.alert-stock-metrics {
    text-align: right;
}

.alert-stock-current {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--color-red);
}

.alert-stock-min {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    display: block;
}

.alert-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-muted);
}

.alert-empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--color-green);
    margin-bottom: 12px;
    opacity: 0.8;
}

.alert-empty-state p {
    font-size: 0.92rem;
    font-weight: 600;
}

/* Category Analytics Bars */
.category-analytics {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-bar-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-dark);
}

.category-bar-track {
    height: 8px;
    background-color: var(--color-border-light);
    border-radius: 99px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-blue), #60a5fa);
    border-radius: 99px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -------------------------------------------------------------
   TABLES & CONTROLS
   ------------------------------------------------------------- */
.table-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    padding: 11px 16px 11px 44px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--color-text-dark);
    outline: none;
    transition: all 0.2s ease;
    box-shadow: var(--card-shadow);
}

.search-box input:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-box select {
    background-color: #ffffff;
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    padding: 11px 16px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--color-text-dark);
    outline: none;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    transition: all 0.2s ease;
    min-width: 180px;
}

.filter-box select:focus {
    border-color: var(--theme-primary);
}

/* Table Styled */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
}

.table-styled {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
    background-color: #ffffff;
}

.table-styled th {
    background-color: #f8fafc;
    color: var(--color-text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border-light);
}

.table-styled td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text-dark);
    font-weight: 500;
    vertical-align: middle;
}

.table-styled tbody tr {
    transition: background-color 0.2s ease;
}

.table-styled tbody tr:hover {
    background-color: #f8fafc;
}

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

/* Table Minimal for Dashboard */
.table-minimal {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.table-minimal th {
    color: var(--color-text-muted);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border-light);
    background-color: rgba(255, 255, 255, 0.5);
}

.table-minimal td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

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

.text-center { text-align: center; }
.text-right { text-align: right; }

/* -------------------------------------------------------------
   BUTTONS AND BADGES
   ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* Button Variants */
.btn-primary {
    background-color: var(--color-blue);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}
.btn-primary:hover {
    background-color: var(--color-blue-hover);
    transform: translateY(-1px);
}

.btn-green {
    background-color: var(--color-green);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.btn-green:hover {
    background-color: var(--color-green-hover);
    transform: translateY(-1px);
}

.btn-orange {
    background-color: var(--color-orange);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}
.btn-orange:hover {
    background-color: var(--color-orange-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--color-border-light);
    color: var(--color-text-dark);
}
.btn-outline:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-danger {
    background-color: var(--color-red);
    color: #ffffff;
}
.btn-danger:hover {
    background-color: var(--color-red-hover);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 0.72rem;
    border-radius: 4px;
}

/* Action Icon Buttons */
.btn-icon-adjust {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-adjust-minus {
    background-color: var(--color-red-soft);
    color: var(--color-red);
}
.btn-adjust-minus:hover {
    background-color: var(--color-red);
    color: #ffffff;
}

.btn-adjust-plus {
    background-color: var(--color-blue-soft);
    color: var(--color-blue);
}
.btn-adjust-plus:hover {
    background-color: var(--color-blue);
    color: #ffffff;
}

.adjust-group {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background-color: #f1f5f9;
    color: var(--color-text-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.btn-action svg {
    width: 15px;
    height: 15px;
}

.btn-action-edit:hover {
    background-color: #dbeafe;
    color: var(--color-blue);
}

.btn-action-delete:hover {
    background-color: #fee2e2;
    color: var(--color-red);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 99px;
    text-transform: uppercase;
}

.badge-success { background-color: var(--color-green-soft); color: var(--color-green); }
.badge-warning { background-color: #fef3c7; color: #d97706; }
.badge-danger { background-color: var(--color-red-soft); color: var(--color-red); }
.badge-info { background-color: var(--color-blue-soft); color: var(--color-blue); }

/* -------------------------------------------------------------
   MODAL DIALOG LAYOUTS
   ------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-card {
    width: 100%;
    max-width: 500px;
    margin: 20px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

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

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.7rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.15s ease;
}

.modal-close-btn:hover {
    color: var(--color-text-dark);
}

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

/* Modals dynamic coloring borders */
.modal-card.border-blue { border-top: 5px solid var(--color-blue); }
.modal-card.border-green { border-top: 5px solid var(--color-green); }
.modal-card.border-orange { border-top: 5px solid var(--color-orange); }

/* -------------------------------------------------------------
   FORMS & INPUTS STYLING
   ------------------------------------------------------------- */
.styled-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-text-dark);
    display: inline-flex;
    gap: 4px;
}

.form-group label .required {
    color: var(--color-red);
}

.form-group input,
.form-group select,
.form-group textarea {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    padding: 10px 14px;
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    outline: none;
    background-color: #ffffff;
    color: var(--color-text-dark);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group input:disabled,
.form-group select:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-feedback-info {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-top: 2px;
}

.input-readonly {
    background-color: #f8fafc;
    border-color: var(--color-border-light);
    font-weight: 700;
    color: var(--color-text-dark);
    cursor: default;
}

/* -------------------------------------------------------------
   NEW SALES / PURCHASES OPERATION PANEL STYLING
   ------------------------------------------------------------- */
.operation-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
    align-items: flex-start;
}

.operation-form-card {
    display: flex;
    flex-direction: column;
}

.operation-receipt-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Receipt dynamic border highlights */
.operation-receipt-card.border-green { border-top: 6px solid var(--color-green); }
.operation-receipt-card.border-orange { border-top: 6px solid var(--color-orange); }

.receipt-header {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 2px dashed var(--color-border-light);
    margin-bottom: 20px;
}

.receipt-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--color-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.receipt-logo svg {
    width: 20px;
    height: 20px;
    color: var(--color-text-muted);
}

.receipt-date {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    font-weight: 600;
}

.receipt-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
}

.receipt-row .label {
    color: var(--color-text-muted);
    font-weight: 600;
}

.receipt-row .value {
    color: var(--color-text-dark);
    font-weight: 700;
    text-align: right;
}

.receipt-divider {
    border: none;
    border-top: 1px dashed var(--color-border-light);
    margin: 8px 0;
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.receipt-total-row .total-label {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-text-dark);
}

.receipt-total-row .total-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.receipt-footer {
    text-align: center;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
    font-weight: 600;
}

/* -------------------------------------------------------------
   TOAST FLOATING NOTIFICATIONS
   ------------------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.toast {
    background-color: #ffffff;
    color: var(--color-text-dark);
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    min-width: 280px;
    max-width: 400px;
    border-left: 4px solid var(--theme-primary);
    animation: toast-fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-success { border-left-color: var(--color-green); }
.toast-error { border-left-color: var(--color-red); }
.toast-warning { border-left-color: var(--color-orange); }

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--color-green); }
.toast-error .toast-icon { color: var(--color-red); }
.toast-warning .toast-icon { color: var(--color-orange); }

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

/* Zoom animation for modals */
@keyframes zoom-in {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-zoom {
    animation: zoom-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* -------------------------------------------------------------
   RESPONSIVENESS AND COLLAPSIBLES
   ------------------------------------------------------------- */
@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .operation-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    .sidebar-header span,
    .sidebar-menu span,
    .menu-group,
    .sidebar-footer {
        display: none;
    }
    .sidebar-header {
        padding: 20px 0;
        justify-content: center;
        display: flex;
    }
    .sidebar-menu {
        padding: 10px 4px;
    }
    .menu-item {
        justify-content: center;
        padding: 12px;
    }
    .main-content {
        margin-left: 70px;
        padding: 20px 20px;
    }
    .top-navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .top-navbar .navbar-right {
        width: 100%;
    }
    .date-time-badge {
        width: 100%;
        justify-content: center;
    }
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------------------------------
   CONTROL DE NÚMEROS DE SERIE (S/N)
   ------------------------------------------------------------- */
.serial-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    max-width: 320px;
    animation: zoom-in 0.2s ease-out;
}

.serial-badge-item {
    font-size: 0.65rem;
    font-weight: 700;
    background-color: #f1f5f9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    font-family: monospace;
    transition: all 0.15s ease;
}

.serial-badge-item:hover {
    background-color: var(--color-blue-soft);
    color: var(--color-blue);
    border-color: #93c5fd;
}

.btn-toggle-serials {
    background: none;
    border: none;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-blue);
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    outline: none;
}

.btn-toggle-serials:hover {
    text-decoration: underline;
    color: var(--color-blue-hover);
}

.row-low-stock {
    background-color: rgba(239, 68, 68, 0.01);
}

/* Custom Cart Table and Receipt List Styling */
.cart-table-container::-webkit-scrollbar,
.receipt-items-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.cart-table-container::-webkit-scrollbar-track,
.receipt-items-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.cart-table-container::-webkit-scrollbar-thumb,
.receipt-items-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.cart-table-container::-webkit-scrollbar-thumb:hover,
.receipt-items-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.btn-action-delete-cart {
    background-color: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-action-delete-cart:hover {
    background-color: #fee2e2;
    color: #b91c1c;
}

.btn-action-delete-cart svg {
    width: 14px;
    height: 14px;
}

.receipt-item-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    font-size: 0.8rem;
    color: var(--color-text-dark);
    border-bottom: 1px dashed var(--color-border-light);
}

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

.receipt-item-details {
    display: flex;
    flex-direction: column;
}

.receipt-item-name {
    font-weight: 500;
}

.receipt-item-meta {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.receipt-item-price {
    font-weight: 600;
    text-align: right;
    align-self: center;
    color: var(--color-text-dark);
}

/* -------------------------------------------------------------
   REPORTES MODULE ACCENT STYLES
   ------------------------------------------------------------- */
.main-content.section-reportes {
    background-color: #f5f3f7;
}

.btn-purple {
    background-color: #4a5568;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(74, 85, 104, 0.2);
}

.btn-purple:hover:not(:disabled) {
    background-color: #334155;
    transform: translateY(-1px);
}

.btn:disabled {
    background-color: #cbd5e1 !important;
    color: #94a3b8 !important;
    border-color: #cbd5e1 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.table-styled tfoot tr {
    background-color: #f8fafc;
    font-weight: 700;
    border-top: 2px solid var(--color-border-light);
}

.table-styled tfoot td {
    padding: 16px 20px;
    color: var(--color-text-dark);
}


