/* Reset e variáveis CSS */
:root {
    --primary: #000000;
    --primary-dark: #333333;
    --accent: #22c55e;
    --accent-dark: #16a34a;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #000000;
    --text-light: #666666;
    --muted: #999999;
    --border: #e5e5e5;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --sidebar-bg: #000000;
    --sidebar-text: #cccccc;
    --sidebar-active: #333333;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
    --sidebar-width: 280px;
    --sidebar-compact: 72px;
}

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

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Admin Container */
.admin-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar - Desktop First */
.admin-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(200deg, var(--primary), var(--accent));
    color: var(--sidebar-text);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
}

.sidebar-header {
    padding: clamp(16px, 3vw, 24px) clamp(12px, 2.5vw, 20px);
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

/* ensure header is positioning context for absolute controls */
.sidebar-header {
    position: relative;
}

.sidebar-header .logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: var(--shadow);
    flex-shrink: 0;
    padding: 4px;
}

.sidebar-header .logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.sidebar-header .brand-text {
    flex: 1;
}

.sidebar-header .brand-text h2 {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.sidebar-header .brand-text p {
    font-size: 0.75rem;
    color: var(--sidebar-text);
}

.sidebar-header .collapse-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: var(--transition);
    flex-shrink: 0;
    font-size: 1.2rem;
}

.sidebar-header .collapse-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    flex: 1;
    padding: clamp(12px, 2vh, 20px) 0;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 2px;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    margin-bottom: 4px;
    position: relative;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: clamp(8px, 1.5vh, 12px) clamp(12px, 2vw, 20px);
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-size: clamp(0.75rem, 1vw, 0.95rem);
    word-break: break-word;
    min-width: 0;
    overflow-wrap: break-word;
}

.nav-item a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active a {
    background: var(--sidebar-active);
    color: white;
    border-left-color: var(--accent);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.nav-item .badge {
    background: var(--accent);
    color: #000;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: clamp(12px, 2vh, 20px);
    border-top: 1px solid #334155;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.sidebar-footer .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.85rem;
    padding: 8px 12px;
}

.btn-home-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: clamp(12px, 2vh, 16px) clamp(12px, 2vw, 16px);
    background: linear-gradient(135deg, var(--accent), #1ea346);
    color: #ffffff;
    text-decoration: none;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.22s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.btn-home-footer:hover {
    background: linear-gradient(135deg, #1ea346, #16a34a);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3);
}

.btn-home-footer:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.btn-home-footer i {
    font-size: 1.1rem;
}

/* Collapse/Compact Sidebar */
.admin-sidebar.collapsed {
    width: var(--sidebar-compact);
}

.admin-sidebar.collapsed .brand-text,
.admin-sidebar.collapsed .sidebar-footer a,
.admin-sidebar.collapsed .nav-item a span {
    display: none;
}

/* Keep the collapse button visible and clickable when sidebar is compact */
.admin-sidebar.collapsed .sidebar-header .collapse-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    z-index: 1100;
}

.admin-sidebar.collapsed .nav-item a {
    justify-content: center;
    padding: 12px 8px;
    gap: 0;
}

.admin-sidebar::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.admin-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Main Content */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    width: 0;
    min-width: 0;
}

.admin-main.sidebar-compact {
    margin-left: var(--sidebar-compact);
}

.admin-main.sidebar-collapsed {
    margin-left: 0;
}

/* Admin Header */
.admin-header {
    background: white;
    padding: clamp(12px, 2vh, 16px) clamp(16px, 3vw, 30px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
    gap: clamp(8px, 2vw, 16px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 16px);
    min-width: 0;
    flex: 1;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text);
    cursor: pointer;
    display: none;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--bg);
}

.admin-header h1 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.header-right {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 16px);
    min-width: 0;
    margin-left: auto;
}

.admin-search {
    display: flex;
    background: var(--bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    min-width: 0;
}

.admin-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.admin-search input {
    padding: clamp(6px, 1vh, 10px) clamp(10px, 2vw, 15px);
    border: none;
    background: transparent;
    outline: none;
    width: clamp(150px, 20vw, 250px);
    font-size: clamp(0.8rem, 1vw, 0.9rem);
    min-width: 0;
}

.admin-search input::placeholder {
    color: var(--text-light);
}

.admin-search button {
    background: none;
    border: none;
    padding: clamp(6px, 1vh, 10px) clamp(8px, 1.5vw, 15px);
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.admin-search button:hover {
    color: var(--primary);
    background: rgba(0, 0, 0, 0.05);
}

.admin-notifications {
    position: relative;
}

.notification-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border: none;
    font-size: 1.05rem;
    cursor: pointer;
    position: relative;
    padding: 0;
    border-radius: 12px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.notification-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    opacity: 0.98;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,250,0.96));
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(2,6,23,0.12);
    width: clamp(300px, 90vw, 380px);
    max-height: 520px;
    overflow: hidden;
    display: none;
    z-index: 1000;
    border: 1px solid rgba(17,24,39,0.06);
    backdrop-filter: blur(4px);
}

