/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== BODY ===== */
body {
    font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
    background: #1e1e2e;
    color: #fff;
    height: 100vh;
    overflow: hidden;
}

/* ===== APP LAYOUT ===== */
.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
    padding:20px;
    gap:10px;
}

/* ===== SIDEBAR (estrecho, solo iconos) ===== */
.sidebar {
    width: 80px;
    background: rgb(255 255 255 / 7%);
    backdrop-filter: blur(12px);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 10;
    border-radius: 14px;
}

.sidebar.collapsed {
    width: 80px;
}

/* Header del sidebar (icono home arriba) */
.sidebar-header {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-header img {
    height: 28px;
}

.sidebar-header .brand {
    display: none;
}

/* Menu items del sidebar */
.sidebar-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.menu-item {
    width: 62px;
    height: 52px;
    background: none;
    border: none;
    color: #fcfcff;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
    gap: 3px;
    position: relative;
}

.menu-item span {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: #7a7a90;
    transition: color 0.2s;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.menu-item:hover span {
    color: #bbb;
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.13);
    color: #3b82f6;;
}

.menu-item.active span {
    display: none;
}

/* Indicador activo (línea azul a la izquierda) */
.menu-item.active::before {
    content: '';
    position: absolute;
    left: 1px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 28px;
    background: #3b82f6;
    border-radius: 0 3px 3px 0;
}

/* Toggle sidebar (oculto en este diseño) */
.sidebar-toggle {
    display: none;
}

/* ===== MAIN ===== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgb(26 31 55);
    position: relative;
    overflow: hidden;
    border-radius: 14px;
}

/* Decoraciones del fondo (figuras geométricas abstractas como en la imagen) */
.main::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        /* Círculo grande verde oscuro abajo-izquierda */
        radial-gradient(ellipse 500px 500px at 25% 85%, rgba(30, 100, 80, 0.55) 0%, transparent 70%),
        /* Círculo mediano abajo-centro */
        radial-gradient(ellipse 350px 350px at 45% 95%, rgba(40, 120, 90, 0.4) 0%, transparent 70%),
        /* Círculo pequeño arriba-derecha sutil */
        radial-gradient(ellipse 200px 200px at 80% 15%, rgba(60, 140, 110, 0.25) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Iconos decorativos flotantes (derecha) simulados con pseudo-elementos */
.main::after {
    content: '';
    position: absolute;
    top: 60px;
    right: 40px;
    width: 420px;
    height: 520px;
    pointer-events: none;
    z-index: 0;
}

/* ===== TOP BAR ===== */
.topbar {
    background: transparent;
    padding: 18px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: none;
    position: relative;
    z-index: 2;
}

.topbar h1,
.topbar .page-title {
    font-size: 1.6em;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.3px;
}

.topbar .user-info {
    gap: 12px;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.content {
    flex: 1;
    padding: 0 30px 100px 30px;
    overflow-y: auto;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

/* ===== TARJETA HERO (azul, como en la imagen) ===== */
.hero-card {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 60%, #1e40af 100%);
    border-radius: 18px;
    padding: 40px 36px;
    max-width: 380px;
    color: #fff;
    position: relative;
    z-index: 2;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    margin-top: 20px;
}

.hero-card .hero-subtitle {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
    margin-bottom: 6px;
}

.hero-card h2 {
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.hero-card p {
    font-size: 1em;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.5;
    margin-bottom: 22px;
}

.hero-card .btn-hero {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.hero-card .btn-hero:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Forma decorativa dentro de la tarjeta hero */
.hero-card::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 20px;
    width: 140px;
    height: 140px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    pointer-events: none;
}

/* ===== BARRA INFERIOR DE CATEGORÍAS ===== */
.bottom-bar {
    position: absolute;
    bottom: 0;
    left: 80px; /* ancho del sidebar */
    right: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: rgba(28, 28, 42, 0.82);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    z-index: 5;
}

.bottom-bar-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    cursor: pointer;
    transition: background 0.2s;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: #fff;
}

.bottom-bar-item:last-child {
    border-right: none;
}

.bottom-bar-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.bottom-bar-item .bar-icon {
    font-size: 1.5em;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
}

.bottom-bar-item .bar-text h4 {
    font-size: 0.95em;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1px;
}

.bottom-bar-item .bar-text span {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
}

.bottom-bar-item .bar-arrow {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.35);
    font-size: 1.1em;
}

/* ===== CARDS (rediseño para tema oscuro/transparente) ===== */
.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 28px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.card h3 {
    color: #fff;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.card.highlight {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
}

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    padding: 22px;
    border-radius: 14px;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 16px;
    align-items: center;
    color: #fff;
}

.stat-icon {
    font-size: 2.2em;
}

.stat-info h4,
.stat-box .label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.82em;
    margin-bottom: 4px;
}

.stat-value,
.stat-box .value {
    color: #fff;
    font-size: 1.8em;
    font-weight: 700;
}

.stat-box {
    background: rgba(255, 255, 255, 0.06);
    padding: 18px;
    border-radius: 10px;
    text-align: center;
}

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.data-table th {
    background: rgba(255, 255, 255, 0.06);
    padding: 11px 14px;
    text-align: left;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.92em;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ===== FORMS ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label,
.form-row label {
    display: block;
    margin-bottom: 7px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    font-size: 0.88em;
}

.form-group input,
.form-row input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 15px;
    color: #fff;
    transition: border-color 0.25s, background 0.25s;
}

.form-group input::placeholder,
.form-row input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.14);
}

