/**
 * CEC Assessoria Imobiliaria — Estilos do Painel Administrativo
 */

:root {
    --adm-wine: #4a1022;
    --adm-wine-dark: #260812;
    --adm-gold: #d4af37;
    --adm-gold-light: #f5e4ab;
    --adm-cream: #f6f2f3;
    --adm-ink: #2b1f24;
    --adm-muted: #74676c;
    --adm-line: #e5dade;
    --adm-white: #ffffff;
    --adm-success: #198754;
    --adm-warning: #d9822b;
    --adm-danger: #b02a37;
    --adm-shadow: 0 8px 26px rgba(42, 10, 20, 0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--adm-ink);
    background-color: var(--adm-cream);
    min-height: 100vh;
}

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

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

/* Login View (Demo Mode) */
.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(38, 8, 18, 0.96), rgba(101, 13, 41, 0.92)),
                url('https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1600&q=80') center/cover;
    padding: 20px;
}

.login-card {
    width: min(440px, 100%);
    background: var(--adm-white);
    padding: 38px;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.login-card .logo-area {
    text-align: center;
    margin-bottom: 24px;
}

.login-card img {
    height: 58px;
    margin: 0 auto;
}

.login-badge {
    display: inline-block;
    background: #f4e8c9;
    color: #75540f;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 12px;
}

.login-card h1 {
    font-family: Georgia, serif;
    color: var(--adm-wine);
    font-size: 28px;
    margin: 12px 0 6px;
}

.login-card p {
    color: var(--adm-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.login-form {
    display: grid;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #55444b;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--adm-line);
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--adm-wine);
    outline: none;
}

.btn-adm {
    border: 0;
    background: var(--adm-wine);
    color: #fff;
    padding: 12px 18px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-adm:hover {
    background: #340916;
}

.btn-adm-gold {
    background: var(--adm-gold);
    color: #382500;
}
.btn-adm-gold:hover {
    background: #dfbe4a;
}

.btn-adm-outline {
    background: transparent;
    border: 1px solid var(--adm-line);
    color: var(--adm-ink);
}
.btn-adm-outline:hover {
    background: #f0e6e9;
}

.btn-adm-danger {
    background: #fdf2f2;
    color: var(--adm-danger);
    border: 1px solid #f8d7da;
}
.btn-adm-danger:hover {
    background: var(--adm-danger);
    color: #fff;
}

.login-card small {
    display: block;
    margin-top: 16px;
    color: var(--adm-muted);
    font-size: 12px;
    text-align: center;
}

/* Admin Dashboard Layout */
.admin-app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--adm-wine-dark);
    color: #fff;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    background: #fff;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 24px;
    text-align: center;
}

.sidebar-brand img {
    height: 44px;
    margin: 0 auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #ded0d4;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(212, 175, 55, 0.16);
    color: #fff;
}

.nav-item.active {
    border-left: 3px solid var(--adm-gold);
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-view-site {
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.btn-view-site:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Main Area */
.admin-main {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    height: 72px;
    background: var(--adm-white);
    border-bottom: 1px solid var(--adm-line);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle-btn {
    display: none;
    background: none;
    border: 0;
    font-size: 24px;
    color: var(--adm-wine);
    cursor: pointer;
}

.topbar-title h2 {
    font-size: 22px;
    color: var(--adm-wine);
    margin: 0;
}

.topbar-title small {
    color: var(--adm-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--adm-wine);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
}

.admin-content {
    padding: 32px;
    flex: 1;
}

/* Tabs & Panels */
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

/* Dashboard Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--adm-white);
    padding: 24px;
    border-radius: 8px;
    border: 1px solid var(--adm-line);
    box-shadow: var(--adm-shadow);
    display: flex;
    flex-direction: column;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--adm-muted);
    font-size: 13px;
    font-weight: 600;
}

.stat-icon {
    font-size: 20px;
}

.stat-number {
    font-family: Georgia, serif;
    font-size: 38px;
    color: var(--adm-wine);
    margin-top: 10px;
    font-weight: 700;
}

/* Content Columns in Dashboard */
.dash-cols {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 24px;
}

.box-card {
    background: var(--adm-white);
    padding: 24px;
    border-radius: 8px;
    border: 1px solid var(--adm-line);
    box-shadow: var(--adm-shadow);
    margin-bottom: 24px;
}

.box-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--adm-line);
}

.box-card-header h3 {
    font-size: 18px;
    color: var(--adm-wine);
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid var(--adm-line);
}

.adm-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
    font-size: 13px;
    background: #fff;
}

.adm-table th,
.adm-table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--adm-line);
}

