:root {
    --apple-blue: #0071e3;
    --apple-blue-rgb: 0, 113, 227;
    --apple-mint: #00a87e;
    --apple-amber: #f59e0b;

    --bg-page: #f5f5f7;
    --bg-surface: rgba(255, 255, 255, 0.78);
    --bg-surface-strong: rgba(255, 255, 255, 0.94);
    --bg-muted: rgba(17, 17, 17, 0.04);

    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #8f8f94;

    --border-soft: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.12);

    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --radius-xl: 36px;
    --radius-pill: 999px;

    --shadow-1: 0 6px 24px rgba(15, 23, 42, 0.06);
    --shadow-2: 0 16px 40px rgba(15, 23, 42, 0.10);

    --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

[data-bs-theme="dark"] {
    --bg-page: #0f0f10;
    --bg-surface: rgba(28, 28, 30, 0.70);
    --bg-surface-strong: rgba(36, 36, 38, 0.88);
    --bg-muted: rgba(255, 255, 255, 0.06);

    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a7;
    --text-tertiary: #7d7d82;

    --border-soft: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.16);

    --shadow-1: 0 10px 28px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 22px 52px rgba(0, 0, 0, 0.45);
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-stack);
    line-height: 1.5;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

h1 {
    font-weight: 700;
    font-size: clamp(1.9rem, 1.45rem + 1.5vw, 2.8rem);
}

h2 {
    font-weight: 650;
    font-size: clamp(1.4rem, 1.25rem + 0.8vw, 2rem);
}

p {
    color: var(--text-secondary);
}

a {
    color: var(--apple-blue);
    text-decoration: none;
}

a:hover {
    color: var(--apple-blue);
    opacity: 0.82;
}

.text-apple-blue {
    color: var(--apple-blue) !important;
}

.app-ambient {
    position: fixed;
    z-index: -2;
    filter: blur(30px);
    opacity: 0.55;
    pointer-events: none;
}

.app-ambient--one {
    width: 420px;
    height: 420px;
    top: -140px;
    right: -120px;
    background: radial-gradient(circle, rgba(var(--apple-blue-rgb), 0.28) 0%, rgba(var(--apple-blue-rgb), 0) 70%);
}

.app-ambient--two {
    width: 360px;
    height: 360px;
    left: -120px;
    bottom: -120px;
    background: radial-gradient(circle, rgba(0, 168, 126, 0.18) 0%, rgba(0, 168, 126, 0) 70%);
}

.app-main {
    padding-top: 104px;
    padding-bottom: 64px;
    position: relative;
}

.navbar-apple {
    background: rgba(248, 248, 250, 0.72);
    backdrop-filter: saturate(160%) blur(20px);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    border-bottom: 1px solid var(--border-soft);
    padding: 12px 0;
}

[data-bs-theme="dark"] .navbar-apple {
    background: rgba(14, 14, 15, 0.68);
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 560;
    padding: 8px 12px !important;
    border-radius: 12px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-muted);
}

.glass-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    padding: 1.35rem;
}

.glass-panel:hover {
    box-shadow: var(--shadow-2);
}

.btn {
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
}

.btn-apple-primary {
    border: none;
    color: #fff;
    background: linear-gradient(180deg, #1683ff 0%, var(--apple-blue) 100%);
    padding: 11px 22px;
    box-shadow: 0 10px 24px rgba(var(--apple-blue-rgb), 0.28);
}

.btn-apple-primary:hover {
    color: #fff;
    transform: translateY(-1px);
}

.btn-apple-primary:active {
    transform: translateY(0);
}

.btn-apple-secondary {
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    background: var(--bg-surface-strong);
    padding: 11px 22px;
}

.btn-apple-secondary:hover {
    color: var(--text-primary);
    background: var(--bg-muted);
}

.form-label-apple {
    display: inline-block;
    margin: 0 0 8px 2px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    font-weight: 700;
}

.form-control-apple,
.form-control.form-control-apple,
.form-select.form-control-apple {
    border: 1px solid var(--border-soft);
    background: var(--bg-surface-strong);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    min-height: 48px;
    padding: 0.67rem 0.9rem;
    font-size: 0.95rem;
}

textarea.form-control-apple {
    min-height: 110px;
}

.form-control-apple:focus,
.form-control.form-control-apple:focus,
.form-select.form-control-apple:focus {
    border-color: rgba(var(--apple-blue-rgb), 0.55);
    box-shadow: 0 0 0 4px rgba(var(--apple-blue-rgb), 0.16);
    background: var(--bg-surface-strong);
    color: var(--text-primary);
}

.form-control-apple::placeholder {
    color: var(--text-tertiary);
}

.project-id-block,
.project-id-inline {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 0.9rem;
    border-radius: 14px;
    background: var(--bg-muted);
    border: 1px solid var(--border-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-weight: 650;
    letter-spacing: 0.04em;
}

.project-id-block {
    width: 100%;
}

.project-id-inline {
    margin-top: 8px;
}

.table-apple {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    margin: 0;
}

.table-apple th {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    font-weight: 700;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(0, 0, 0, 0.015);
    padding-top: 1rem;
    padding-bottom: 1rem;
}

[data-bs-theme="dark"] .table-apple th {
    background: rgba(255, 255, 255, 0.02);
}

.table-apple td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-color: var(--border-soft);
}

.table-apple tr:hover td {
    background: rgba(var(--apple-blue-rgb), 0.05);
}

.badge {
    font-weight: 620;
    letter-spacing: 0.02em;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.stat-card {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.stat-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.stat-value {
    font-size: clamp(1.7rem, 1.1rem + 1vw, 2.3rem);
    line-height: 1;
    font-weight: 680;
    color: var(--text-primary);
}

.stat-label {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.84rem;
    letter-spacing: 0.02em;
}

.dashboard-project-search__icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.dashboard-project-search__input {
    padding-left: 40px;
}

.projeto-detail-header {
    padding: 1.1rem 1.25rem;
}

.projeto-detail-edit-btn {
    min-width: 120px;
}

.projeto-detail-media-panel iframe {
    width: 100%;
    height: 100%;
}

.projeto-detail-meta-grid .col-md-6 {
    border-top: 1px solid var(--border-soft);
    padding-top: 0.7rem;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.login-glass-card {
    width: 100%;
    max-width: 460px;
    margin-inline: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    padding: clamp(1.6rem, 1.15rem + 1.4vw, 2.6rem);
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.app-toast-container {
    z-index: 1100;
    margin-top: 80px;
}

.hover-lift {
    transition: transform 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-1px);
}

.animate-entry {
    opacity: 0;
    animation: fadeInUp 0.48s ease forwards;
}

.delay-1 {
    animation-delay: 0.08s;
}

.delay-2 {
    animation-delay: 0.16s;
}

.delay-3 {
    animation-delay: 0.24s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 992px) {
    .app-main {
        padding-top: 92px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .app-main {
        padding-top: 88px;
        padding-bottom: 32px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .glass-panel {
        border-radius: 22px;
        padding: 1rem;
    }

    .table-apple th,
    .table-apple td {
        white-space: nowrap;
    }

    .app-ambient {
        opacity: 0.4;
    }
}
