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

:root {
    /* Color System - Premium Dark (Kinghost Style) */
    --bg-main: #13131a;
    --bg-gradient: radial-gradient(circle at top right, #1c1c26 0%, var(--bg-main) 60%);
    
    --card-bg: #1c1c26;
    --card-border: hsla(0, 0%, 100%, 0.04);
    --card-hover-border: hsla(0, 0%, 100%, 0.1);
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    
    --accent: #f7b731; /* Amarelo da Logo */
    --accent-glow: hsla(43, 93%, 58%, 0.25);
    
    --error: #ff4757;
    --success: #2ed573;
    
    /* Typography */
    --font-heading: 'Outfit', -apple-system, system-ui, sans-serif;
    --font-body: 'Inter', -apple-system, system-ui, sans-serif;
    
    --bg-secondary: #181822;
    --bg-tertiary: #1f1f2e;
    --overlay-light: hsla(0, 0%, 100%, 0.03);
    --overlay-medium: hsla(0, 0%, 100%, 0.08);
    --border-light: hsla(0, 0%, 100%, 0.05);
    --border-medium: hsla(0, 0%, 100%, 0.1);
    --border-strong: hsla(0, 0%, 100%, 0.2);
    
    /* Effects */
    --glass-blur: 16px;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-premium: 0 16px 32px hsla(0, 0%, 0%, 0.3);
    
    --thumb-size: 250px;
}

:root[data-theme="light"] {
    --bg-main: hsl(210, 20%, 98%);
    --bg-gradient: radial-gradient(circle at top right, hsl(0, 0%, 100%) 0%, var(--bg-main) 60%);
    --bg-secondary: hsl(0, 0%, 100%);
    --bg-tertiary: hsl(0, 0%, 96%);
    
    --card-bg: hsla(0, 0%, 100%, 1);
    --card-border: hsla(240, 10%, 10%, 0.1);
    --card-hover-border: hsla(240, 10%, 10%, 0.2);
    
    --text-primary: hsl(240, 10%, 10%);
    --text-secondary: hsl(240, 4%, 40%);
    --text-muted: hsl(240, 4%, 60%);
    
    --accent: hsl(215, 85%, 45%); /* Azul ZELPIXEL Light */
    --accent-glow: hsla(215, 85%, 45%, 0.2);
    
    --border-light: hsla(0, 0%, 0%, 0.05);
    --border-medium: hsla(0, 0%, 0%, 0.1);
    --border-strong: hsla(0, 0%, 0%, 0.2);
    --overlay-light: hsla(0, 0%, 0%, 0.03);
    --overlay-medium: hsla(0, 0%, 0%, 0.08);
    
    --shadow-premium: 0 10px 30px hsla(240, 10%, 10%, 0.08);
}

/* Base Styles & Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Logos */
.sys-logo {
    height: 32px;
    filter: brightness(0) invert(1);
}
.logo-img {
    filter: brightness(0) invert(1);
}

:root[data-theme="light"] .sys-logo, :root[data-theme="light"] .logo-img {
    filter: brightness(0);
}

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

body {
    background: var(--bg-gradient);
    background-color: var(--bg-main);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    animation: fadeIn 1s ease-out;
}

.container {
    max-width: 1300px; /* Slightly wider for modern look */
    margin: 0 auto;
    padding: 1.5rem 2rem;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.container.app-shell-container {
    max-width: 100%; /* dashboard ocupa a tela toda, como era no personal_dashboard.php original */
}

@media (max-width: 768px) {
    .container { padding: 2rem 1.2rem; }
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    background: var(--bg-main);
}

.auth-visual {
    flex: 1 1 50%;
    position: relative;
    background-size: cover;
    background-position: center center;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-direction: column;
    padding: 3rem;
}

.auth-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, hsla(240, 15%, 6%, 0.35) 0%, hsla(240, 15%, 6%, 0.08) 50%, hsla(240, 15%, 6%, 0.28) 100%);
}

.auth-form-panel {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-form-panel .auth-card {
    background: transparent;
    box-shadow: none;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 2rem 1rem;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 900px) {
    .auth-visual { display: none; }
    .auth-form-panel { flex: 1 1 100%; }
}

.admin-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr); /* Slightly narrower sidebar to save space */
    gap: 2rem;
    min-height: 80vh;
}

