/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #2563EB;
    /* Blue 600 */
    --hover-blue: #1D4ED8;
    --bg-page: #F3F4F6;
    /* Gray 100 */
    --bg-card: #FFFFFF;
    --text-main: #1F2937;
    /* Gray 800 */
    --text-muted: #6B7280;
    /* Gray 500 */
    --border-color: #E5E7EB;
    /* Gray 200 */

    --kpi-blue-bg: #EBF5FF;
    --kpi-blue-text: #3B82F6;

    --kpi-pink-bg: #FCE7F3;
    --kpi-pink-text: #EC4899;

    --kpi-cyan-bg: #CFFAFE;
    --kpi-cyan-text: #06B6D4;

    --kpi-green-bg: #DCFCE7;
    --kpi-green-text: #22C55E;

    --status-blue: #3B82F6;
    --status-green: #10B981;
    --status-orange: #F59E0B;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
}

/* Header */
.dashboard-header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: var(--primary-blue);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.header-badge {
    background: #F3F4F6;
    color: #4B5563;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    margin-left: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: right;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-email {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.user-role {
    font-size: 0.7rem;
    color: #9CA3AF;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.user-avatar-circle {
    width: 36px;
    height: 36px;
    background: #F3F4F6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
}

.btn-logout {
    background: #EF4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: #DC2626;
}

/* Container */
.dashboard-main {
    padding: 2rem 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.kpi-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.icon-blue {
    background: var(--kpi-blue-bg);
    color: var(--kpi-blue-text);
}

.icon-pink {
    background: var(--kpi-pink-bg);
    color: var(--kpi-pink-text);
}

.icon-cyan {
    background: var(--kpi-cyan-bg);
    color: var(--kpi-cyan-text);
}

.icon-green {
    background: var(--kpi-green-bg);
    color: var(--kpi-green-text);
}

.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 0.7rem;
    color: #9CA3AF;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 1.875rem;
    font-weight: 800;
    color: #111827;
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-sub {
    font-size: 0.8rem;
    color: #6B7280;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
}

.panel {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: calc(100vh - 280px);
    /* Adjust based on header/kpi height */
    min-height: 600px;
}

/* Panel Header */
.panel-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.badge-blue {
    background: var(--primary-blue);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Search */
.panel-search-wrapper {
    padding: 1rem;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 0.9rem;
}

.search-box input {
    width: 100%;
    padding: 10px 10px 10px 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary-blue);
}

/* List Items (Condomínios) */
.panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 1rem 1rem 1rem;
}

.condo-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.condo-item:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-color: #BFDBFE;
}

.condo-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.condo-icon {
    color: #9CA3AF;
    font-size: 1.1rem;
    margin-top: 2px;
}

.condo-name {
    font-weight: 600;
    color: #1F2937;
    font-size: 0.95rem;
    line-height: 1.4;
}

.condo-addr {
    font-size: 0.8rem;
    color: #6B7280;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-new-os {
    width: 100%;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-new-os:hover {
    background: var(--hover-blue);
}

/* Tabs */
.tabs-wrapper {
    display: flex;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 24px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6B7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.tab-btn.active {
    color: #111827;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-blue);
}

.tab-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-em_andamento {
    background: var(--status-blue);
}

.status-accepted {
    background: var(--status-green);
}

.status-pending {
    background: var(--status-orange);
}

.tab-badge {
    background: #E5E7EB;
    color: #374151;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
}

.tab-btn.active .tab-badge {
    background: var(--primary-blue);
    color: white;
}

/* OS Cards Content */
.panel-body-content {
    flex: 1;
    background: #F9FAFB;
    padding: 1.5rem;
    overflow-y: auto;
}

.os-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.os-top-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.os-id-badge {
    background: #EFF6FF;
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 6px;
}

.os-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.detail-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1F2937;
    line-height: 1.4;
}

.detail-sub {
    font-size: 0.8rem;
    color: #6B7280;
}

.detail-warning {
    color: #4B5563;
    font-style: italic;
    font-size: 0.85rem;
    line-height: 1.5;
    background: #FEF3C7;
    padding: 8px;
    border-radius: 6px;
    border-left: 3px solid #F59E0B;
}

.os-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.btn-tracking {
    background: var(--primary-blue);
    color: white;
    font-weight: 600;
    padding: 8px 24px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-tracking:hover {
    background: var(--hover-blue);
}

/* Floating Actions */
.floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 100;
}

.fab-theme,
.fab-add {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.fab-theme {
    background: white;
    color: #1F2937;
}

.fab-add {
    background: var(--primary-blue);
    color: white;
}

.fab-theme:hover,
.fab-add:hover {
    transform: scale(1.1);
}

/* Loading */
.loading-state {
    text-align: center;
    color: #9CA3AF;
    font-style: italic;
    padding: 2rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Responsive */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .os-details-grid {
        grid-template-columns: 1fr;
    }

    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }
}