/* ═══════════════════════════════════════════
   Sistema de Inventario - Estilos
   ═══════════════════════════════════════════ */

:root {
    --sidebar-bg: #2563EB;
    --sidebar-hover: #1E3A8A;
    --sidebar-active: #1E3A8A;
    --sidebar-width: 260px;
    --header-height: 60px;
    --body-bg: #F3F4F6;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --primary: #2563EB;
    --primary-dark: #1E3A8A;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Login Page ────────────────────────────── */

.login-body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: #f8fafc;
}

.login-split {
    display: flex;
    min-height: 100vh;
}

/* -- Brand Panel (left) -- */
.login-brand-panel {
    flex: 0 0 480px;
    background: linear-gradient(160deg, #1E3A8A 0%, #2563EB 50%, #3B82F6 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -120px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
}

.login-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
}

.login-brand-content {
    position: relative;
    z-index: 1;
    animation: fadeInLeft 0.6s ease;
}

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

.login-brand-logo {
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    backdrop-filter: blur(10px);
}

.login-brand-logo img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.login-brand-title {
    color: #fff;
    font-weight: 800;
    font-size: 36px;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

.login-brand-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    margin: 0 0 48px;
    line-height: 1.5;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 16px;
}

.login-feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.login-feature-icon i {
    color: #fff;
    font-size: 18px;
}

.login-feature strong {
    display: block;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.login-feature span {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
}

.login-brand-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 40px;
}

.login-brand-footer span {
    color: rgba(255, 255, 255, 0.35);
    font-size: 12px;
}

/* -- Form Panel (right) -- */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #fff;
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.5s ease;
}

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

.login-form-header {
    margin-bottom: 36px;
}

.login-form-header h2 {
    font-weight: 800;
    font-size: 28px;
    color: var(--text-primary);
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

.login-form-header p {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 0;
}

/* -- Input Groups -- */
.login-input-group {
    margin-bottom: 20px;
}

.login-input-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    margin-bottom: 8px;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    transition: color 0.2s;
}

.login-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: #f9fafb;
    transition: all 0.2s;
    outline: none;
}

.login-input::placeholder {
    color: #c0c5cc;
}

.login-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.login-input:focus + i,
.login-input-wrap:focus-within i {
    color: var(--primary);
}

/* -- Alerts -- */
.login-alert {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #DC2626;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-alert.warning {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #B45309;
}

.login-hint {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 16px;
}

/* -- Login Button -- */
.btn-login {
    width: 100%;
    padding: 13px 24px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

/* -- Login Responsive -- */
@media (max-width: 992px) {
    .login-split {
        flex-direction: column;
    }

    .login-brand-panel {
        flex: none;
        padding: 40px 32px;
    }

    .login-brand-subtitle {
        margin-bottom: 0;
    }

    .login-features,
    .login-brand-footer {
        display: none;
    }

    .login-form-panel {
        padding: 32px 24px;
    }
}

@media (max-width: 576px) {
    .login-brand-panel {
        padding: 32px 24px;
    }

    .login-brand-title {
        font-size: 28px;
    }

    .login-brand-subtitle {
        font-size: 14px;
    }

    .login-brand-logo {
        width: 56px;
        height: 56px;
        margin-bottom: 20px;
    }

    .login-brand-logo img {
        width: 40px;
        height: 40px;
    }

    .login-form-header h2 {
        font-size: 24px;
    }
}

/* ── Dashboard Layout ──────────────────────── */

.dashboard-body {
    background: var(--body-bg);
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    padding: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-brand {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 8px;
}

.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-brand-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.sidebar-brand h5 {
    color: #fff;
    margin: 0;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
}

.sidebar-brand small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.sidebar-menu {
    list-style: none;
    padding: 8px 12px;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu-label {
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 16px 12px 8px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.sidebar-menu li a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-menu li a.active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.sidebar-menu li a i {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer .btn {
    border-radius: 10px;
    font-size: 13px;
    padding: 8px 16px;
}

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

/* Top Header */
.top-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-header h4 {
    margin: 0;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 18px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

/* Content area */
.content-area {
    padding: 28px;
}

/* ── Stats Cards ──────────────────────────── */

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-card-icon.blue {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.stat-card-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-card-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-card-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-card h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 12px 0 4px;
    color: var(--text-primary);
}

.stat-card p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
    font-weight: 500;
}

/* ── Data Cards ───────────────────────────── */

.data-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.data-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.data-card-header h5 {
    margin: 0;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 16px;
}

.data-card-body {
    padding: 0;
}

/* ── Tables ───────────────────────────────── */

.table-custom {
    margin: 0;
    font-size: 14px;
}

.table-custom thead th {
    background: #f9fafb;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table-custom tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}

.table-custom tbody tr {
    transition: background 0.15s;
}

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

/* ── Badges ───────────────────────────────── */

.badge-stock {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-stock.ok {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge-stock.low {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.badge-stock.out {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* ── Buttons ──────────────────────────────── */

.btn-add {
    border-radius: 10px;
    padding: 8px 20px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-action {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    border: none;
    transition: all 0.2s;
}

.btn-action.edit {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

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

.btn-action.delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

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

/* ── Modals ───────────────────────────────── */

.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #f3f4f6;
    padding: 20px 24px;
}

.modal-header .modal-title {
    font-weight: 700;
    font-size: 18px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid #f3f4f6;
    padding: 16px 24px;
}

.modal-body .form-label {
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    margin-bottom: 6px;
}

.modal-body .form-control,
.modal-body .form-select {
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* ── Section Pages ────────────────────────── */

.section-page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section-page.active {
    display: block;
}

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

/* ── Export Buttons ────────────────────────── */

.btn-export {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ── Search ────────────────────────────────── */

.search-input {
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    padding: 8px 16px 8px 40px;
    font-size: 14px;
    width: 250px;
    transition: all 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* ── Empty State ──────────────────────────── */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 15px;
    margin: 0;
}

/* ── Responsive ───────────────────────────── */

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-primary);
    cursor: pointer;
}

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

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

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

    .sidebar-toggle {
        display: block;
    }

    .search-input {
        width: 180px;
    }
}

/* ── Toast notifications ──────────────────── */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast-custom {
    border-radius: 12px;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.toast-custom .toast-body {
    padding: 14px 20px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
