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

:root {
    --bg-main: #060913;
    --bg-card: #0d1222;
    --bg-sidebar: #090c17;
    --bg-input: #12182d;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: #00f2fe;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-cyan: #00f2fe;
    --accent-blue: #4facfe;
    --gradient-accent: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --gradient-danger: linear-gradient(135deg, #f85032 0%, #f16f5c 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-card: linear-gradient(145deg, #0d1222 0%, #111830 100%);
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    
    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    
    --shadow-lg: 0 10px 40px -10px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.12);
    --shadow-glow-active: 0 0 30px rgba(0, 242, 254, 0.25);
    
    --sidebar-width: 260px;
    --header-height: 70px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

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

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 15px rgba(0, 242, 254, 0.1); }
    50% { box-shadow: 0 0 25px rgba(0, 242, 254, 0.25); }
    100% { box-shadow: 0 0 15px rgba(0, 242, 254, 0.1); }
}

/* Login Layout */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.login-bg-shapes::before,
.login-bg-shapes::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
}

.login-bg-shapes::before {
    top: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--accent-cyan);
}

.login-bg-shapes::after {
    bottom: -10%;
    left: -10%;
    width: 55vw;
    height: 55vw;
    background: var(--accent-blue);
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(13, 18, 34, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    z-index: 2;
    animation: slideUp var(--transition-normal);
}

.login-logo {
    display: block;
    max-width: 180px;
    max-height: 70px;
    margin: 0 auto 30px;
    object-fit: contain;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.925rem;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition-fast);
}

.form-control {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
    background-color: rgba(18, 24, 45, 0.9);
}

.form-control:focus + .input-icon {
    color: var(--accent-cyan);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    width: 100%;
}

.btn-primary {
    background: var(--gradient-accent);
    color: #040814;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-active);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
    box-shadow: 0 4px 15px rgba(248, 80, 50, 0.2);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(248, 80, 50, 0.35);
}

/* Dashboard App Shell */
.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition-normal);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    max-height: 40px;
    max-width: 150px;
    object-fit: contain;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

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

.menu-item.active .menu-item-link {
    background: rgba(0, 242, 254, 0.08);
    border-left: 3px solid var(--accent-cyan);
    color: var(--accent-cyan);
    font-weight: 600;
}

.menu-item-link svg {
    width: 20px;
    height: 20px;
    transition: var(--transition-fast);
}

.menu-item.active .menu-item-link svg {
    stroke: var(--accent-cyan);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-md);
    background-color: rgba(255, 255, 255, 0.02);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #040814;
    font-weight: 700;
    font-size: 0.95rem;
}

.user-info {
    flex-grow: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition-normal);
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background-color: rgba(6, 9, 19, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

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

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.btn-icon:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.08);
}

.menu-toggle {
    display: none;
}

/* Content Container */
.content-container {
    padding: 32px;
    flex-grow: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    animation: fadeIn var(--transition-normal);
}

/* Dashboard Summary Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1-fraction));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: rgba(0, 242, 254, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 242, 254, 0.15);
}

/* Section Header Actions */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.section-title p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Card view & Tables */
.card-table-wrapper {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.table-filters {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.search-bar {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.search-bar input {
    padding-left: 36px;
    padding-right: 12px;
}

.search-bar svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.filter-selects {
    display: flex;
    gap: 12px;
}

.filter-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--border-focus);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    background-color: rgba(255, 255, 255, 0.015);
    padding: 16px 24px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.925rem;
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: var(--transition-fast);
}

.custom-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.015);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin {
    background-color: rgba(0, 242, 254, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.badge-capturista {
    background-color: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.badge-active {
    background-color: rgba(56, 239, 125, 0.1);
    color: #38ef7d;
    border: 1px solid rgba(56, 239, 125, 0.2);
}

.badge-inactive {
    background-color: rgba(248, 80, 50, 0.1);
    color: #f16f5c;
    border: 1px solid rgba(248, 80, 50, 0.2);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.btn-action:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.08);
}

.btn-action.btn-edit:hover {
    color: var(--accent-cyan);
    border-color: rgba(0, 242, 254, 0.3);
    background-color: rgba(0, 242, 254, 0.05);
}

.btn-action.btn-delete:hover {
    color: #ff4a4a;
    border-color: rgba(255, 74, 74, 0.3);
    background-color: rgba(255, 74, 74, 0.05);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(3, 5, 10, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-container {
    width: 100%;
    max-width: 500px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    overflow: hidden;
    transform: translateY(30px);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 300px;
    max-width: 450px;
    background: var(--bg-card);
    border-left: 4px solid var(--accent-cyan);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideUp var(--transition-normal);
}

.toast.toast-success {
    border-left-color: #38ef7d;
}

.toast.toast-error {
    border-left-color: #f16f5c;
}

.toast-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-success .toast-icon { color: #38ef7d; }
.toast-error .toast-icon { color: #f16f5c; }

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.825rem;
    color: var(--text-muted);
}

/* Dropdowns / Action widgets */
.actions-dropdown {
    position: relative;
    display: inline-block;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px; /* Hide sidebar by default */
    }
    
    .sidebar {
        transform: translateX(-260px);
        width: 260px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .top-header {
        padding: 0 20px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .content-container {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .table-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-bar {
        max-width: 100%;
    }
    
    .filter-selects {
        width: 100%;
    }
    
    .filter-select {
        flex-grow: 1;
    }

    /* Convert Table to Card List on mobile for maximum responsiveness */
    .custom-table, .custom-table thead, .custom-table tbody, .custom-table th, .custom-table td, .custom-table tr {
        display: block;
    }
    
    .custom-table thead {
        display: none; /* Hide header columns on mobile */
    }
    
    .custom-table tbody tr {
        border-bottom: 1px solid var(--border-color);
        padding: 16px 20px;
        position: relative;
    }
    
    .custom-table td {
        border: none;
        padding: 6px 0;
        padding-left: 45%;
        position: relative;
        text-align: right;
        min-height: 32px;
    }
    
    .custom-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 40%;
        text-align: left;
        font-weight: 700;
        font-size: 0.75rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .custom-table td.actions-td {
        text-align: right;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding-top: 12px;
        border-top: 1px dashed var(--border-color);
        margin-top: 8px;
    }
}

/* Utility classes */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* Dashboard placeholder card */
.welcome-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.welcome-card h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-card p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 600px;
}

.card-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.action-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.action-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-glow);
}

.action-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.action-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(0, 242, 254, 0.05);
    border: 1px solid rgba(0, 242, 254, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
}

.action-card-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.action-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-grow: 1;
}

.action-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-cyan);
    font-weight: 600;
    font-size: 0.9rem;
}

.action-card-footer svg {
    transition: transform var(--transition-fast);
}

.action-card:hover .action-card-footer svg {
    transform: translateX(4px);
}