.notifications-dropdown.show {
    display: block;
}

.notification-header {
    padding: clamp(12px, 2vh, 16px) clamp(12px, 2vw, 20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, rgba(0,0,0,0.03), rgba(34,197,94,0.06));
}

.notification-header h3 {
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 600;
}

.mark-all-read {
    background: transparent;
    border: 1px solid rgba(17,24,39,0.06);
    color: var(--primary);
    font-size: 0.78rem;
    cursor: pointer;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 10px;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

/* Remover barra de rolagem horizontal indesejada dentro do dropdown */
.notifications-dropdown,
.notifications-dropdown .notification-list,
.notification-item {
    overflow-x: hidden;
}

/* Garantir que o conteúdo quebre linhas corretamente e não force largura */
.notification-item {
    box-sizing: border-box;
    max-width: 100%;
}

.notification-content p {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.notification-item {
    padding: clamp(10px, 1.5vh, 14px) clamp(12px, 2vw, 18px);
    border-bottom: 1px solid rgba(17,24,39,0.04);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: background 0.18s ease, transform 0.12s ease;
    cursor: pointer;
}

.notification-item:hover {
    background: rgba(34,197,94,0.04);
    transform: translateX(3px);
}

.notification-item.unread {
    background: linear-gradient(90deg, rgba(0,0,0,0.03), rgba(34,197,94,0.06));
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    box-shadow: 0 6px 18px rgba(34,197,94,0.08);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-content p {
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    margin-bottom: 4px;
    line-height: 1.4;
    word-break: break-word;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-light);
}

.notification-footer {
    padding: clamp(8px, 1.5vh, 12px) clamp(12px, 2vw, 20px);
    border-top: 1px solid var(--border);
    text-align: center;
}

.notification-footer a {
    color: var(--primary);
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    text-decoration: none;
    font-weight: 500;
}

.admin-profile {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1vw, 10px);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px clamp(6px, 1.5vw, 12px);
    border-radius: 8px;
    transition: var(--transition);
    min-width: 0;
}

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

.profile-btn img {
    width: clamp(28px, 4vw, 36px);
    height: clamp(28px, 4vw, 36px);
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.profile-btn span {
    font-weight: 600;
    color: var(--text);
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.profile-btn i {
    color: var(--text-light);
    font-size: 0.8rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.profile-dropdown:hover .profile-btn i {
    transform: rotate(180deg);
}

.profile-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 8px 0;
    display: none;
    z-index: 100;
    border: 1px solid var(--border);
    margin-top: 4px;
}

.profile-dropdown:hover .profile-menu {
    display: block;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: clamp(8px, 1.5vh, 10px) clamp(12px, 2vw, 16px);
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
}

.menu-item:hover {
    background: var(--bg);
    color: var(--primary);
}

.menu-item i {
    width: 16px;
    text-align: center;
    color: var(--text-light);
    flex-shrink: 0;
}

.menu-item:hover i {
    color: var(--primary);
}

.menu-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* Admin Content */
.admin-content {
    flex: 1;
    padding: clamp(16px, 3vw, 30px);
    overflow-y: auto;
    background: var(--bg);
}

.admin-content::-webkit-scrollbar {
    width: 6px;
}

.admin-content::-webkit-scrollbar-track {
    background: transparent;
}

.admin-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.admin-content::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(16px, 3vh, 24px);
    gap: clamp(12px, 2vw, 20px);
    flex-wrap: wrap;
}

.section-header h2 {
    font-size: clamp(1.3rem, 3vw, 1.5rem);
    font-weight: 700;
    color: var(--text);
}

/* Small inline filter used inside card headers */
.section-filter {
    margin-left: 12px;
}

.section-filter input[type="text"] {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: clamp(180px, 24vw, 300px);
    font-size: 0.95rem;
    background: white;
}

.section-filter input[type="text"]:focus {
    outline: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border-color: var(--primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(200px, 40vw, 240px), 1fr));
    gap: clamp(16px, 3vw, 24px);
    margin-bottom: clamp(20px, 4vh, 32px);
}

.stat-card {
    background: white;
    padding: clamp(16px, 2.5vh, 24px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vh, 16px);
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stat-content {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 16px);
}

.stat-icon {
    width: clamp(50px, 8vw, 60px);
    height: clamp(50px, 8vw, 60px);
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: clamp(1.3rem, 2vw, 1.5rem);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

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

.stat-info h3 {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--primary);
    line-height: 1;
}

.stat-info p {
    color: var(--text-light);
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    font-weight: 500;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.1);
    width: fit-content;
    white-space: nowrap;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.stat-trend i {
    font-size: 0.8rem;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(16px, 3vw, 24px);
}

.content-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.content-card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: clamp(16px, 2vh, 20px) clamp(16px, 2.5vw, 24px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(100deg, rgba(0, 0, 0, 0.02), transparent);
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h3 {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 700;
    color: var(--text);
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
}

.view-all:hover {
    background: var(--bg);
    text-decoration: underline;
}

.card-body {
    padding: clamp(16px, 2vh, 24px);
    flex: 1;
    overflow-y: auto;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vh, 16px);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: clamp(8px, 1.5vw, 12px);
    padding: clamp(8px, 1.5vh, 12px) 0;
    border-bottom: 1px solid var(--border);
}

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

.activity-item:first-child {
    padding-top: 0;
}

.activity-avatar {
    width: clamp(32px, 5vw, 40px);
    height: clamp(32px, 5vw, 40px);
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.activity-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-content p {
    margin-bottom: 4px;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    line-height: 1.4;
    word-break: break-word;
}

.activity-content strong {
    color: var(--primary);
    font-weight: 600;
}

.activity-time {
    color: var(--text-light);
    font-size: clamp(0.7rem, 1.2vw, 0.8rem);
    display: flex;
    align-items: center;
    gap: 4px;
}

.activity-time::before {
    content: '•';
    color: var(--muted);
}

/* Property List */
.property-list {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vh, 16px);
}

.property-item {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 12px);
    padding: clamp(12px, 2vh, 16px) 0;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.property-item:hover {
    background: var(--bg);
    margin: 0 clamp(-8px, -1.5vw, -16px);
    padding: clamp(12px, 2vh, 16px) clamp(8px, 1.5vw, 16px);
    border-radius: 8px;
}

.property-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.property-item:first-child {
    padding-top: 0;
}

.property-image {
    width: clamp(50px, 8vw, 60px);
    height: clamp(50px, 8vw, 60px);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.property-item:hover .property-image img {
    transform: scale(1.05);
}

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

.property-info h4 {
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--primary);
    line-height: 1.3;
    word-break: break-word;
}

.property-price {
    color: var(--primary);
    font-weight: 700;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    margin-bottom: 6px;
}

.property-meta {
    display: flex;
    gap: clamp(8px, 1.5vw, 12px);
    font-size: clamp(0.7rem, 1.2vw, 0.8rem);
    color: var(--text-light);
    flex-wrap: wrap;
}

.property-location {
    display: flex;
    align-items: center;
    gap: 4px;
}

.property-location::before {
    content: '📍';
    font-size: 0.65rem;
    flex-shrink: 0;
}

.property-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.property-date::before {
    content: '📅';
    font-size: 0.65rem;
    flex-shrink: 0;
}

.property-actions {
    display: flex;
    gap: clamp(4px, 1vw, 8px);
    opacity: 0;
    transition: var(--transition);
    flex-shrink: 0;
}

.property-item:hover .property-actions {
    opacity: 1;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: clamp(6px, 1vw, 8px);
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    flex-shrink: 0;
}

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

.btn-icon.edit:hover {
    color: var(--primary);
    background: rgba(0, 0, 0, 0.05);
}

.btn-icon.approve:hover {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.btn-icon.delete:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: clamp(4px, 1vw, 8px);
    padding: clamp(8px, 1.5vh, 10px) clamp(12px, 2vw, 20px);
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    line-height: 1;
    white-space: nowrap;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

/* Table Styles */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
}

.data-table th,
.data-table td {
    padding: clamp(8px, 1.5vh, 12px) clamp(8px, 1.5vw, 16px);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text);
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg);
}