@media (max-width: 900px) {
    .admin-layout, .cockpit-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.admin-sidebar {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--card-border);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.nav-item {
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    background: hsla(0, 0%, 100%, 0.03);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: hsla(43, 93%, 58%, 0.06);
    color: var(--accent);
    font-weight: 700;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--accent-glow);
}

.admin-content {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: 24px;
    padding: 2.5rem; /* Reduced default padding */
    border: 1px solid var(--card-border);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards;
    overflow: hidden;
}

@media (max-width: 1200px) {
    .admin-content { padding: 1.5rem; } /* Further reduced for tablets */
}

/* ============================================
   App Shell — sidebar/topbar compartilhados
   (app_header.php / app_nav.php / app_footer.php)
   ============================================ */

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.app-topbar-title h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.app-menu-toggle {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.app-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.app-quick-links {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 0.7rem 1.1rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.action-btn:hover {
    background: var(--accent);
    color: var(--bg-main);
    transform: translateY(-2px);
    border-color: var(--accent);
}

.action-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

@media (max-width: 600px) {
    .app-quick-links .action-btn span.label { display: none; }
}

.app-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.app-sidebar {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: 20px;
    padding: 1rem 1.5rem 1.5rem;
    border: 1px solid var(--card-border);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.app-nav {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.app-content {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards;
}

@media (max-width: 1200px) {
    .app-content { padding: 1.5rem; }
}

.app-sidebar-backdrop {
    display: none;
}

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; gap: 1.5rem; }

    .app-menu-toggle { display: flex; }

    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 260px;
        max-width: 80vw;
        border-radius: 0;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    .app-sidebar.open { transform: translateX(0); }

    .app-sidebar-backdrop.open {
        display: block;
        position: fixed;
        inset: 0;
        background: hsla(0, 0%, 0%, 0.5);
        z-index: 199;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-link {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.page-link:hover, .page-link.active {
    background: var(--accent);
    color: black;
    border-color: var(--accent);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    table-layout: auto;
}

table tr td:last-child, table tr th:last-child {
    padding-right: 1.5rem; /* Extra breathing room for the Açao column */
}

th, td {
    padding: 1rem 0.8rem; /* Slightly reduced horizontal padding */
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

@media (max-width: 1200px) {
    th, td { padding: 0.8rem 0.6rem; }
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    padding: 2.5rem 3rem 3rem;
    border-radius: 32px;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--card-border);
    text-align: center;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card .logo-img {
    max-width: 180px;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
}

.auth-card h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.auth-card p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .auth-card { padding: 2rem 1.5rem; }
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
    position: relative;
    width: 100%;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-icon > svg {
    position: absolute;
    left: 1.2rem;
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 10;
}

.input-with-icon input {
    width: 100%;
    padding: 1.2rem 1.5rem 1.2rem 3.5rem;
    height: 64px;
    background: hsla(0, 0%, 100%, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.input-with-icon input::placeholder {
    color: var(--text-muted);
}

.password-toggle {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-smooth);
    z-index: 10;
    width: 44px;
    height: 44px;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    position: static; /* Force override of any absolute positioning */
}

.password-toggle:hover {
    color: var(--text-primary);
}

label.input-label {
    position: absolute;
    top: -10px;
    left: 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-main);
    padding: 0 0.5rem;
    z-index: 5;
    pointer-events: none;
}

input:focus {
    outline: none;
    border-color: hsla(0, 0%, 100%, 0.3);
    background: hsla(0, 0%, 100%, 0.05);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.btn {
    width: 100%;
    padding: 1.2rem;
    background: var(--accent);
    color: var(--bg-main);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px hsla(0, 0%, 100%, 0.15);
}

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

.btn-secondary {
    background: hsla(0, 0%, 100%, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: hsla(0, 0%, 100%, 0.1);
}

.error-msg {
    color: var(--error);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Dashboard Styling */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 3rem;
}

@media (max-width: 600px) {
    header { flex-direction: column; gap: 1.5rem; text-align: center; }
}

.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

/* Dashboard Selection Cards */
.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

.gallery-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition-smooth);
    border: 1px solid var(--card-border);
    text-decoration: none;
    color: inherit;
    display: block;
}

.gallery-card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: var(--card-hover-border);
    box-shadow: var(--shadow-premium);
}

.gallery-card-cover {
    width: 100%;
    aspect-ratio: 16/10;
    background: hsl(240, 10%, 8%);
    overflow: hidden;
    position: relative;
}

.gallery-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: var(--transition-smooth);
}

.gallery-card:hover .gallery-card-cover img {
    opacity: 1;
    transform: scale(1.05);
}

.gallery-card-info {
    padding: 1.8rem;
}

.gallery-card-info h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Zoomable Gallery Grid */
.gallery-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--thumb-size), 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.gallery-item-detailed {
    width: 100%;
}

.media-wrapper {
    width: 100%;
    aspect-ratio: auto;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-wrapper img, .media-wrapper video {
    max-width: 100%;
    max-height: 1000px;
    height: auto;
    object-fit: contain;
}

.media-info {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.media-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.download-link {
    width: 32px;
    height: 32px;
    background: var(--border-medium);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white; /* Always white icons as requested */
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .download-link { display: none !important; }
}

.download-link svg {
    width: 16px;
    height: 16px;
}

.download-link:hover {
    background: white;
    color: black;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--border-strong);
}

.download-link span { display: none; } /* Remove text if it exists */

/* Gallery Hero Section */
.gallery-hero {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 400px;
    position: relative;
    overflow: hidden;
    margin-bottom: -150px;
    z-index: -1;
}

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Foco padrão: um pouco abaixo do topo, pra pegar o rosto/olhos em retratos
       (o hero tem margin-bottom negativo, então a parte visível é a de cima). */
    object-position: center 55%;
    transition: object-position 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    filter: brightness(0.7) saturate(1.1);
}
/* .hero-bg.loaded can be used for extra effects if needed */

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0) 0%, 
        rgba(0,0,0,0) 40%, 
        rgba(0,0,0,0.2) 60%, 
        rgba(0,0,0,0.8) 85%, 
        var(--bg-main) 95%,
        var(--bg-main) 100%
    );
}

