/* ==========================================================================
   ARIXTECH HUB DE SISTEMAS - STYLESHEET
   Design Theme: Deep Space Glassmorphism & Cyber Modern
   ========================================================================== */

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

:root {
    /* Color Palette */
    --bg-primary: #0a0d14;
    --bg-secondary: #121824;
    --bg-card: rgba(18, 24, 38, 0.7);
    --bg-card-hover: rgba(26, 35, 54, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(99, 102, 241, 0.4);
    
    /* Brand Colors */
    --brand-primary: #6366f1;
    --brand-primary-glow: rgba(99, 102, 241, 0.35);
    --brand-secondary: #a855f7;
    --brand-accent: #38bdf8;
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Status Colors */
    --status-online: #10b981;
    --status-online-glow: rgba(16, 185, 129, 0.4);
    --status-maintenance: #f59e0b;
    --status-dev: #3b82f6;

    /* UI Measurements */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --shadow-main: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 10px 30px -10px var(--brand-primary-glow);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.10) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.05) 0%, transparent 60%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: 'Outfit', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   HEADER SECTION
   ========================================================================== */

.hub-header {
    padding: 24px 0;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 13, 20, 0.8);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    box-shadow: var(--shadow-glow);
    position: relative;
}

.brand-logo::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-md) + 2px);
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    z-index: -1;
    opacity: 0.5;
    filter: blur(6px);
}

.brand-info h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 40%, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-info p {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--status-online);
    font-size: 12px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--status-online);
    box-shadow: 0 0 10px var(--status-online);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-add-system {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-glow);
}

.btn-add-system:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px -5px var(--brand-primary-glow);
    filter: brightness(1.1);
}

.live-time {
    font-family: monospace;
    font-size: 14px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
}

/* ==========================================================================
   HERO / SEARCH SECTION
   ========================================================================== */

.hero-section {
    padding: 48px 0 32px 0;
    text-align: center;
}

.hero-title {
    font-size: 38px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero-title span {
    background: linear-gradient(135deg, var(--brand-accent), var(--brand-primary), var(--brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px auto;
}

/* Search Box */
.search-wrapper {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    font-size: 18px;
    pointer-events: none;
    transition: var(--transition);
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    background: rgba(18, 24, 38, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    backdrop-filter: blur(12px);
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px var(--brand-primary-glow), 0 10px 30px rgba(0, 0, 0, 0.4);
    background: rgba(22, 30, 48, 0.95);
}

.search-input:focus + .search-icon {
    color: var(--brand-primary);
}

/* Shortcuts Bar */
.quick-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 36px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(8px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.15);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.stat-text h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-text p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================================================
   CATEGORY FILTER TABS
   ========================================================================== */

.filter-section {
    margin: 32px 0 24px 0;
}

.tabs-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 16px;
    flex-wrap: wrap;
}

.category-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    padding: 10px 18px;
    border-radius: var(--radius-full);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.tab-btn .badge-count {
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    font-size: 11px;
}

.tab-btn.active .badge-count {
    background: var(--brand-primary);
    color: #fff;
}

/* ==========================================================================
   SYSTEM CARDS GRID
   ========================================================================== */

.systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    padding-bottom: 60px;
}

.system-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(16px);
    transition: var(--transition);
    box-shadow: var(--shadow-main);
    overflow: hidden;
}

.system-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-gradient, linear-gradient(90deg, var(--brand-primary), var(--brand-secondary)));
    opacity: 0.8;
    transition: var(--transition);
}

.system-card:hover {
    transform: translateY(-6px);
    border-color: var(--glass-border-hover);
    background: var(--bg-card-hover);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 25px rgba(99, 102, 241, 0.15);
}

.system-card:hover::before {
    height: 4px;
    opacity: 1;
}

/* Card Header */
.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}

.card-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--card-gradient, linear-gradient(135deg, var(--brand-primary), var(--brand-secondary)));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.card-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.tag-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tag-badge.primary-badge {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.4);
}

.tag-badge.admin-badge {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
    border-color: rgba(236, 72, 153, 0.4);
}

/* Card Content */
.card-body {
    margin-bottom: 24px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-subtitle {
    font-size: 12px;
    color: var(--brand-accent);
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Actions / Redirection Buttons */
.card-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-primary-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    text-align: center;
}

.btn-primary-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    filter: brightness(1.1);
}

.btn-admin-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(236, 72, 153, 0.15);
    border: 1px solid rgba(236, 72, 153, 0.3);
    color: #f472b6;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.btn-admin-action:hover {
    background: rgba(236, 72, 153, 0.3);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.3);
}

.card-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.opt-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.opt-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.opt-btn.btn-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-lg);
}

.empty-icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==========================================================================
   MODAL WINDOW
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 12, 0.8);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #111622;
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    padding: 32px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
    transition: var(--transition);
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 700;
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%3C94a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

select.form-control option {
    background-color: #121824;
    color: #f8fafc;
    padding: 10px;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-glow);
    background: rgba(255, 255, 255, 0.07);
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
}

.btn-cancel {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
}

.btn-save {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   FOOTER SECTION
   ========================================================================== */

.hub-footer {
    border-top: 1px solid var(--glass-border);
    padding: 24px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    background: rgba(10, 13, 20, 0.9);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--brand-accent);
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    background: #1e293b;
    border: 1px solid var(--brand-primary);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive Rules */
@media (max-width: 768px) {
    .hero-title { font-size: 28px; }
    .header-content { flex-direction: column; align-items: flex-start; }
    .header-actions { width: 100%; justify-content: space-between; }
    .systems-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}