.data-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.status-badge {
    display: inline-block;
    padding: clamp(4px, 0.8vh, 6px) clamp(6px, 1.2vw, 8px);
    border-radius: 20px;
    font-size: clamp(0.65rem, 1.2vw, 0.75rem);
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Vendors section tweaks - make 'Gerenciar Vendedores' look like the public site */
#vendors-section .section-header h2 {
    font-size: clamp(1.4rem, 3.5vw, 1.7rem);
    font-weight: 800;
    position: relative;
}

#vendors-section .section-header h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 70px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

/* Make content-card use the same spacing and centered feel as the site */
#vendors-section .content-card {
    margin: 0 auto;
    max-width: 1100px;
}

/* Table styling improvements to match site aesthetics */
#vendors-section .table-container {
    background: transparent;
    border-radius: 12px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

#vendors-section .data-table {
    width: 100%;
    min-width: 760px; /* allow horizontal scroll on small screens */
    border-radius: 8px;
    background: white;
    box-shadow: var(--shadow);
}

#vendors-section .data-table th {
    background: linear-gradient(90deg, rgba(250,250,250,0.9), rgba(245,245,245,0.9));
    color: var(--text);
    font-weight: 700;
}

#vendors-section .data-table td {
    vertical-align: middle;
}

/* Make action buttons visually consistent with the site */
#vendors-section .btn-primary,
#vendors-section .btn-outline,
#vendors-section .btn {
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 700;
}