.adm-table th {
    background: #fbf7f8;
    color: #614f55;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.adm-table tbody tr:hover {
    background: #fdfafb;
}

.prop-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.prop-cell-img {
    width: 58px;
    height: 46px;
    border-radius: 4px;
    object-fit: cover;
}

.prop-cell-title {
    font-weight: 700;
    color: var(--adm-wine);
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prop-cell-code {
    font-size: 11px;
    color: var(--adm-muted);
}

.pill-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.pill-venda {
    background: #fde8e9;
    color: var(--adm-wine);
}

.pill-locacao {
    background: #e7f5ea;
    color: var(--adm-success);
}

.pill-status-pub {
    background: #d1e7dd;
    color: #0f5132;
}

.pill-status-res {
    background: #fff3cd;
    color: #664d03;
}

.action-btns {
    display: flex;
    gap: 6px;
}

.btn-icon {
    border: 1px solid var(--adm-line);
    background: #fff;
    color: var(--adm-ink);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.btn-icon:hover {
    background: #f3ebed;
    color: var(--adm-wine);
}

/* Modal Drawer for Create/Edit Property */
.adm-drawer {
    position: fixed;
    inset: 0;
    background: rgba(20, 3, 9, 0.6);
    backdrop-filter: blur(4px);
    z-index: 300;
    display: none;
    justify-content: flex-end;
}

.adm-drawer.open {
    display: flex;
}

.drawer-panel {
    width: min(720px, 100vw);
    height: 100%;
    background: var(--adm-white);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0,0,0,0.3);
}

.drawer-panel-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--adm-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-panel-header h3 {
    font-size: 22px;
    color: var(--adm-wine);
}

.drawer-panel-close {
    background: none;
    border: 0;
    font-size: 28px;
    color: var(--adm-wine);
    cursor: pointer;
}

.drawer-panel-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.drawer-panel-footer {
    padding: 18px 28px;
    border-top: 1px solid var(--adm-line);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #fdfafb;
}

/* Form Sections */
.form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1eaed;
}

.form-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--adm-wine);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

/* Feature Checkboxes in Property Form */
.features-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    background: #fbf8f9;
}

/* Gallery Manager in Drawer */
.gallery-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.gallery-manager-card {
    position: relative;
    border: 1px solid var(--adm-line);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.gallery-manager-card img {
    width: 100%;
    height: 90px;
    object-fit: cover;
}

.gallery-manager-actions {
    padding: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.badge-cover {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--adm-gold);
    color: #382500;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

/* Auxiliary Tabs */
.subtabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--adm-line);
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.subtab-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid var(--adm-line);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: var(--adm-ink);
    cursor: pointer;
}

.subtab-btn.active {
    background: var(--adm-wine);
    color: #fff;
    border-color: var(--adm-wine);
}

/* Toast */
.adm-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--adm-wine);
    color: #fff;
    padding: 14px 22px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    display: none;
    border-left: 4px solid var(--adm-gold);
}

.adm-toast.show {
    display: block;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dash-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .menu-toggle-btn {
        display: block;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .admin-content {
        padding: 20px 16px;
    }
    .admin-topbar {
        padding: 0 16px;
    }
    .user-name {
        display: none;
    }
}

