/* ==========================================================================
   HAMPI GO - MAIN STYLESHEET (Dark Modern Glassmorphism & Responsive)
   ========================================================================== */
:root {
    --bg-primary: #020617; /* slate-950 */
    --bg-secondary: #0f172a; /* slate-900 */
    --bg-tertiary: #1e293b; /* slate-800 */
    --border-color: #334155; /* slate-700 / slate-800 */
    --text-main: #f8fafc; /* slate-50 */
    --text-muted: #94a3b8; /* slate-400 */
    --accent-indigo: #6366f1;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --radius-lg: 1rem;
    --radius-md: 0.75rem;
    --radius-sm: 0.5rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Estructura Layout Principal */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 280px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    transition: transform 0.3s ease;
}

.main-content-wrapper {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-navbar {
    height: 70px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.content-container {
    padding: 2rem;
    flex: 1;
}

/* Adaptabilidad Responsive para Móviles */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content-wrapper {
        margin-left: 0;
    }
}

/* Tarjetas y Contenedores */
.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

/* Tablas Adaptables con Scroll Horizontal */
.table-responsive,
.sunat-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    text-align: left;
    font-size: 0.8125rem; /* 13px compacto para caber mejor */
}

th, td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

th {
    background-color: rgba(30, 41, 59, 0.5);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

tr:hover td {
    background-color: rgba(30, 41, 59, 0.3);
}

/* Clases de utilidad para tablas densas (SUNAT, reportes, etc.) */
.nowrap,
.col-total,
.col-estado,
.col-acciones,
.badge-estado {
    white-space: nowrap !important;
}

.col-respuesta {
    max-width: 280px;
    line-height: 1.35;
    word-break: break-word;
}

.col-acciones .btn,
.col-acciones button,
.col-acciones a {
    white-space: nowrap;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

/* Ajuste adicional en pantallas de escritorio intermedias/estándar */
@media (max-width: 1366px) {
    .content-container {
        padding: 1.25rem;
    }
    th, td {
        padding: 0.55rem 0.6rem;
        font-size: 0.775rem;
    }
    .col-respuesta {
        max-width: 210px;
    }
}

/* Botones y Formularios */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--accent-indigo);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    background-color: #4f46e5;
}

.form-input {
    width: 100%;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Campanilla de Notificaciones */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}
.notification-bell:hover {
    background-color: var(--bg-tertiary);
}
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: var(--accent-rose);
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
}