/* Mobile: allow horizontal scroll and reduce font sizes for readability */
@media (max-width: 900px) {
    #vendors-section .content-card {
        padding: 10px 12px;
        max-width: 100%;
    }

    #vendors-section .data-table {
        min-width: 640px;
        font-size: 0.9rem;
    }

    #vendors-section .section-header h2::after {
        bottom: -8px;
        width: 56px;
    }
}

@media (max-width: 480px) {
    /* Tighten paddings and make table easy to scroll */
    #vendors-section .card-body {
        padding: 12px;
    }

    #vendors-section .data-table th,
    #vendors-section .data-table td {
        padding: 8px 10px;
    }

    #vendors-section .data-table {
        min-width: 520px;
        font-size: 0.85rem;
    }
}

/* Convert vendors table to cards on small screens so data is visible */
@media (max-width: 520px) {
    #vendors-section .table-container {
        overflow: visible;
    }

    #vendors-section .data-table,
    #vendors-section .data-table thead,
    #vendors-section .data-table tbody,
    #vendors-section .data-table th,
    #vendors-section .data-table td,
    #vendors-section .data-table tr {
        display: block;
        width: 100%;
    }

    #vendors-section .data-table thead {
        display: none;
    }

    #vendors-section .data-table tr {
        background: white;
        margin-bottom: 12px;
        border-radius: 12px;
        padding: 12px;
        box-shadow: var(--shadow);
        border: 1px solid var(--border);
    }

    #vendors-section .data-table td {
        padding: 8px 6px;
        border: none;
        text-align: left;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Ensure cell children can shrink properly and show content */
    #vendors-section .data-table td > * {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Prevent checkboxes, action buttons and status badges from stretching */
    #vendors-section .data-table td input[type="checkbox"],
    #vendors-section .data-table td .vendor-checkbox {
        flex: 0 0 auto;
        width: 18px;
        height: 18px;
        margin: 0 6px 0 0;
    }

    #vendors-section .data-table td[data-label="Selecionar"] {
        min-width: 64px;
        justify-content: flex-start;
    }

    #vendors-section .data-table .status-badge {
        flex: 0 0 auto;
        display: inline-block;
        padding: 6px 10px;
        border-radius: 12px;
        white-space: nowrap;
    }

    /* Force visible colors and size for status badges on mobile */
    #vendors-section .data-table .status-badge {
        font-size: 0.9rem;
        line-height: 1;
        color: inherit !important;
    }

    #vendors-section .data-table .status-badge.active {
        background: rgba(16, 185, 129, 0.12) !important;
        color: var(--success) !important;
    }

    #vendors-section .data-table .status-badge.inactive {
        background: rgba(239, 68, 68, 0.08) !important;
        color: var(--danger) !important;
    }

    #vendors-section .data-table .status-badge.pending {
        background: rgba(245, 158, 11, 0.08) !important;
        color: var(--warning) !important;
    }

    /* Strong mobile-specific status cell rules to ensure visibility */
    #vendors-section .data-table td[data-label="Status"] {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        justify-content: flex-start !important;
    }

    #vendors-section .data-table td[data-label="Status"] .status-badge {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 6px 10px !important;
        border-radius: 12px !important;
        color: #000 !important;
        background: rgba(16,185,129,0.12) !important;
        min-width: 56px !important;
    }

    /* Keep action buttons compact and not stretched */
    #vendors-section .data-table .table-actions,
    #vendors-section .data-table td .table-actions {
        flex: 0 0 auto;
        display: flex;
        gap: 8px;
        align-items: center;
    }

    #vendors-section .data-table .user-details {
        min-width: 0;
        overflow: hidden;
    }

    /* Force readable text color inside cards */
    #vendors-section .data-table td,
    #vendors-section .data-table td strong,
    #vendors-section .data-table td span,
    #vendors-section .data-table td a {
        color: var(--text);
    }

    /* Explicit value wrapper styling to ensure visibility in mobile cards */
    #vendors-section .data-table .td-value {
        display: inline-block;
        flex: 1 1 auto;
        min-width: 0;
        color: var(--text);
        word-break: break-word;
        overflow: hidden;
    }

    #vendors-section .data-table td[data-label]::before {
        content: attr(data-label) ":";
        min-width: 90px;
        font-weight: 700;
        color: var(--text-light);
        display: inline-block;
    }

    /* Keep action buttons aligned right inside the card */
    #vendors-section .data-table td[data-label="Ações"] {
        justify-content: flex-end;
    }

    /* Avatar sizing in mobile cards */
    #vendors-section .user-avatar-table {
        width: 44px;
        height: 44px;
        border-radius: 8px;
        overflow: hidden;
    }

    #vendors-section .user-avatar-table img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Ensure checkboxes are visible and aligned */
    #vendors-section .data-table td[data-label="Selecionar"] {
        padding-left: 2px;
    }
}

