:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #020617;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --border: #334155;
    --silver: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Login Page */
.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
}

.login-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
}

.login-header h1 {
    color: var(--text-main);
    margin: 1rem 0 0.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.login-header p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.silver-icon {
    font-size: 3rem;
    color: var(--accent);
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.3));
}

.form-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-icon input, .input-icon select, select, input[type="text"], input[type="number"], input[type="password"], input[type="email"], input[type="date"], input[type="datetime-local"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 600px;
    margin: 50px auto;
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.modal-header h3 {
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 700;
}

.input-icon input {
    padding-left: 2.75rem;
}

.input-icon input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--accent);
    color: var(--bg-dark);
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.alert-info {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    border-color: rgba(56, 189, 248, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    color: var(--text-main);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.sidebar-menu {
    padding: 1.5rem 0.75rem;
    flex: 1;
}

.menu-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.menu-item.active {
    background-color: var(--accent);
    color: var(--bg-dark);
}

.menu-item i {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
    font-size: 1.1rem;
}

.menu-item.active i {
    color: var(--bg-dark);
}

.main-content {
    flex: 1;
    padding: 2rem;
    margin-left: 280px;
    width: calc(100% - 280px);
    background-color: var(--bg-dark);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

.top-bar h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.stat-info h3 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Tables */
.table-container {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container h3 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-main);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Alertas Piscantes */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.blink-alert {
    animation: blink 1.5s infinite;
    color: var(--danger);
    font-weight: bold;
}

/* Status Badges */
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-info { background: rgba(56, 189, 248, 0.1); color: var(--accent); border: 1px solid rgba(56, 189, 248, 0.2); }

/* Tablet */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }
    .sidebar-header h2, .menu-item span {
        display: none;
    }
    .menu-item i {
        margin-right: 0;
    }
    .main-content {
        margin-left: 80px;
        width: calc(100% - 80px);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        z-index: 50;
    }
    
    .sidebar-header {
        padding: 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .sidebar-header h2 {
        display: block !important;
        margin: 0 !important;
        font-size: 1rem !important;
    }
    
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .menu-item {
        margin-bottom: 0;
        margin-right: 0;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .menu-item span {
        display: inline !important;
        margin-left: 0.5rem;
    }
    
    .menu-item i {
        margin-right: 0.5rem !important;
    }
    
    .main-content {
        padding: 1rem;
        margin-left: 0;
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
        padding: 1.5rem;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
    }
    
    .table-container {
        padding: 1rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
    }
    
    .modal-content {
        width: 100%;
        margin: 10px auto;
        padding: 1rem;
    }
    
    .btn-login {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    table {
        font-size: 0.7rem;
    }
    
    th, td {
        padding: 0.5rem 0.25rem;
    }
    
    .alert {
        padding: 0.75rem;
        font-size: 0.75rem;
    }
}