.form-group select option {
    background: #2a2a3e;
    color: #fff;
}

.inline-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.inline-form label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.inline-form input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-success {
    background: #16a34a;
    color: white;
}

.btn-success:hover {
    background: #15803d;
    transform: translateY(-1px);
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.btn-warning {
    background: #ca8a04;
    color: #fff;
}

.btn-warning:hover {
    background: #a16207;
    transform: translateY(-1px);
}

.btn-info {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-info:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.18);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12px;
}

.btn-large {
    padding: 14px 30px;
    font-size: 17px;
}

.btn-login {
    width: 100%;
    padding: 13px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.btn-login:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.copy-btn {
    background: rgba(255, 255, 255, 0.13);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    margin-top: 8px;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ===== SERIALS ===== */
.serials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.serial-card,
.serial-item {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 18px;
    border-left: 3px solid #3b82f6;
    margin-bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid #3b82f6;
}

.serial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.serial-number {
    font-weight: 700;
    color: #fff;
    font-size: 1em;
}

/* Status badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.78em;
    font-weight: 600;
}

.status-pending {
    background: rgba(202, 138, 4, 0.2);
    color: #fbbf24;
}

.status-activated {
    background: rgba(22, 163, 74, 0.2);
    color: #4ade80;
}

.status-authorized {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.status-checked {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.status-rejected {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}

.serial-details {
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85em;
}

.serial-details .detail {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.serial-details .label {
    color: rgba(255, 255, 255, 0.45);
}

.serial-details .value {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.serial-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.88em;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #3b82f6;
    color: #fff;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.tab-btn.active:hover {
    background: #2563eb;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== ROLE BADGES ===== */
.role-badge {
    padding: 6px 14px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    background: rgba(220, 38, 38, 0.25);
    color: #f87171;
}

.role-reseller {
    background: rgba(22, 163, 74, 0.25);
    color: #4ade80;
}

.role-customer {
    background: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

.role-guest {
    background: rgba(100, 116, 139, 0.3);
    color: #94a3b8;
}

/* ===== ALERTS ===== */
.alert {
    padding: 13px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 500;
    border-left: 3px solid;
    font-size: 0.9em;
}

.alert-success {
    background: rgba(22, 163, 74, 0.15);
    color: #4ade80;
    border-color: #16a34a;
}

.alert-error {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
    border-color: #dc2626;
}

.alert-warning {
    background: rgba(202, 138, 4, 0.15);
    color: #fbbf24;
    border-color: #ca8a04;
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: #3b82f6;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #1e1e2f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 6% auto;
    padding: 28px;
    border-radius: 16px;
    width: 90%;
    max-width: 580px;
    max-height: 78vh;
    overflow-y: auto;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #fff;
}

.modal-section {
    margin-bottom: 20px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.modal-section h4 {
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.close {
    color: rgba(255, 255, 255, 0.4);
    float: right;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #fff;
}

/* ===== LOGIN ===== */
.login-container {
    background: rgba(30, 30, 47, 0.92);
    backdrop-filter: blur(16px);
    padding: 38px;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* ===== CODE BOX ===== */
.code-box {
    background: rgba(0, 0, 0, 0.35);
    color: #c4d4e8;
    padding: 14px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85em;
    word-break: break-all;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== INFO ===== */
.info-card {
    background: rgba(59, 130, 246, 0.12);
    border-left: 3px solid #3b82f6;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.7);
}

.help-text {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85em;
}

.session-info {
    background: rgba(59, 130, 246, 0.12);
    border-left: 3px solid #3b82f6;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.05em;
}

input {
    background-color: rgb(68 68 68 / 20%);
    color: #c9c9c9;
    border: 1px solid #7c7878;
    flex: 1; min-width: 250px; padding: 10px; border-radius: 4px; font-size: 14px;
}
select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #ffffff4f;
    color: #fff;padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #ffffff4f;
    color: #fff;
}
select option {
    color: #4e4747;
    background-color: rgb(209 205 205 / 48%);
}
/* ===== SEARCH ===== */
.search-results {
    display: none;
    background: #1e1e2f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    font-size: 14px;
    color: #fff;
}

.search-results.show {
    display: block;
}

.search-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ===== LOGO ===== */
.logo {
    text-align: center;
}

.logo img {
    height: 46px;
}

.logo h1 {
    font-size: 1.1em;
    color: #fff;
    margin-top: 8px;
}

.emoji {
    font-size: 3.5em;
}

/* ===== HEADER (alternativa sin sidebar) ===== */
header {
    background: rgba(30, 30, 46, 0.85);
    backdrop-filter: blur(10px);
    padding: 18px 28px;
    border-radius: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #fff;
    font-size: 1.6em;
}

.user-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== HIDE UTIL ===== */
.hide {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .bottom-bar {
        left: 60px;
        grid-template-columns: repeat(2, 1fr);
    }

    .content {
        padding: 0 16px 100px 16px;
    }

    .hero-card {
        max-width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .serials-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .bottom-bar {
        grid-template-columns: 1fr 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}