/* ---- Users section: mirror vendors styles ---- */
#users-section .section-header h2 {
    font-size: clamp(1.4rem, 3.5vw, 1.7rem);
    font-weight: 800;
    position: relative;
}

#users-section .section-header h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 70px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

#users-section .content-card {
    margin: 0 auto;
    max-width: 1100px;
}

#users-section .table-container {
    background: transparent;
    border-radius: 12px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

#users-section .data-table {
    width: 100%;
    min-width: 760px;
    border-radius: 8px;
    background: white;
    box-shadow: var(--shadow);
}

#users-section .data-table th {
    background: linear-gradient(90deg, rgba(250,250,250,0.9), rgba(245,245,245,0.9));
    color: var(--text);
    font-weight: 700;
}

#users-section .data-table td {
    vertical-align: middle;
}

#users-section .btn-primary {
    background: linear-gradient(200deg, var(--primary), var(--accent));
    color: #fff;
    border: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

@media (max-width: 900px) {
    #users-section .content-card { padding:10px 12px; max-width:100%; }
    #users-section .data-table { min-width:640px; font-size:0.9rem; }
}

@media (max-width: 520px) {
    #users-section .table-container { overflow: visible; }
    #users-section .data-table,
    #users-section .data-table thead,
    #users-section .data-table tbody,
    #users-section .data-table th,
    #users-section .data-table td,
    #users-section .data-table tr { display:block; width:100%; }
    #users-section .data-table thead { display:none; }
    #users-section .data-table tr { background:white; margin-bottom:12px; border-radius:12px; padding:12px; box-shadow:var(--shadow); border:1px solid var(--border); }
    #users-section .data-table td { padding:8px 6px; border:none; text-align:left; display:flex; align-items:center; gap:8px; }
    #users-section .data-table td[data-label]::before { content: attr(data-label) ":"; min-width:90px; font-weight:700; color:var(--text-light); display:inline-block; }
    #users-section .data-table td[data-label="Ações"] { justify-content:flex-end; }
    #users-section .user-avatar-table { width:44px; height:44px; border-radius:8px; overflow:hidden; }
    #users-section .user-avatar-table img { width:100%; height:100%; object-fit:cover; }
    #users-section .data-table td[data-label="Selecionar"] { padding-left:2px; }
    #users-section .data-table td > * { flex:1 1 auto; min-width:0; }
    #users-section .data-table .td-value { display:inline-block; flex:1 1 auto; min-width:0; word-break:break-word; overflow:hidden; }
    #users-section .data-table input[type="checkbox"], #users-section .data-table .user-checkbox { flex:0 0 auto; width:18px; height:18px; margin:0 6px 0 0; }
    #users-section .data-table .status-badge { flex:0 0 auto; display:inline-block; padding:6px 10px; border-radius:12px; white-space:nowrap; font-size:0.9rem; line-height:1; color:inherit !important; }
    #users-section .data-table td[data-label="Status"] { display:flex !important; align-items:center !important; gap:8px !important; justify-content:flex-start !important; }
    #users-section .data-table td[data-label="Status"] .status-badge { display:inline-flex !important; align-items:center !important; justify-content:center !important; padding:6px 10px !important; border-radius:12px !important; color:#000 !important; background:rgba(16,185,129,0.12) !important; min-width:56px !important; }
    #users-section .table-actions, #users-section .data-table td .table-actions { flex:0 0 auto; display:flex; gap:8px; align-items:center; }
}

/* Vendors - Add button gradient and styled checkboxes */
#vendors-section .btn-primary {
    background: linear-gradient(200deg, var(--primary), var(--accent));
    color: #fff;
    border: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* Increase spacing/padding for the Add Vendor button to match Add User */

/* Make Add buttons in section headers identical for Users and Vendors */
#vendors-section .section-header .btn-primary,
#users-section .section-header .btn-primary {
    background: linear-gradient(200deg, var(--primary), var(--accent));
    color: #fff;
    border: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    padding: clamp(10px, 1.5vh, 14px) clamp(14px, 2vw, 18px);
    gap: 10px;
    font-weight: 700;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
}

#vendors-section .section-header .btn-primary:hover,
#users-section .section-header .btn-primary:hover {
    transform: translateY(-2px);
    opacity: 0.98;
}

#vendors-section .btn-primary:hover {
    transform: translateY(-2px);
    opacity: 0.98;
}

