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

:root {
    --iv-primary: #0ab39c;
    --iv-bg: #f3f3f9;
    --iv-sidebar-bg: #ffffff;
    --iv-text-main: #495057;
    --iv-text-muted: #878a99;
    --iv-card-shadow: 0 1px 2px rgba(56, 65, 74, 0.15);
}

body {
    background-color: var(--iv-bg);
    font-family: 'Public Sans', sans-serif;
    color: var(--iv-text-main);
    font-size: 0.9rem;
}

.sidebar {
    width: 60px;
    background: var(--iv-sidebar-bg);
    height: calc(100vh - 70px);
    position: fixed;
    top: 70px;
    left: 0;
    border-right: 1px solid #e9ebec;
    z-index: 1000;
    overflow: hidden;
    transition: width 0.25s ease;
}

.sidebar:hover {
    width: 250px;
}

.sidebar-logo {
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-left: 21px;
    overflow: hidden;
}

.sidebar-logo-icon {
    flex-shrink: 0;
    margin-right: 22px;
    transition: margin-right 0.25s ease;
}

.sidebar:hover .sidebar-logo-icon {
    margin-right: 10px;
}

.sidebar .menu-title {
    padding: 12px 20px;
    font-size: 11px;
    font-weight: 700;
    color: #919da9;
    text-transform: uppercase;
    visibility: hidden;
}

.sidebar:hover .menu-title {
    visibility: visible;
}

.sidebar .nav-label {
    display: none;
    white-space: nowrap;
}

.sidebar:hover .nav-label {
    display: inline;
}

.sidebar .nav-link {
    color: #6d7080;
    height: 40px;
    padding: 0 0 0 21px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    transition: color 0.3s;
    text-decoration: none;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: var(--iv-primary);
}

.sidebar .nav-link i {
    font-size: 18px;
    flex-shrink: 0;
    margin-right: 22px;
    transition: margin-right 0.25s ease;
}

.sidebar:hover .nav-link i {
    margin-right: 10px;
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(10, 179, 156, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    border-right: 3px solid var(--iv-primary);
}

.content-wrapper {
    margin-left: 60px;
}

@media (max-width: 768px) {
    .sidebar {
        width: 0;
        border-right: none;
    }
    .sidebar:hover {
        width: 250px;
        border-right: 1px solid #e9ebec;
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    }
    .content-wrapper {
        margin-left: 0;
    }
}

.topbar {
    height: 70px;
    background: #fff;
    padding: 0 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--iv-card-shadow);
    margin-bottom: 25px;
    position: relative;
    z-index: 1001;
}

/* Botón primario */
.btn-iv-primary { background-color: var(--iv-primary); border-color: var(--iv-primary); color: #fff; }
.btn-iv-primary:hover { background-color: #09a18c; border-color: #09a18c; color: #fff; }

/* Tabla de facturas */
.table thead th {
    background-color: #f3f6f9;
    text-transform: uppercase;
    font-size: 11px;
    color: #878a99;
    letter-spacing: 0.5px;
    padding: 12px 15px;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f3f6f9;
    vertical-align: middle;
}

/* Badges de estado */
.badge-soft {
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
}

.bg-process     { background-color: rgba(64, 184, 255, 0.1); color: #40b8ff; }
.bg-success-soft { background-color: rgba(10, 179, 156, 0.1); color: #0ab39c; }
.bg-warning-soft { background-color: rgba(247, 184, 75, 0.1); color: #f7b84b; }
.bg-danger-soft  { background-color: rgba(240, 101, 72, 0.1); color: #f06548; }
.bg-accepted     { background-color: #0ab39c; color: #fff; }

/* Spinner OCR */
.spinner-ocr {
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: spin 1s linear infinite;
    margin-right: 5px;
}

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

/* Botones de acción de tabla */
.btn-action {
    padding: 4px 8px;
    font-size: 14px;
    color: #878a99;
    border: none;
    background: transparent;
}

.btn-action:hover {
    color: var(--iv-primary);
    background: #f3f6f9;
    border-radius: 4px;
}

/* Modal detalle de factura */
.modal .form-label { font-weight: 600; font-size: 13px; color: var(--iv-text-main); }
/* Inputs en modo vista: mismo aspecto que activo pero sin cursor de edición */
.modal .form-control:disabled,
.modal .form-select:disabled { background-color: #fff; color: var(--iv-text-main); opacity: 1; cursor: default; }
.modal .form-control, .modal .form-select { font-size: 0.875rem; }
.modal .form-control:focus, .modal .form-select:focus { border-color: var(--iv-primary); box-shadow: none; }
.btn-soft-secondary { background-color: #f3f6f9; border-color: #e9ebec; color: var(--iv-text-main); }
.btn-soft-secondary:hover { background-color: #e9ebec; color: var(--iv-text-main); }
.border-top-dashed { border-top-style: dashed !important; }

/* Drag & drop zone */
.drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 0.75rem;
    padding: 2.25rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background-color: #fafafa;
    transition: border-color 0.2s, background-color 0.2s;
    user-select: none;
}
.drop-zone:hover,
.drop-zone:focus {
    border-color: var(--iv-primary);
    background-color: rgba(10, 179, 156, 0.04);
    outline: none;
}
.drop-zone.drag-over {
    border-color: var(--iv-primary);
    background-color: rgba(10, 179, 156, 0.08);
}
.drop-zone__icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(10, 179, 156, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--iv-primary);
    margin: 0 auto;
    transition: background-color 0.2s;
}
.drop-zone.drag-over .drop-zone__icon { background-color: rgba(10, 179, 156, 0.22); }
.drop-zone__link { color: var(--iv-primary); font-weight: 600; }
#drop-zone-files li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    background: #f3f3f9;
    border-radius: 0.4rem;
    font-size: 0.82rem;
    color: #495057;
    margin-bottom: 0.3rem;
}

/* Notificaciones modal */
.notif-item { transition: background-color 0.15s; color: inherit; }
.notif-item:hover { background-color: #f3f6f9; }

/* Login */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

@media print {
    .sidebar, .topbar, .d-print-none { display: none !important; }
    .content-wrapper { margin-left: 0 !important; }
    .modal { position: static !important; }
    .modal-dialog { max-width: 100% !important; margin: 0 !important; }
}

