:root {
    /* Primary Color Palette */
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-glow: rgba(139, 92, 246, 0.4);

    /* Neutral/BG Colors */
    --bg-dark: #070912;
    --card-bg: rgba(17, 24, 39, 0.85);
    --border: rgba(255, 255, 255, 0.08);

    /* Text Colors */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --accent: #a78bfa;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Glass Effects */
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.7);
    --glass-blur: blur(16px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 0.95rem;
}

code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent);
    padding: 0.1rem 0.4rem;
    border-radius: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Background Animated Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 70vh;
    height: 70vh;
    border-radius: 50%;
    filter: blur(120px);
    animation: move 30s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -5%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
}

.blob-2 {
    bottom: -15%;
    right: -5%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    animation-delay: -10s;
}

.blob-3 {
    top: 30%;
    left: 40%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15) 0%, transparent 70%);
    animation-delay: -15s;
}

@keyframes move {
    0% {
        transform: translate(0, 0) scale(1.1);
    }

    100% {
        transform: translate(100px, 150px) scale(1.3);
    }
}

/* Navigation - COMPACT HARMONIC */
.glass-nav {
    background: rgba(7, 9, 18, 0.9);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.glass-nav .container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0rem;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo span {
    background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo .accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    transition: 0.3s;
    font-size: 0.9rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
}

.nav-links a.active {
    position: relative;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--accent), var(--primary));
    border-radius: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.user-profile #user-name {
    font-weight: 700;
    font-size: 0.85rem;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

/* Screen Transitions */
.screen {
    padding: 2.5rem 0;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen-header {
    margin-bottom: 2.5rem;
}

.screen-header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
    background: linear-gradient(to bottom right, #fff 20%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.screen-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 800px;
}

/* Toggles */
.mode-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.mode-toggle {
    background: rgba(0, 0, 0, 0.4);
    border: 1.5px solid var(--glass-border);
    padding: 0.5rem;
    border-radius: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.mode-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 1.1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    box-shadow: 0 8px 20px var(--primary-glow);
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
}

/* Form Layouts */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.52rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

input,
select {
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid var(--glass-border);
    border-radius: 0.6rem;
    padding: 0 1rem;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: 0.3s;
    height: 40px;
}

input:focus,
select:focus {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    align-items: center;
}

/* Buttons - HARMONIC */
.btn {
    height: 42px;
    padding: 0 1.5rem;
    border-radius: 0.6rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1.5px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Small Buttons - Padronized Height */
.btn-sm {
    height: 32px;
    padding: 0 1rem;
    font-size: 0.85rem;
    border-radius: 0.5rem;
    min-width: 80px;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-copy {
    background: var(--primary);
    color: white;
    height: 52px;
    min-width: 128px;
    border-radius: 0.85rem;
    box-shadow: 0 8px 20px var(--primary-glow);
}

/* Tables */
.table-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 1.5rem;
    overflow-x: auto;
    border: 1px solid var(--border);
    margin-top: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

th {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem 1.25rem;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: left;
}

td {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

td.actions-col,
th.actions-col {
    text-align: center;
}

.repo-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.btn-icon-trash {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 0.45rem;
    border: 1px solid rgba(248, 113, 113, 0.55);
    background: transparent;
    color: #f87171;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-icon-trash svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-icon-trash:hover {
    color: #fecaca;
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.12);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-card {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.modal-card h3 {
    margin-bottom: 0.35rem;
}

.modal-card p {
    color: var(--text-muted);
    margin-bottom: 1.2rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
}

/* Admin Grid */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

/* Repository Filters */
.filters-bar {
    padding: 1.5rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 140px;
}

.filter-actions .btn {
    width: 100%;
    font-size: 0.8rem;
}

.filter-group.main-search {
    flex: 2;
}

/* Campaign Generator */
.campaign-generator-block {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2.5rem;
}

.generator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.preview-box {
    background: rgba(0, 0, 0, 0.6);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 2px dashed var(--primary);
    margin-top: 1rem;
}

#campaign-preview-text {
    color: var(--success);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 1.25rem;
}

/* Generated Link Result */
.result-card {
    margin-top: 2rem;
    padding: 2rem;
}

.result-card h3 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
}

.result-preview label {
    display: block;
    text-align: center;
    margin-bottom: 0.85rem;
}

.result-preview-box {
    margin-top: 0;
    border-width: 1.5px;
}

.result-url-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#final-url {
    display: block;
    flex: 1;
    padding: 0.4rem 0.55rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--accent);
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.utm-details {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.utm-tag {
    padding: 0.75rem 1rem;
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    font-weight: 600;
}

.utm-tag span {
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    word-break: break-word;
}

/* Admin Lists */
.admin-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.admin-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
}

.admin-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
}

.admin-item .info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-item .info span:first-child {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
}

.admin-item .info span:last-child {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.admin-item .actions {
    display: flex;
    gap: 0.75rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .container {
        padding: 0 1.5rem;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .glass-nav {
        height: auto;
        padding: 1.5rem 0;
    }

    .glass-nav .container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .nav-links {
        gap: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .result-url-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-copy {
        width: 100%;
    }
}

.hidden {
    display: none !important;
}

.accent {
    color: var(--accent);
}

/* Login Screen */
.login-overlay {
    position: fixed;
    inset: 0;
    background: #020617;
    /* Solid very dark blue */
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 3rem !important;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* Reduced from 1.5rem */
}

.login-form-fields label {
    font-size: 0.75rem;
    /* Slightly smaller labels */
}

.login-form-fields .form-group {
    margin-bottom: 0rem;
}

/* User Management Styles */
.btn-icon-sm {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    margin-right: 0.75rem;
}

.btn-icon-sm:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.user-profile {
    display: flex;
    align-items: center;
}

#users-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    transition: 0.3s;
}

.user-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--glass-border);
}

.user-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.user-info .role-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: var(--primary-glow);
    color: var(--accent);
    border-radius: 1rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Enhanced User Management Layout */
.users-layout-grid {
    display: grid;
    grid-template-columns: 550px 1fr;
    gap: 2rem;
    align-items: start;
}

.user-form-container {
    flex-shrink: 0;
}

.user-list-container {
    min-width: 0;
    padding: 1.5rem !important;
}

#users-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.user-item {
    margin-bottom: 0rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.015);
}

.user-item .actions .btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.7rem;
}

@media (max-width: 1100px) {
    .users-layout-grid {
        grid-template-columns: 1fr;
    }

    .user-form-container {
        width: 100%;
    }
}