/* Custom checkbox styling for vendor tables: black border and green/black fill */
#vendors-section .data-table input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #000;
    border-radius: 4px;
    background: #fff;
    display: inline-block;
    position: relative;
    vertical-align: middle;
    cursor: pointer;
}

#vendors-section .data-table input[type="checkbox"]::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0.8);
    opacity: 0;
    transition: opacity 0.12s ease, transform 0.12s ease;
}

#vendors-section .data-table input[type="checkbox"]:checked {
    background: linear-gradient(200deg, var(--primary), var(--accent));
    border-color: #000;
}

#vendors-section .data-table input[type="checkbox"]:checked::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

/* Mirror vendor checkbox visuals for users table */
#users-section .data-table input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #000;
    border-radius: 4px;
    background: #fff;
    display: inline-block;
    position: relative;
    vertical-align: middle;
    cursor: pointer;
}

#users-section .data-table input[type="checkbox"]::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0.8);
    opacity: 0;
    transition: opacity 0.12s ease, transform 0.12s ease;
}

#users-section .data-table input[type="checkbox"]:checked {
    background: linear-gradient(200deg, var(--primary), var(--accent));
    border-color: #000;
}

#users-section .data-table input[type="checkbox"]:checked::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.table-actions {
    display: flex;
    gap: clamp(8px, 1.5vw, 12px);
    flex-wrap: wrap;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(12px, 2vh, 16px);
    padding: clamp(12px, 2vh, 16px) 0;
    margin-top: clamp(12px, 2vh, 16px);
    border-top: 1px solid var(--border);
}

.table-info {
    color: var(--text-light);
    font-size: clamp(0.75rem, 1.2vw, 0.85rem);
    order: 1;
}

