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

:root {
    /* Cores Primárias e Neutras */
    --ink: #1e2220;
    --muted: #64706b;
    --line: #e2ded8;
    --paper: #faf8f5;
    --panel: #ffffff;
    --field: #fdfdfb;
    --soft: #f2eee6;
    
    /* Cores de Acento */
    --accent: #b8996a;
    --accent-strong: #94774c;
    --accent-soft: #faf7f2;
    --accent-light: rgba(184, 153, 106, 0.08);
    
    /* Cores de Feedback */
    --sage: #3c6e64;
    --sage-light: #eff6f5;
    --gold: #ad7f3e;
    --danger: #b83d3d;
    --danger-light: #fdf2f2;
    --success: #296b52;
    --success-light: #eef7f4;
    --warning: #a86c22;
    --warning-light: #fef8ee;
    
    /* Raio de Borda */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 20px;
    
    /* Sombras e Efeitos */
    --shadow-sm: 0 2px 8px rgba(30, 34, 32, 0.04);
    --shadow-soft: 0 8px 24px rgba(30, 34, 32, 0.05);
    --shadow: 0 16px 40px rgba(30, 34, 32, 0.08);
    --shadow-lg: 0 24px 60px rgba(30, 34, 32, 0.12);
    --focus-ring: 0 0 0 4px rgba(184, 153, 106, 0.16);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset e Configurações Gerais */
* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--paper);
}
::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 999px;
    transition: var(--transition);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
textarea,
select {
    font: inherit;
}

/* Layout de Instalação e Login */
.install-body,
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 10% 20%, rgba(60, 110, 100, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(184, 153, 106, 0.06) 0%, transparent 45%),
        var(--paper);
}

.install-shell {
    width: min(980px, 100%);
}

.install-card,
.login-card {
    width: min(760px, 100%);
    margin: auto;
    padding: clamp(32px, 5vw, 56px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    transition: var(--transition);
}

.login-card {
    width: min(450px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-lg);
}

/* Tipografia */
.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0 0 24px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 500;
    line-height: 1.1;
    color: var(--ink);
}

h2 {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    font-weight: 500;
    line-height: 1.25;
}

h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Layout Administrativo */
.admin-body {
    min-height: 100vh;
    display: flex;
}

/* Sidebar Moderna */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 36px;
    padding: 32px 24px;
    color: #f7f6f2;
    background: #191c1a;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 1.1rem;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    color: #f7eedb;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.68);
    font-weight: 600;
    background: transparent;
    transition: var(--transition);
}

.sidebar-nav a svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    transition: var(--transition);
}

.sidebar-nav a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav a.active {
    color: #ffffff;
    background: var(--accent);
    box-shadow: 0 4px 12px rgba(184, 153, 106, 0.25);
    font-weight: 600;
}

.sidebar-nav a.active svg {
    stroke: #ffffff;
}

