/* 
   Sistema de Permisos - Modern UI Design 2025
   Theme: Corporate Glassmorphism
*/

:root {
    /* Color Palette - Slate & Blue */
    --primary: #0f172a;
    /* Slate 900 */
    --primary-light: #1e293b;
    /* Slate 800 */
    --secondary: #2563eb;
    /* Blue 600 */
    --secondary-hover: #1d4ed8;
    /* Blue 700 */
    --accent: #0ea5e9;
    /* Sky 500 */
    --success: #10b981;
    /* Emerald 500 */
    --warning: #f59e0b;
    /* Amber 500 */
    --danger: #ef4444;
    /* Red 500 */
    --info: #3b82f6;
    /* Blue 500 */

    /* Neutral Colors */
    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-surface: #ffffff;
    --text-main: #334155;
    /* Slate 700 */
    --text-muted: #64748b;
    /* Slate 500 */
    --border: #e2e8f0;
    /* Slate 200 */

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Base Styles */
body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.025em;
}

a {
    text-decoration: none;
    transition: color 0.2s;
}

/* Layout & Container */
.main-content {
    min-height: calc(100vh - 160px);
    padding: 2rem 0;
}

/* Header & Navigation */
.app-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary) !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-brand img {
    height: 32px;
    width: auto;
}

.nav-link {
    font-weight: 500;
    /* color: var(--text-muted) !important; */
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--secondary) !important;
    background-color: rgba(37, 99, 235, 0.05);
}

.nav-link i {
    font-size: 1.1em;
    opacity: 0.8;
}

/* User Menu */
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    transition: all 0.2s;
}

.user-menu-btn:hover {
    border-color: var(--secondary);
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.5rem;
}

/* Stats Cards */
.stat-card {
    position: relative;
    overflow: hidden;
    border: none;
    background: white;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--secondary);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Buttons */
.btn {
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
}

.btn-primary {
    background: var(--secondary);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--secondary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.btn-outline-primary {
    border: 1px solid var(--secondary);
    color: var(--secondary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--secondary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* Forms */
.form-control,
.form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.625rem 1rem;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--bg-body);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

.table-hover tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.02);
}

/* Badges */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 600;
    border-radius: 50px;
    font-size: 0.75rem;
}

.bg-success {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: var(--success) !important;
}

.bg-warning {
    background-color: rgba(245, 158, 11, 0.1) !important;
    color: var(--warning) !important;
}

.bg-danger {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: var(--danger) !important;
}

.bg-info {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: var(--info) !important;
}

.bg-primary {
    background-color: rgba(37, 99, 235, 0.1) !important;
    color: var(--secondary) !important;
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
}

/* Footer */
.app-footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: auto;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Utilities */
.text-primary {
    color: var(--secondary) !important;
}

.shadow-hover:hover {
    box-shadow: var(--shadow-lg) !important;
    transform: translateY(-2px);
}

.rounded-xl {
    border-radius: var(--radius-xl) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}