/* Slider Style */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-tertiary);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-strong);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: #333;
    height: 4px;
    border-radius: 2px;
    width: 150px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: var(--accent);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
}

/* --- Antigravity Multi-Account Cockpit Styles --- */
.cockpit-header {
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.1) 0%, rgba(156, 39, 176, 0.1) 100%);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid var(--border-medium);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cockpit-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(to right, #00BCD4, #9C27B0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

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

.cockpit-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.cockpit-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.cockpit-val {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0.5rem 0;
    font-family: 'Outfit', sans-serif;
}

.cockpit-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
    opacity: 0.5;
}

.progress-bar {
    height: 8px;
    background: var(--border-medium);
    border-radius: 4px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #00BCD4, #9C27B0);
    border-radius: 4px;
    transition: width 1s ease-out;
}

.cockpit-activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-medium);
}

.cockpit-activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-details {
    flex: 1;
}

.activity-user {
    font-size: 0.85rem;
    font-weight: 700;
}

.activity-text {
    font-size: 0.75rem;
    opacity: 0.6;
}

.btn-cockpit {
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.btn-cockpit:hover {
    background: var(--accent);
    color: black;
    border-color: var(--accent);
}

.featured-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent);
    color: black;
    padding: 0.2rem 0.6rem;
    font-size: 0.6rem;
    font-weight: 800;
    border-radius: 4px;
    text-transform: uppercase;
}
/* Selection Mode Styles */
.gallery-item-detailed {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
    animation: fadeIn 0.8s ease-out backwards;
}

.gallery-item-detailed.selected .media-wrapper {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.gallery-item-detailed.selected .media-wrapper img {
    filter: brightness(0.7);
}

.selection-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.8);
    border-radius: 50%;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item-detailed.selected .selection-indicator {
    background: #007AFF; /* iOS Blue */
    border-color: #007AFF;
    transform: scale(1.1);
}