.pagination {
    display: flex;
    gap: clamp(2px, 0.5vw, 4px);
    order: 2;
    flex-wrap: wrap;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(28px, 5vw, 36px);
    height: clamp(28px, 5vw, 36px);
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: clamp(0.75rem, 1.2vw, 0.85rem);
    flex-shrink: 0;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg);
    border-color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

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

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: clamp(12px, 2vh, 20px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: clamp(80vh, 90vh, 100vh);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: clamp(16px, 2vh, 20px) clamp(16px, 2.5vw, 24px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-close {
    background: none;
    border: none;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-body {
    flex: 1;
    padding: clamp(16px, 2vh, 24px);
    overflow-y: auto;
}

.modal-footer {
    padding: clamp(12px, 2vh, 20px) clamp(16px, 2.5vw, 24px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: clamp(8px, 1.5vw, 12px);
    flex-wrap: wrap;
}

/* Form Styles */
.form-group {
    margin-bottom: clamp(12px, 2vh, 20px);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: clamp(12px, 2vw, 16px);
}

.form-group label {
    display: block;
    margin-bottom: clamp(4px, 0.8vh, 6px);
    font-weight: 500;
    color: var(--text);
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: clamp(8px, 1.5vh, 10px) clamp(8px, 1.5vw, 12px);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: clamp(0.85rem, 1.5vw, 0.9rem);
    transition: var(--transition);
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: clamp(80px, 20vh, 120px);
}

/* No Results */
.no-results {
    text-align: center;
    padding: clamp(24px, 4vh, 40px) clamp(16px, 3vw, 20px);
    color: var(--text-light);
}

.no-results i {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: clamp(12px, 2vh, 16px);
    color: var(--border);
}

.no-results p {
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    margin-bottom: 0;
}

/* Messages */
.success-message,
.error-message {
    padding: clamp(12px, 2vh, 16px) clamp(12px, 2vw, 16px);
    border-radius: var(--radius);
    margin-bottom: clamp(12px, 2vh, 20px);
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 12px);
    font-size: clamp(0.85rem, 1.5vw, 0.9rem);
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(16px, 3vw, 20px);
    height: clamp(16px, 3vw, 20px);
    margin: calc(-1 * clamp(8px, 1.5vw, 10px)) 0 0 calc(-1 * clamp(8px, 1.5vw, 10px));
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */

/* Extra Large (1920px and up) */
@media (min-width: 1920px) {
    .admin-container {
        font-size: 18px;
    }
    
    .admin-sidebar {
        width: 300px;
    }
    
    .admin-main {
        margin-left: 300px;
    }
}

/* Large (1440px and up) */
@media (min-width: 1440px) {
    :root {
        --sidebar-width: 300px;
    }
    
    .admin-main {
        margin-left: 300px;
    }
    
    .admin-sidebar {
        width: 300px;
    }
}

/* Medium-Large (1200px and below) */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        width: 260px;
    }
    
    .admin-main {
        margin-left: 260px;
    }
    
    .notifications-dropdown {
        width: 320px;
        right: -40px;
    }
}

/* Medium (992px and below) */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-sidebar {
        width: 240px;
    }
    
    .admin-main {
        margin-left: 240px;
    }
    
    .admin-search input {
        width: clamp(120px, 15vw, 180px);
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet (768px and below) */
@media (max-width: 768px) {
    :root {
        font-size: 15px;
    }
    
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        animation: fadeIn 0.3s ease;
    }
    
    .sidebar-backdrop.active {
        display: block;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        z-index: 1050;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
    }
    
    .admin-main {
        margin-left: 0 !important;
    }
    
    .admin-main.sidebar-compact {
        margin-left: 0 !important;
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .admin-header {
        padding: 12px 16px;
        position: relative;
        z-index: 1040;
    }
    
    /* Vendors table: transformar em cartões no mobile */
    #vendorsTable thead {
        display: none;
    }

    #vendorsTable tbody tr {
        display: block;
        background: var(--card);
        border-radius: 12px;
        box-shadow: var(--shadow);
        margin-bottom: 12px;
        padding: 12px;
        border: 1px solid var(--border);
    }

    #vendorsTable tbody tr td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 10px;
        border-bottom: none;
    }

    #vendorsTable tbody tr td[data-label]::before {
        content: attr(data-label) ": ";
        color: var(--text-light);
        font-weight: 700;
        margin-right: 8px;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    #vendorsTable tbody tr td .user-info-table {
        align-items: center;
    }

    #vendorsTable tbody tr td .user-avatar-table {
        width: 48px;
        height: 48px;
        border-radius: 8px;
        overflow: hidden;
        margin-right: 10px;
        flex: 0 0 auto;
    }

    #vendorsTable tbody tr td .user-avatar-table img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    #vendorsTable tbody tr td:first-child {
        /* checkbox column */
        flex: 0 0 auto;
        margin-right: 12px;
    }

    #vendorsTable tbody tr td:last-child {
        justify-content: flex-end;
        gap: 8px;
    }

    #vendorsTable tbody tr td .table-actions {
        display: inline-flex;
        gap: 8px;
    }

    #vendorsTable tbody tr td .btn-icon {
        padding: 8px;
        border-radius: 8px;
    }
    
    .sidebar-header {
        padding: 12px 16px;
    }
    
    .sidebar-nav {
        padding: 8px 0;
    }
    
    .nav-item a {
        padding: 10px 14px;
        font-size: 0.9rem;
        white-space: normal;
    }
    
    .admin-header {
        padding: 14px 16px;
        gap: 12px;
    }

    .header-left {
        gap: 8px;
    }

    .admin-header h1 {
        font-size: 1.1rem;
    }

    .header-right {
        gap: 8px;
    }

    .admin-search {
        display: none;
    }

    .profile-btn span {
        display: none;
    }
    
    .admin-content {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
        flex-direction: row;
        align-items: center;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        flex-shrink: 0;
    }

    .stat-info {
        flex: 1;
    }

    .stat-info h3 {
        font-size: 1.3rem;
    }
    
    .stat-trend {
        margin-top: 0;
        width: auto;
        justify-content: flex-end;
        flex-shrink: 0;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .section-header h2 {
        width: 100%;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .table-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .table-info {
        width: 100%;
        order: 1;
    }
    
    .pagination {
        width: 100%;
        order: 2;
        justify-content: flex-start;
    }
    
    .notifications-dropdown {
        width: calc(100vw - 32px);
        right: auto;
        left: 16px;
    }
    
    .header-right {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

/* Small Mobile (576px and below) */
@media (max-width: 576px) {
    :root {
        font-size: 14px;
    }
    
    .admin-sidebar {
        width: 260px;
        max-width: 80vw;
    }
    
    .sidebar-header {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .sidebar-header .logo {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .sidebar-header .brand-text h2 {
        font-size: 0.95rem;
    }
    
    .sidebar-header .brand-text p {
        font-size: 0.65rem;
    }
    
    .sidebar-nav {
        padding: 6px 0;
    }
    
    .nav-item {
        margin-bottom: 2px;
    }
    
    .nav-item a {
        padding: 8px 12px;
        font-size: 0.85rem;
        gap: 8px;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
    
    .sidebar-footer {
        padding: 10px;
    }
    
    .sidebar-footer .btn {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    .admin-header {
        flex-direction: row;
        flex-wrap: nowrap;
        padding: 14px 16px;
        gap: 8px;
    }

    .header-left {
        order: 0;
        flex: 0 1 auto;
        gap: 8px;
        width: auto;
    }

    .admin-search {
        flex: 1 1 auto;
        min-width: 0;
        order: 1;
    }

    .admin-search input {
        width: 100%;
        min-width: 0;
    }

    .header-right {
        order: 2;
        flex: 0 1 auto;
        gap: 8px;
        margin-left: 0;
        width: auto;
    }

    .admin-header h1 {
        display: none;
    }

    .notification-btn {
        padding: 8px !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        font-size: 1rem !important;
    }

    .profile-btn {
        padding: 8px !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        gap: 0 !important;
    }

    .profile-btn img {
        width: 32px !important;
        height: 32px !important;
        margin: 0 !important;
    }

    .profile-btn span {
        display: none !important;
    }

    .profile-btn i {
        display: none !important;
    }

    .profile-menu {
        right: 0 !important;
        min-width: 180px !important;
    }

    .notifications-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: 16px 16px 0 0;
        z-index: 1001;
    }

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

    .stat-card {
        padding: 16px;
        flex-direction: row;
        align-items: center;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        flex-shrink: 0;
    }

    .stat-info {
        flex: 1;
    }

    .stat-info h3 {
        font-size: 1.3rem;
    }

    .stat-trend {
        margin-top: 0;
        width: auto;
        justify-content: flex-end;
        flex-shrink: 0;
    }

    .card-body {
        padding: 16px;
    }
    
    .property-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 0;
    }
    
    .property-info {
        width: 100%;
    }
    
    .property-actions {
        align-self: flex-end;
        opacity: 1;
    }
    
    .activity-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .activity-avatar {
        align-self: center;
    }
    
    .modal-content {
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 100vh;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
    }
    
    .modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }
    
    .status-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 10px 12px;
    }
    
    .table-container {
        margin-left: -12px;
        margin-right: -12px;
        margin-bottom: -12px;
    }
}

/* Extra Small (480px and below) */
@media (max-width: 480px) {
    :root {
        font-size: 13px;
    }
    
    .admin-header {
        gap: 4px;
    }
    
    .header-left {
        gap: 4px;
    }
    
    .admin-header h1 {
        font-size: 0.9rem;
        flex: 1;
    }
    
    .sidebar-toggle {
        width: 32px;
        height: 32px;
        padding: 6px;
    }
    
    .notification-badge {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
    
    .stat-card {
        padding: 12px;
        gap: 8px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .stat-info h3 {
        font-size: 1.1rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-header h3 {
        width: 100%;
    }
    
    .property-image {
        width: 40px;
        height: 40px;
    }
    
    .activity-avatar {
        width: 30px;
        height: 30px;
    }
    
    .modal-header {
        padding: 12px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* Reports Section Styles */
.report-type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.report-type-option {
    position: relative;
    cursor: pointer;
}

.report-type-option input {
    display: none;
}

.report-type-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    transition: var(--transition);
    font-weight: 500;
}

.report-type-option:hover {
    border-color: var(--accent);
    background: rgba(34, 197, 94, 0.05);
}

.report-type-option input:checked + span {
    color: var(--accent);
}

.report-type-option input:checked ~ i,
.report-type-option.active {
    border-color: var(--accent);
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent);
}

.report-type-option i {
    font-size: 1.2rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

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

.filter-group label {
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

/* Export buttons styling in reports */
.table-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    transition: all 0.2s ease;
}

.table-actions .btn i {
    font-size: 1rem;
}

#exportPdfBtn {
    background: linear-gradient(180deg,#ef4444,#dc2626);
    color: #fff;
    border: none;
}

#exportPdfBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(220,37,37,0.12);
}

#exportExcelBtn {
    background: linear-gradient(180deg,#16a34a,#15803d);
    color: #fff;
    border: none;
}

#exportExcelBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(21,128,61,0.12);
}

.form-input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.form-input:disabled {
    background: var(--bg);
    color: var(--text-light);
    cursor: not-allowed;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

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

#mainChart,
#distributionChart {
    height: 400px;
    max-height: 400px;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

/* Print styles */
@media print {
    .admin-sidebar,
    .admin-header {
        display: none;
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .admin-content {
        padding: 0;
        background: white;
    }
    
    .stat-card,
    .content-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .modal {
        display: none;
    }
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */


/* Landscape mode adjustments for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .admin-header {
        padding: 8px 12px;
    }
    
    .admin-content {
        padding: 8px;
    }
    
    .stat-card {
        padding: 12px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-form {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.form-group input.error,
.form-group select.error {
    border-color: #ef4444;
}

.form-group input.error:focus,
.form-group select.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
    display: none;
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 4px;
}

.error-message.show {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

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

    .left-actions {
        display: flex;
    }

    .right-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.left-actions {
    display: contents;
}

.right-actions {
    display: contents;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: #22c55e;
    color: white;
}

.btn-primary:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-outline {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.modal-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
    display: none;
    animation: slideDown 0.3s ease;
}

.modal-message.show {
    display: block;
}

.modal-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.modal-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

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

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 100px;
    }
}
