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

/* ==========================================================================
   CSS SYSTEM VARIABLES & TOKENS
   ========================================================================== */
:root {
    --font-primary: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;

    /* Theme Colors (Deep HSL Tech Palette) */
    --bg-main: hsl(222, 23%, 7%);
    --bg-card: hsla(222, 20%, 12%, 0.7);
    --bg-sidebar: hsl(223, 22%, 10%);
    --bg-header: hsla(222, 23%, 7%, 0.8);
    --border-color: hsla(220, 20%, 20%, 0.4);
    --border-hover: hsla(190, 80%, 50%, 0.3);
    
    /* Neon Glow & Interactive */
    --color-primary: hsl(190, 90%, 50%); /* Neon Cyan */
    --color-primary-glow: hsla(190, 90%, 50%, 0.2);
    --color-secondary: hsl(210, 100%, 55%); /* Electric Blue */
    --color-text-main: hsl(210, 25%, 90%);
    --color-text-muted: hsl(215, 15%, 65%);
    --color-text-dark: hsl(220, 20%, 15%);
    
    /* Status HSL Colors */
    --color-success: hsl(145, 80%, 45%);
    --color-success-bg: hsla(145, 80%, 45%, 0.15);
    --color-success-border: hsla(145, 80%, 45%, 0.3);
    
    --color-warning: hsl(38, 95%, 55%);
    --color-warning-bg: hsla(38, 95%, 55%, 0.15);
    --color-warning-border: hsla(38, 95%, 55%, 0.3);
    
    --color-danger: hsl(355, 85%, 55%);
    --color-danger-bg: hsla(355, 85%, 55%, 0.15);
    --color-danger-border: hsla(355, 85%, 55%, 0.3);
    
    --color-info: hsl(205, 90%, 55%);
    --color-info-bg: hsla(205, 90%, 55%, 0.15);
    --color-info-border: hsla(205, 90%, 55%, 0.3);

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 16px -2px rgba(0, 0, 0, 0.3), 0 0 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 0 20px rgba(190, 90%, 50%, 0.05);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--color-text-main);
    overflow-x: hidden;
    line-height: 1.5;
    background-image: 
        radial-gradient(at 0% 0%, hsla(210, 100%, 55%, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(190, 100%, 50%, 0.03) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: hsla(220, 20%, 25%, 0.8);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    position: relative;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-main);
    font-weight: 800;
    font-size: 1.25rem;
    box-shadow: 0 0 15px var(--color-primary-glow);
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff, var(--color-text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item {
    width: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    color: var(--color-text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: #ffffff;
    background-color: hsla(220, 20%, 15%, 0.6);
    border-color: hsla(220, 20%, 20%, 0.4);
}

.nav-link.active {
    color: var(--color-primary);
    background-color: var(--color-primary-glow);
    border-color: hsla(190, 90%, 50%, 0.2);
    box-shadow: inset 0 0 8px hsla(190, 90%, 50%, 0.05);
}

.nav-link.active svg {
    stroke: var(--color-primary);
    filter: drop-shadow(0 0 4px var(--color-primary));
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* --- MAIN CONTENT AREA --- */
.main-wrapper {
    flex-grow: 1;
    margin-left: 280px;
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.header-title-container h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.header-title-container p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

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

/* ==========================================================================
   COMMON COMPONENTS
   ========================================================================== */
/* Premium Glassmorphic Cards */
.card {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
}

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

/* Typography elements */
.section-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: var(--bg-main);
    box-shadow: 0 4px 14px var(--color-primary-glow);
}

.btn-primary:hover {
    filter: brightness(1.15);
    box-shadow: 0 6px 20px var(--color-primary-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: hsla(220, 20%, 15%, 0.8);
    border-color: var(--border-color);
    color: var(--color-text-main);
}

.btn-secondary:hover {
    background-color: hsla(220, 20%, 20%, 0.8);
    border-color: var(--color-text-muted);
}

.btn-danger {
    background-color: var(--color-danger-bg);
    border-color: var(--color-danger-border);
    color: var(--color-danger);
}

.btn-danger:hover {
    background-color: var(--color-danger);
    color: #ffffff;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

.badge-sim, .badge-ok, .badge-baixa {
    background-color: var(--color-success-bg);
    color: var(--color-success);
    border-color: var(--color-success-border);
}

.badge-pendente, .badge-media, .badge-pendência {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
    border-color: var(--color-warning-border);
}

.badge-em_andamento, .badge-retorno_necessário {
    background-color: var(--color-info-bg);
    color: var(--color-info);
    border-color: var(--color-info-border);
}

.badge-cancelado, .badge-alta, .badge-abandonado, .badge-não {
    background-color: var(--color-danger-bg);
    color: var(--color-danger);
    border-color: var(--color-danger-border);
}

.badge-vst {
    background-color: hsla(205, 90%, 55%, 0.15);
    color: hsl(205, 90%, 55%);
    border-color: hsla(205, 90%, 55%, 0.3);
}

.badge-cliente {
    background-color: hsla(38, 95%, 55%, 0.15);
    color: hsl(38, 95%, 55%);
    border-color: hsla(38, 95%, 55%, 0.3);
}

.badge-terceiro {
    background-color: hsla(25, 95%, 55%, 0.15);
    color: hsl(25, 95%, 55%);
    border-color: hsla(25, 95%, 55%, 0.3);
}

/* ==========================================================================
   ABA: DASHBOARD VIEW
   ========================================================================== */
/* KPI Grid */
.kpi-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.kpi-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon-blue { background-color: rgba(0, 150, 255, 0.15); color: #0096ff; }
.kpi-icon-emerald { background-color: var(--color-success-bg); color: var(--color-success); }
.kpi-icon-yellow { background-color: var(--color-warning-bg); color: var(--color-warning); }
.kpi-icon-orange { background-color: rgba(255, 120, 0, 0.15); color: #ff7800; }

.kpi-value {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0.5rem 0;
    line-height: 1.1;
}

.kpi-footer {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Progress bar inside cards */
.kpi-progress-bar {
    height: 6px;
    width: 100%;
    background-color: hsla(220, 20%, 20%, 0.8);
    border-radius: 4px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.kpi-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    transition: width 0.8s ease-out;
}

/* Dashboard Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* Charts Containers */
.chart-card {
    display: flex;
    flex-direction: column;
}

.chart-placeholder {
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Alert List (Dashboard right panel) */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 240px;
    overflow-y: auto;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    background-color: hsla(220, 20%, 15%, 0.4);
    border: 1px solid var(--border-color);
}

.alert-item.critical {
    border-left: 3px solid var(--color-danger);
}

.alert-item.warning {
    border-left: 3px solid var(--color-warning);
}

.alert-text-container {
    flex-grow: 1;
    min-width: 0;
}

.alert-item-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-item-subtitle {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* SVG Chart details */
.svg-chart-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   ABA: GENERAL TOWERS (LIST & SEARCH)
   ========================================================================== */
.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: hsla(220, 20%, 12%, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    flex-grow: 1;
    max-width: 400px;
    transition: var(--transition-fast);
}

.search-container:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px hsla(190, 90%, 50%, 0.15);
}

.search-container input {
    background: none;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.9rem;
    width: 100%;
}

.search-container input::placeholder {
    color: var(--color-text-muted);
}

.search-container svg {
    color: var(--color-text-muted);
    width: 18px;
    height: 18px;
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.select-custom {
    background-color: hsla(220, 20%, 12%, 0.8);
    border: 1px solid var(--border-color);
    color: var(--color-text-main);
    border-radius: 8px;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.select-custom:focus {
    border-color: var(--color-primary);
}

/* Grid & Table Container */
.data-table-container {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
}

.data-table th:hover {
    color: #ffffff;
}

.data-table th span.sort-indicator {
    margin-left: 0.25rem;
    display: inline-block;
    font-size: 0.7rem;
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    vertical-align: middle;
    color: var(--color-text-main);
}

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

.data-table tbody tr:hover {
    background-color: hsla(220, 20%, 14%, 0.5);
}

/* Days remaining color ranges */
.days-remaining {
    font-weight: 700;
    font-size: 0.9rem;
}
.days-critical { color: var(--color-danger); }
.days-warning { color: var(--color-warning); }
.days-safe { color: var(--color-success); }

/* Table Actions Cell */
.actions-cell {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.icon-btn:hover {
    color: var(--color-primary);
    background-color: hsla(220, 20%, 18%, 0.8);
}

.icon-btn.delete:hover {
    color: var(--color-danger);
}

/* ==========================================================================
   MODAIS & SLIDE-OVERS (DETAIL VIEWS & FORMS)
   ========================================================================== */
/* Side detail panel (Slide-Over) */
.slide-over {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background-color: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 200;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.slide-over.open {
    right: 0;
}

.slide-over-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slide-over-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.slide-over-body {
    padding: 1.5rem;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 150;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.open {
    display: block;
    opacity: 1;
}

/* Standard Dialog/Modal */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    z-index: 250;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: var(--transition-smooth);
}

.modal.open {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* --- FORMS STYLING --- */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.form-control {
    background-color: hsla(220, 20%, 8%, 0.8);
    border: 1px solid var(--border-color);
    color: #ffffff;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    width: 100%;
    outline: none;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 8px hsla(190, 90%, 50%, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

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

/* Info Details Row (Side panel) */
.info-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid hsla(220, 20%, 20%, 0.3);
}

.info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 0.95rem;
    color: #ffffff;
}

/* ==========================================================================
   PHOTO UPLOADING & GALLERY COMPONENTS
   ========================================================================== */
.photo-gallery-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.photo-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.photo-item:hover {
    border-color: var(--color-primary);
    transform: scale(1.03);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ff3333;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-fast);
}

.photo-item:hover .photo-delete-btn {
    opacity: 1;
}

.photo-delete-btn:hover {
    background-color: var(--color-danger);
    color: #ffffff;
}

.photo-caption-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* File Upload Component styling */
.file-upload-container {
    border: 2px dashed var(--border-color);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    background-color: hsla(220, 20%, 8%, 0.4);
    transition: var(--transition-smooth);
}

.file-upload-container:hover {
    border-color: var(--color-primary);
    background-color: hsla(220, 20%, 8%, 0.8);
}

.file-upload-container svg {
    width: 36px;
    height: 36px;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.file-upload-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.file-upload-text span {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Fullscreen Photo Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 300;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
}

.lightbox-image-container {
    max-width: 90%;
    max-height: 80%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.lightbox-caption {
    margin-top: 1rem;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
}

/* ==========================================================================
   ABAS: HISTORICO & TECNICOS VIEWS
   ========================================================================== */
/* Timeline format for history list */
.history-timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 1rem;
}

.history-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 7px;
    height: 100%;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-card {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--bg-main);
    border: 3px solid var(--color-primary);
    z-index: 10;
}

.timeline-dot.critical { border-color: var(--color-danger); }
.timeline-dot.success { border-color: var(--color-success); }
.timeline-dot.warning { border-color: var(--color-warning); }

.timeline-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeline-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.timeline-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: flex;
    gap: 1rem;
}

.timeline-body {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 1.5rem;
}

.timeline-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timeline-detail-item {
    font-size: 0.85rem;
}

.timeline-detail-item strong {
    color: var(--color-text-muted);
}

/* Technicians Cards Grid */
.technicians-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tech-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
}

.tech-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary-glow), hsla(210, 100%, 55%, 0.1));
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.tech-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
}

.tech-role {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.tech-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
    padding-top: 1rem;
    gap: 1rem;
}

.tech-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tech-stat-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.tech-stat-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
}

/* ==========================================================================
   ANIMATION & UTILITY CLASSES
   ========================================================================== */
.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

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

.hidden {
    display: none !important;
}

/* Chart SVG visual elements styling */
.chart-bar {
    transition: height 0.5s ease-out;
}
.chart-bar:hover {
    filter: brightness(1.2);
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1.5rem;
    }
    .brand-section {
        margin-bottom: 1.5rem;
    }
    .nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .nav-link {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    .main-wrapper {
        margin-left: 0;
        padding: 1.5rem;
    }
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .timeline-body {
        grid-template-columns: 1fr;
    }
    .modal {
        width: 95%;
    }
    .slide-over {
        width: 100%;
        right: -100%;
    }
}

/* ==========================================================================
   TOAST NOTIFICATION STYLES
   ========================================================================== */
#app-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    z-index: 9999;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* ==========================================================================
   CUSTOM CONFIRM DIALOG STYLES
   ========================================================================== */
.confirm-dialog-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(7, 10, 19, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-dialog-backdrop.open {
    display: flex;
    opacity: 1;
}

.confirm-dialog-card {
    width: 90%;
    max-width: 420px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-dialog-backdrop.open .confirm-dialog-card {
    transform: scale(1);
}

.confirm-dialog-icon {
    width: 56px;
    height: 56px;
    background-color: rgba(255, 69, 58, 0.1);
    color: var(--color-danger);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 0 15px rgba(255, 69, 58, 0.1);
}

.confirm-dialog-icon svg {
    width: 28px;
    height: 28px;
}

.confirm-dialog-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.confirm-dialog-message {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 1.75rem;
}

.confirm-dialog-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.confirm-dialog-actions .btn {
    flex: 1;
}

/* ==========================================================================
   GLOBAL LOADER SPINNER STYLES
   ========================================================================== */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(7, 10, 19, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loader-overlay.open {
    display: flex;
    opacity: 1;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px var(--color-primary-glow);
}

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

.tech-card {
    position: relative;
}

.tech-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition-smooth);
}

.tech-card:hover .tech-actions {
    opacity: 1;
}

.timeline-card {
    position: relative;
}

.timeline-actions {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition-smooth);
}

.timeline-card:hover .timeline-actions {
    opacity: 1;
}

/* ==========================================================================
   PAGINATION CONTROLS
   ========================================================================== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.pagination-btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
}

.pagination-info {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* ==========================================================================
   Fase 3: MAPA INTERATIVO & LEAFLET DARK THEME
   ========================================================================== */
.map-dark-theme {
    filter: invert(90%) hue-rotate(180deg) brightness(95%) contrast(90%);
    background-color: var(--bg-main) !important;
}

.custom-map-marker {
    background: none;
    border: none;
}

.marker-pin-wrapper {
    position: relative;
    width: 30px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-pin {
    width: 24px;
    height: 24px;
    border-radius: 50% 50% 50% 0;
    position: absolute;
    transform: rotate(-45deg);
    left: 3px;
    top: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

.marker-inner-dot {
    width: 8px;
    height: 8px;
    background-color: #ffffff;
    border-radius: 50%;
    display: block;
}

.marker-pulse {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    left: -1px;
    top: -1px;
    opacity: 0;
    transform: scale(0.6);
    animation: markerPulse 1.8s ease-out infinite;
    pointer-events: none;
}

@keyframes markerPulse {
    0% {
        transform: scale(0.6);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Custom Leaflet Popups consistent with glassmorphism dark theme */
.leaflet-popup-custom .leaflet-popup-content-wrapper {
    background-color: var(--bg-sidebar) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--color-text-main) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-lg) !important;
    font-family: var(--font-primary) !important;
    padding: 0.5rem !important;
}

.leaflet-popup-custom .leaflet-popup-tip {
    background-color: var(--bg-sidebar) !important;
    border: 1px solid var(--border-color) !important;
}

.map-popup-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.map-popup-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: #ffffff;
}

.map-popup-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background-color: hsla(220, 20%, 8%, 0.4);
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   Fase 3.2: RESPONSIVIDADE MOBILE-FIRST
   ========================================================================== */
@media (max-width: 768px) {
    .sidebar {
        left: -280px;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar.open {
        left: 0;
    }

    .main-wrapper {
        margin-left: 0 !important;
        padding: 1.5rem 1.5rem !important;
    }

    .hamburger-btn {
        display: inline-flex !important;
    }

    .analytics-grid, .analytics-grid-three {
        grid-template-columns: 1fr !important;
    }

    .slide-over {
        width: 100% !important;
        right: -100% !important;
    }
    
    .slide-over.open {
        right: 0 !important;
    }
}

/* ==========================================================================
   Fase 3.3: SLIDE-OVER EQUIPAMENTOS E ANOTAÇÃO DE CUSTOS
   ========================================================================== */
.equipment-item-card {
    background-color: hsla(220, 20%, 15%, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}

.equipment-item-card:hover {
    border-color: var(--border-hover);
    background-color: hsla(220, 20%, 15%, 0.6);
}

.equipment-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.equipment-item-type {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.equipment-item-details {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}