.selection-indicator svg {
    width: 16px;
    height: 16px;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.gallery-item-detailed.selected .selection-indicator svg {
    opacity: 1;
    transform: scale(1);
}

/* Floating Selection Bar */
.selection-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: calc(100% - 4rem);
    max-width: 800px;
    background: hsla(240, 10%, 4%, 0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 1.2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border: 1px solid var(--card-border);
    border-radius: 100px;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 30px 60px hsla(0, 0%, 0%, 0.8);
}

.selection-bar.active {
    transform: translateY(0);
}

.selection-info {
    display: flex;
    flex-direction: column;
}

.selection-count {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.selection-sub {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

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

@media (max-width: 600px) {
    .selection-bar {
        flex-direction: column;
        gap: 1.2rem;
        padding: 1.5rem 1rem;
        text-align: center;
        border-radius: 20px;
        bottom: 1rem;
        width: calc(100% - 2rem);
    }
    
    .selection-info {
        align-items: center;
    }
    
    .selection-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .selection-actions .btn {
        flex: 1 1 45%;
        font-size: 0.65rem;
        padding: 0.6rem 0.3rem;
        min-width: 100px;
    }
}

/* Share Button Styles */
.share-btn {
    width: 32px;
    height: 32px;
    background: var(--border-medium);
    border-radius: 50%;
    display: flex; /* Always flex for user feedback */
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-medium);
    flex-shrink: 0;
}

.share-btn svg {
    width: 16px;
    height: 16px;
}

.share-btn:hover {
    background: var(--accent);
    color: black;
    transform: translateY(-2px);
}
/* Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
    border-radius: 8px;
}

.table-responsive table { margin-top: 0; }

/* Admin Action Buttons */
.btn-admin {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: hsla(0, 0%, 100%, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-heading);
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.btn-admin:hover {
    background: var(--text-primary);
    color: var(--bg-main);
    border-color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px hsla(0, 0%, 0%, 0.3);
}

.btn-admin svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Standard Admin Forms */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    opacity: 0.6;
}

.form-control {
    width: 100%;
    background: var(--overlay-light);
    border: 1px solid var(--overlay-medium);
    border-radius: 8px;
    padding: 0.9rem 1.2rem;
    color: white;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 4px rgba(255,193,7,0.05);
}

.form-control::placeholder {
    color: rgba(255,255,255,0.15);
}

select.form-control {
    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='white' 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: 1rem;
    padding-right: 3rem;
    cursor: pointer;
}

/* O popup nativo do <select> herda color:white da .form-control mas abre com
   fundo claro do sistema — sem cor explícita, o texto some (branco no branco).
   Damos às opções o mesmo tom escuro dos cards pra combinar com o tema. */
select.form-control option {
    color: #f2f2f5;
    background: #1f1f2e;
}
:root[data-theme="light"] select.form-control option {
    color: #111;
    background: #fff;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Custom Confirmation Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--bg-tertiary);
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid var(--border-medium);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    text-align: center;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-icon {
    width: 60px;
    height: 60px;
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    color: white;
}

.modal-text {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-modal-confirm {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-cancel {
    background: var(--border-light);
    color: white;
    border: 1px solid var(--border-medium);
    padding: 0.8rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-confirm:hover { background: #c0392b; transform: translateY(-2px); }
.btn-modal-cancel:hover { background: var(--border-medium); transform: translateY(-2px); }
/* Dashboard Widgets */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .dash-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .dash-grid { grid-template-columns: 1fr; }
}

.widget {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.widget-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.edit-task-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    background: hsla(0, 0%, 100%, 0.03);
    border-radius: 12px;
    margin-bottom: 0.8rem;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
}

.edit-task-item:hover {
    background: hsla(0, 0%, 100%, 0.06);
    transform: translateX(5px);
    border-color: var(--card-hover-border);
}

.task-img {
    width: 48px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.task-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.task-meta {
    font-size: 0.75rem;
    opacity: 0.6;
}

.status-badge {
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}

.status-pending { background: rgba(243, 156, 18, 0.15); color: #f39c12; }
.status-editing { background: rgba(52, 152, 219, 0.15); color: #3498db; }
.status-completed { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }

.todoist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-light);
}

.todoist-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-strong);
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 2px;
}

.todoist-checkbox.checked {
    background: var(--accent);
    border-color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.todoist-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.notes-area {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    resize: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 0.5rem;
}

.notes-area:focus { outline: none; }

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-card {
    background: hsla(0, 0%, 100%, 0.03);
    border: 1px solid var(--card-border);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.7rem;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

/* Solid Status Badges for Tables */
.badge-status {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border-radius: 30px;
    font-size: 0.65rem;
    font-weight: 800;
    white-space: nowrap;
    text-align: center;
    color: #fff;
    line-height: 1;
}