.sidebar-user {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
    color: var(--accent-soft);
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-details strong {
    font-size: 0.9rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-details small {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.sidebar-logout-btn:hover {
    color: #ff8b8b;
    background: rgba(230, 75, 75, 0.08);
    border-color: rgba(230, 75, 75, 0.15);
}

/* Área de Conteúdo Principal */
.admin-main {
    margin-left: 280px;
    flex: 1;
    min-height: 100vh;
    padding: clamp(24px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Topbar & Headers */
.topbar,
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar h1,
.panel-header h2 {
    margin: 0;
}

.topbar-actions,
.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Grid de Estatísticas Premium */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    min-height: 128px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--muted);
    opacity: 0.3;
}

.stat-card:nth-child(1)::after { background: var(--accent); opacity: 0.8; }
.stat-card:nth-child(2)::after { background: var(--sage); opacity: 0.8; }
.stat-card:nth-child(3)::after { background: var(--gold); opacity: 0.8; }
.stat-card:nth-child(4)::after { background: var(--success); opacity: 0.8; }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: rgba(30, 34, 32, 0.12);
}

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

.stat-card strong {
    color: var(--ink);
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    margin-top: 10px;
}

.stat-icon-wrapper {
    position: absolute;
    right: 20px;
    bottom: 20px;
    color: var(--muted);
    opacity: 0.15;
    pointer-events: none;
}

.stat-icon-wrapper svg {
    width: 44px;
    height: 44px;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
}

/* Painéis (Cards Principais) */
.panel {
    padding: clamp(24px, 3.5vw, 36px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    position: relative;
}

.panel-header {
    border-bottom: 1px solid var(--line);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

/* Split Layout */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 28px;
    align-items: start;
}

.gallery-editor-layout {
    grid-template-columns: 1.4fr 0.8fr;
}

/* Standardize client-layout columns to match standard split-layout ratio */
.client-layout {
    grid-template-columns: 1fr 1.3fr;
}

.wide-panel {
    min-width: 0;
}

.link-panel {
    display: grid;
    gap: 20px;
}

.form-grid,
.stack {
    display: grid;
    gap: 20px;
}

.form-stack {
    display: grid;
    gap: 28px;
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.field-grid.two-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full,
.field-grid .full,
.button.full,
.notice {
    grid-column: 1 / -1;
}

.form-section {
    display: grid;
    gap: 20px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.form-section:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.form-section-header {
    display: grid;
    gap: 6px;
}

.form-section-header h3 {
    font-size: 1.05rem;
    color: var(--ink);
}

.form-section-header p,
.panel-subtitle,
.upload-note,
.field-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.panel-subtitle {
    max-width: 760px;
    margin-top: 8px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.form-actions .button {
    min-width: 160px;
}

/* Configurações da Galeria (Grid de Escolhas) */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.choice-card {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 14px;
    background: var(--field);
    cursor: pointer;
    transition: var(--transition);
}

.choice-card:hover {
    border-color: var(--accent);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.choice-card:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: var(--shadow-sm);
}

.choice-card:has(input:checked):hover {
    background: var(--accent-light);
}

.choice-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-check,
.background-check {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 2px solid #c9c3b8;
    border-radius: 5px;
    background: #ffffff;
    margin-top: 0;
    transition: var(--transition);
}

.choice-check::after,
.background-check::after {
    content: "";
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    opacity: 0;
    transform: rotate(45deg) translate(-0.5px, -0.5px);
    transition: var(--transition);
}

.choice-card input:checked + .choice-check,
.background-choice input:checked + .background-check {
    border-color: var(--accent);
    background: var(--accent);
}

.choice-card input:focus-visible + .choice-check,
.background-choice input:focus-visible + .background-check {
    box-shadow: var(--focus-ring);
}

.choice-card input:checked + .choice-check::after,
.background-choice input:checked + .background-check::after {
    opacity: 1;
}

.choice-copy,
.background-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.choice-copy strong,
.background-copy strong {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}

.choice-copy small,
.background-copy small {
    display: none;
}

/* Campos de Formulários Premium */
label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label span {
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input,
textarea,
select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--ink);
    background: var(--field);
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364706b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

textarea {
    resize: vertical;
    line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
    background: var(--panel);
}

/* Botões Modernos */
.button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 12px 20px;
    color: var(--ink);
    background: var(--soft);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92rem;
    text-align: center;
    transition: var(--transition);
    user-select: none;
}

.button:hover {
    background: var(--line);
    transform: translateY(-1px);
}

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

.button.primary {
    color: #ffffff;
    background: var(--accent);
    box-shadow: 0 4px 14px rgba(184, 153, 106, 0.15);
}

.button.primary:hover {
    background: var(--accent-strong);
    box-shadow: 0 6px 20px rgba(184, 153, 106, 0.25);
}

.button.ghost {
    border-color: var(--line);
    background: transparent;
    color: var(--ink);
}

.button.ghost:hover {
    background: var(--paper);
    border-color: var(--muted);
}

.button.danger {
    color: #ffffff;
    background: var(--danger);
    box-shadow: 0 4px 14px rgba(184, 61, 61, 0.15);
}

.button.danger:hover {
    background: #9b3131;
    box-shadow: 0 6px 20px rgba(184, 61, 61, 0.25);
}

.button:disabled,
.button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.button.small {
    min-height: 36px;
    padding: 8px 14px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.button-row,
.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.actions {
    justify-content: flex-end;
}

.actions form {
    margin: 0;
    display: inline-block;
}

/* Alertas e Notificações (Notice) */
.notice {
    margin-bottom: 24px;
    border-radius: var(--radius);
    padding: 16px 20px;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid var(--line);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notice::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.notice.success {
    border-color: rgba(41, 107, 82, 0.2);
    color: var(--success);
    background: var(--success-light);
}

.notice.success::before {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23296b52' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpath d='m9 11 3 3L22 4'/%3E%3C/svg%3E");
}

.notice.danger {
    border-color: rgba(184, 61, 61, 0.2);
    color: var(--danger);
    background: var(--danger-light);
}

.notice.danger::before {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b83d3d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' x2='12' y1='8' y2='12'/%3E%3Cline x1='12' x2='12.01' y1='16' y2='16'/%3E%3C/svg%3E");
}

.notice.warning {
    border-color: rgba(168, 108, 34, 0.2);
    color: var(--warning);
    background: var(--warning-light);
}

.notice.warning::before {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a86c22' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z'/%3E%3Cline x1='12' x2='12' y1='9' y2='13'/%3E%3Cline x1='12' x2='12.01' y1='17' y2='17'/%3E%3C/svg%3E");
}

/* Requisitos do Sistema */
.requirements {
    display: grid;
    gap: 12px;
    padding: 0;
    margin: 0 0 24px;
    list-style: none;
}

.requirements li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    transition: var(--transition);
}

.requirements li small {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 0.82rem;
}

.requirements .ok {
    border-color: rgba(41, 107, 82, 0.15);
    background: var(--success-light);
}
.requirements .ok strong {
    color: var(--success);
}

.requirements .bad {
    border-color: rgba(184, 61, 61, 0.15);
    background: var(--danger-light);
}
.requirements .bad strong {
    color: var(--danger);
}

/* Tabelas Premium */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

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

th {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--paper);
}

td strong {
    font-size: 0.95rem;
    color: var(--ink);
}

td small {
    display: block;
    max-width: 420px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--paper);
}

/* Badges e Pills */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.76rem;
    font-weight: 700;
}

.pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.pill.good {
    color: var(--success);
    background: var(--success-light);
}

.pill.muted {
    color: var(--muted);
    background: var(--soft);
}

/* Estado Vazio (Empty State) */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 240px;
    border: 2px dashed var(--line);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    background: var(--paper);
    transition: var(--transition);
}

.empty-state h3 {
    margin: 0;
    color: var(--muted);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Toggles e Chaves */
.toggle-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.toggle {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 16px;
    background: var(--panel);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.toggle:hover {
    border-color: var(--accent);
    background: var(--field);
}

.toggle input {
    width: 18px;
    min-height: 18px;
    accent-color: var(--accent);
    margin: 0;
    cursor: pointer;
}

.toggle span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
}

.toggle.compact {
    min-height: 40px;
    padding: 8px 12px;
}

/* Área de Upload Premium */
.upload-box {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: stretch;
}

.dropzone {
    position: relative;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px dashed #b8b1a2;
    border-radius: var(--radius);
    padding: 36px 24px;
    text-align: center;
    background: linear-gradient(135deg, rgba(60, 110, 100, 0.05), transparent 45%), var(--field);
    cursor: pointer;
    transition: var(--transition);
}

.dropzone:hover,
.dropzone.is-dragging {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(184, 153, 106, 0.08), transparent 45%), var(--panel);
    box-shadow: var(--focus-ring);
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 1px;
    border: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.dropzone-kicker {
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dropzone strong {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    font-weight: 500;
    color: var(--ink);
}

.dropzone small {
    max-width: 380px;
    color: var(--muted);
    line-height: 1.5;
    font-size: 0.85rem;
}

.upload-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 0 10px;
}

.upload-queue {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.upload-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--panel);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.upload-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.upload-item strong {
    font-size: 0.9rem;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-item small,
.upload-percent {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.upload-progress {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--soft);
}

.upload-progress span {
    height: 100%;
    display: block;
    border-radius: inherit;
    background: var(--sage);
    transition: width 0.2s ease;
}

.upload-item.is-done {
    border-color: rgba(41, 107, 82, 0.2);
    background: var(--success-light);
}

.upload-item.is-done .upload-percent {
    color: var(--success);
}

.upload-item.is-error {
    border-color: rgba(184, 61, 61, 0.25);
    background: var(--danger-light);
}

.upload-item.is-error .upload-progress span {
    background: var(--danger);
}

.upload-item.is-error .upload-percent {
    color: var(--danger);
    font-weight: 700;
}

/* Grid Administrativo de Fotos */
.photo-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.photo-admin-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.photo-admin-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.photo-admin-card.is-dragging {
    opacity: 0.4;
    transform: scale(0.97);
}

.photo-card-toolbar {
    position: absolute;
    z-index: 2;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
}

.drag-handle,
.order-badge {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 99px;
    color: #ffffff;
    background: rgba(25, 28, 26, 0.75);
    backdrop-filter: blur(8px);
    font-size: 0.74rem;
    font-weight: 800;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.drag-handle {
    padding: 6px 12px;
    cursor: grab;
    pointer-events: auto;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.order-badge {
    min-width: 30px;
}

.photo-admin-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--soft);
    border-bottom: 1px solid var(--line);
}

.photo-admin-meta,
.photo-admin-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.photo-admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 0;
}

.background-choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    background: var(--field);
    cursor: pointer;
    transition: var(--transition);
    height: 100%;
}

.background-choice:hover {
    border-color: var(--accent);
    background: var(--panel);
}

.background-choice:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.background-choice:has(input:checked):hover {
    background: var(--accent-light);
}

.background-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Salvamento Fixo */
.sticky-save {
    margin-top: 32px;
}

.hidden-form {
    display: none;
}

/* Copiar link box */
.copy-field {
    font-family: monospace;
    font-size: 0.88rem;
    background: var(--soft);
    color: var(--accent-strong);
    border-color: var(--line);
    cursor: copy;
}

/* Responsividade (Telas médias e móveis) */
@media (max-width: 1080px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .admin-body {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding: 24px;
        gap: 20px;
    }

    .sidebar-nav {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .sidebar-nav a {
        justify-content: center;
        padding: 10px;
        font-size: 0.85rem;
    }

    .sidebar-user {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding-top: 16px;
    }
    
    .sidebar-logout-btn {
        margin-left: auto;
    }

    .admin-main {
        margin-left: 0;
        padding: 24px;
    }

    .split-layout,
    .gallery-editor-layout,
    .client-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .install-body,
    .login-body {
        padding: 16px;
    }
    
    .install-card,
    .login-card {
        padding: 24px;
    }

    .admin-main {
        padding: 16px;
        gap: 24px;
    }

    .sidebar {
        padding: 16px;
    }

    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .sidebar-user {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .sidebar-logout-btn {
        width: 100%;
    }

    .topbar,
    .panel-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    
    .topbar-actions,
    .panel-header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-grid,
    .field-grid,
    .choice-grid,
    .toggle-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .upload-box {
        grid-template-columns: 1fr;
    }
    
    .upload-side {
        padding: 0;
    }

    .actions {
        justify-content: flex-start;
    }

    .button,
    .button-row .button {
        width: 100%;
    }

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

/* Requisitos do Instalador */
.requirements {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.requirements li {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 4px 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: var(--field);
    border: 1px solid var(--line);
    transition: var(--transition);
}

.requirements li:hover {
    border-color: var(--accent);
    background: var(--panel);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.requirements li span {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ink);
}

.requirements li strong {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 999px;
}

.requirements li.ok strong {
    color: var(--success);
    background: var(--success-light);
}

.requirements li.bad strong {
    color: var(--danger);
    background: var(--danger-light);
}

.requirements li small {
    grid-column: 1 / -1;
    font-size: 0.78rem;
    color: var(--muted);
}

/* Modais de Confirmação Customizados */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(30, 34, 32, 0.45);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 24px;
}

.confirm-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.confirm-modal-box {
    width: min(440px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.96) translateY(12px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-modal-overlay.open .confirm-modal-box {
    transform: scale(1) translateY(0);
}

.confirm-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.confirm-modal-icon {
    color: var(--danger);
    flex-shrink: 0;
}

.confirm-modal-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.45rem;
    font-weight: 500;
    color: var(--ink);
    margin: 0;
}

.confirm-modal-body {
    margin-bottom: 24px;
}

.confirm-modal-body p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.confirm-modal-actions .button {
    min-width: 110px;
}

/* Delete-all modal body variant */
.modal-delete-warning {
    display: grid;
    gap: 10px;
}

.modal-delete-count {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--danger);
    letter-spacing: -0.02em;
}

.modal-delete-sub {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Progress bar inside confirm modal */
.modal-progress-label {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-progress-pct {
    margin: 10px 0 0;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--danger);
    transition: color 0.3s;
}

/* Upload de Arquivo Modernizado (Painel de Configurações) */
.file-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.file-upload-trigger {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    color: var(--ink);
    background: var(--panel);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition);
    user-select: none;
    box-shadow: var(--shadow-sm);
}

.file-upload-trigger:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.file-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.file-upload-name {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 500;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Botão Moderno de Exclusão de Logotipos */
.delete-logo-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(184, 61, 61, 0.16);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    color: var(--danger);
    background: var(--danger-light);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition);
    user-select: none;
    margin-top: 4px;
}

.delete-logo-btn:hover {
    background: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(184, 61, 61, 0.15);
}

/* Paginação no Painel Admin */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 20px 0;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 6px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink);
    background: var(--panel);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
}

.page-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
    background: var(--paper);
}

.page-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    cursor: default;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(184, 153, 106, 0.25);
}

.page-dots {
    color: var(--muted);
    font-weight: 700;
    padding: 0 4px;
}

