:root {
    --primary: #10b981;
    --primary-hover: #059669;
    --bg: #06110d;
    --card-bg: #0c1f18;
    --card: #0c1f18;
    --text: #f0fdf4;
    --text-muted: #94a3b8;
    --success: #34d399;
    --danger: #ef4444;
    --glass: rgba(16, 185, 129, 0.1);
    --border: rgba(255, 255, 255, 0.05);
    --radius: 12px;
}

/* CUSTOM PREMIUM SCROLLBARS FOR INTERNAL ELEMENTS */
*:not(html):not(body) {
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 185, 129, 0.25) rgba(6, 17, 13, 0.4);
}

*:not(html):not(body)::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*:not(html):not(body)::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 99px;
}

*:not(html):not(body)::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.25);
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    transition: background 0.2s ease;
}

*:not(html):not(body)::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.5);
}

#admin-wrapper:not(.hidden) {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* LOGIN SCREEN */
#login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #064e3b, #06110d);
}

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

.brand-login {
    margin-bottom: 1rem;
}

.login-card h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

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

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

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

.form-group input:not([type="checkbox"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' 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 1rem center;
    background-size: 1em;
}

.form-group input:not([type="checkbox"]):focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
}

input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--primary);
}

.btn-primary {
    width: 100%;
    padding: 0.8rem;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    outline: none !important;
    box-shadow: none !important;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.error-msg {
    color: var(--danger);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* DASHBOARD COMPONENTS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Layout */
.dashboard {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 20px;
    flex: 1 0 auto;
}

/* APP LAYOUT - HEADER */
header {
    width: 100%;
    flex-shrink: 0;
    background: rgba(12, 31, 24, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 20px;
    z-index: 1000;
    border-radius: 20px;
    margin: 20px auto 32px;
    max-width: 1200px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled {
    top: 0;
    max-width: 100%;
    border-radius: 0;
    margin-top: 0;
    border-color: transparent transparent var(--border) transparent;
    background: rgba(12, 31, 24, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand a, .brand-login a {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.brand-name span {
    color: var(--primary);
}

.brand-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
}

.panel-name {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1px;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
    border: 1px solid transparent;
    white-space: nowrap;
}

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

.tab-btn.active {
    color: var(--primary);
    background: var(--glass);
    border-color: rgba(16, 185, 129, 0.2);
}

/* Requests Grid */
.requests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.card h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
    flex: 1;
}

.card-header .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    height: fit-content;
    width: fit-content;
    flex-shrink: 0;
    white-space: nowrap;
}

.status {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.status.awaiting_confirmation {
    background: rgba(249, 115, 22, 0.1);
    color: #fb923c;
}

.status.approved {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.status.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tables */
.table-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

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

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

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

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal {
    background: var(--card);
    padding: 32px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

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

.permissions-accordion {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

.perm-module-group {
    border-bottom: 1px solid var(--border);
}

.perm-module-group:last-child {
    border-bottom: none;
}

.perm-module-header {
    width: 100%;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.perm-module-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.perm-module-content {
    padding: 0 16px 8px;
    background: rgba(0, 0, 0, 0.1);
}

.perm-entity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.perm-entity-row:last-child {
    border-bottom: none;
}

.entity-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    min-width: 120px;
}

.actions-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.perm-inline-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.perm-inline-item:hover {
    color: var(--text);
}

.perm-inline-item input {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
    cursor: pointer;
}

.accordion-btn {
    background: rgba(255, 255, 255, 0.05);
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

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

.accordion-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.accordion-content {
    padding-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border);
    margin-top: 10px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.detail-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-box label {
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-bottom: 2px;
}

/* Integrated Invite Styles */
.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.user-main-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.invite-details-row td {
    border-bottom: 1px solid var(--border) !important;
}

.invite-details-row .label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 4px;
}

.objective-box {
    font-size: 0.85rem;
    background: rgba(245, 158, 11, 0.05);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    line-height: 1.5;
}

.tag-pill {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rejection-box {
    margin-top: 10px;
    font-size: 0.75rem;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    line-height: 1.4;
    width: 100%;
}

.rejection-box-title {
    color: #ef4444;
    text-transform: uppercase;
    font-size: 0.65rem;
    display: block;
    margin-bottom: 2px;
    font-weight: 700;
}

.invite-details-box {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2) !important;
    border-left: 4px solid var(--primary);
}

.code-snippet {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-sent {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.status-approved {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.plan-badge {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.plan-badge.free {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
}

.plan-badge.profissional {
    background: rgba(14, 165, 233, 0.1);
    color: #38bdf8;
}

.plan-badge.enterprise {
    background: rgba(168, 85, 247, 0.1);
    color: #c084fc;
}

/* FOOTER */
.app-footer {
    width: 100%;
    flex-shrink: 0;
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

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

.footer-links a i {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

/* Announcement Management Styles */
.ann-type-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.ann-type-icon.info {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
}

.ann-type-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.ann-type-icon.alert {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.ann-type-icon.doc {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.status.info {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.status.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.status.alert {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.status.doc {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
}