/* ==========================================================
   ATLAS DESIGN SYSTEM - GLOBAL V1
   Gestão para Engenharia e Construção
   ========================================================== */

:root {
    /* Brand */
    --atlas-blue: #2457FF;
    --atlas-blue-hover: #1A46C4;
    --atlas-blue-active: #173DAA;

    --atlas-midnight: #0A1026;
    --atlas-midnight-soft: #0D172A;

    --atlas-graphite: #171A21;
    --atlas-steel: #697386;

    --atlas-cloud: #EEF2F7;
    --atlas-off-white: #F8FAFC;
    --atlas-white: #FFFFFF;

    --atlas-violet: #6C5CE7;
    --atlas-cyan: #18A6D9;
    --atlas-amber: #F4A226;
    --atlas-red: #E94B4B;

    /* Surfaces */
    --atlas-bg: #F7F8FA;
    --atlas-surface: #FFFFFF;
    --atlas-surface-secondary: #F8FAFC;
    --atlas-border: #E5E7EB;

    /* Typography */
    --atlas-text: #111827;
    --atlas-text-secondary: #64748B;
    --atlas-text-muted: #94A3B8;

    /* Shared visual geometry for ATLAS pages (R39) */
    --atlas-ui-hero-min-height: 174px;
    --atlas-ui-hero-padding: 28px 32px;
    --atlas-ui-hero-radius: 16px;
    --atlas-ui-hero-accent-width: 4px;
    --atlas-ui-stat-min-height: 116px;
    --atlas-ui-stat-padding: 17px 19px 16px;
    --atlas-ui-stat-radius: 14px;
    --atlas-ui-section-gap: 15px;

    /* Product geometry */
    --atlas-radius-xs: 6px;
    --atlas-radius-sm: 8px;
    --atlas-radius-md: 12px;
    --atlas-radius-lg: 16px;

    --atlas-shadow-sm:
        0 1px 2px rgba(8, 16, 32, .04),
        0 1px 3px rgba(8, 16, 32, .05);

    --atlas-shadow-md:
        0 8px 28px rgba(8, 16, 32, .08);

    /* Frappe variable bridge */
    --primary: var(--atlas-blue);
    --primary-color: var(--atlas-blue);
}

/* ----------------------------------------------------------
   GLOBAL
---------------------------------------------------------- */

html,
body {
    background: var(--atlas-bg);
}

body {
    color: var(--atlas-text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ----------------------------------------------------------
   NAVBAR
---------------------------------------------------------- */

.navbar,
.navbar-default {
    border-bottom:
        1px solid rgba(15, 23, 42, .07) !important;

    background:
        rgba(255, 255, 255, .94) !important;

    box-shadow:
        0 1px 8px rgba(8, 16, 32, .035) !important;

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.navbar .navbar-brand {
    min-width: 120px;
}

.navbar .navbar-brand img,
.navbar-brand img {
    max-height: 28px !important;
}

/* ----------------------------------------------------------
   ATLAS BRAND INJECTION
---------------------------------------------------------- */

.atlas-global-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    min-width: 104px;

    text-decoration: none !important;
}

.atlas-global-brand img {
    display: block;

    width: auto;
    height: 26px;
    max-width: 118px;

    object-fit: contain;
}

.atlas-product-signature {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.atlas-product-signature strong {
    color: var(--atlas-midnight);

    font-size: 13px;
    font-weight: 720;
    line-height: 1.05;
    letter-spacing: .075em;
}

.atlas-product-signature small {
    margin-top: 3px;

    color: var(--atlas-text-muted);

    font-size:12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .055em;

    white-space: nowrap;
}

/* ----------------------------------------------------------
   DESK / WORKSPACE
---------------------------------------------------------- */

.layout-main-section,
.page-container,
.page-body {
    background:
        var(--atlas-bg);
}

.page-head {
    border-bottom:
        1px solid rgba(15, 23, 42, .065);

    background:
        rgba(247, 248, 250, .92) !important;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.page-title .title-text,
.page-head .title-text,
.layout-main-section h1,
.layout-main-section h2 {
    color: var(--atlas-midnight);
}

/* ----------------------------------------------------------
   SIDEBAR
---------------------------------------------------------- */

.desk-sidebar,
.layout-side-section {
    background: var(--atlas-off-white);
}

.desk-sidebar .standard-sidebar-item,
.layout-side-section .sidebar-menu a,
.standard-sidebar-item {
    border-radius: var(--atlas-radius-sm);

    color: #475569;

    transition:
        color .15s ease,
        background .15s ease;
}

.desk-sidebar .standard-sidebar-item:hover,
.layout-side-section .sidebar-menu a:hover,
.standard-sidebar-item:hover {
    color: var(--atlas-midnight);

    background:
        rgba(29, 78, 216, .055);
}

.desk-sidebar .standard-sidebar-item.selected,
.standard-sidebar-item.selected,
.standard-sidebar-item.active {
    color: var(--atlas-blue) !important;

    background:
        rgba(29, 78, 216, .09) !important;
}

/* ----------------------------------------------------------
   CARDS
---------------------------------------------------------- */

.card,
.frappe-card,
.widget,
.form-section,
.form-dashboard-section,
.list-row-container,
.modal-content {
    border-color:
        var(--atlas-border) !important;

    border-radius:
        var(--atlas-radius-md) !important;

    box-shadow:
        var(--atlas-shadow-sm);
}

/* ----------------------------------------------------------
   BUTTONS
---------------------------------------------------------- */

.btn {
    border-radius:
        var(--atlas-radius-sm) !important;

    font-weight: 600;

    transition:
        all .15s ease;
}

.btn-primary,
.btn-primary-dark {
    border-color:
        var(--atlas-blue) !important;

    color:
        #fff !important;

    background:
        var(--atlas-blue) !important;

    box-shadow:
        0 4px 12px rgba(29, 78, 216, .16);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary-dark:hover {
    border-color:
        var(--atlas-blue-hover) !important;

    background:
        var(--atlas-blue-hover) !important;

    transform:
        translateY(-1px);
}

.btn-default,
.btn-secondary {
    border-color:
        #DDE3EA !important;

    color:
        #334155 !important;

    background:
        #fff !important;
}

.btn-default:hover,
.btn-secondary:hover {
    border-color:
        #CBD5E1 !important;

    color:
        var(--atlas-midnight) !important;

    background:
        #F8FAFC !important;
}

/* ----------------------------------------------------------
   INPUTS
---------------------------------------------------------- */

.form-control,
.input-with-feedback,
input,
select,
textarea {
    border-color:
        #DDE3EA;

    border-radius:
        var(--atlas-radius-sm) !important;

    box-shadow:
        none !important;
}

.form-control:focus,
.input-with-feedback:focus,
input:focus,
select:focus,
textarea:focus {
    border-color:
        rgba(29, 78, 216, .70) !important;

    box-shadow:
        0 0 0 3px rgba(29, 78, 216, .10) !important;
}

/* ----------------------------------------------------------
   TABLES
---------------------------------------------------------- */

.list-row,
.grid-row,
.table > tbody > tr {
    transition:
        background .12s ease;
}

.list-row:hover,
.grid-row:hover,
.table > tbody > tr:hover {
    background:
        rgba(29, 78, 216, .025) !important;
}

.table thead th,
.grid-heading-row {
    color:
        #64748B;

    background:
        #F8FAFC !important;

    font-size:12px;

    font-weight:
        650;
}

/* ----------------------------------------------------------
   STATUS / BADGES
   ATLAS: ZERO VERDE
---------------------------------------------------------- */

.indicator.green,
.indicator-pill.green,
.badge-success,
.alert-success {
    color:
        #075985 !important;

    border-color:
        rgba(6, 182, 212, .24) !important;

    background:
        rgba(6, 182, 212, .10) !important;
}

.indicator.green::before,
.indicator-pill.green::before {
    background:
        var(--atlas-cyan) !important;
}

.indicator.blue,
.indicator-pill.blue {
    color:
        var(--atlas-blue) !important;
}

.indicator.orange,
.indicator.yellow,
.indicator-pill.orange,
.indicator-pill.yellow,
.badge-warning {
    color:
        #92400E !important;

    border-color:
        rgba(245, 158, 11, .25) !important;

    background:
        rgba(245, 158, 11, .10) !important;
}

.indicator.red,
.indicator-pill.red,
.badge-danger,
.alert-danger {
    color:
        #991B1B !important;

    border-color:
        rgba(239, 68, 68, .25) !important;

    background:
        rgba(239, 68, 68, .10) !important;
}

/* ----------------------------------------------------------
   LINKS
---------------------------------------------------------- */

a {
    color:
        var(--atlas-blue);
}

a:hover {
    color:
        var(--atlas-blue-hover);
}

/* ----------------------------------------------------------
   MODALS
---------------------------------------------------------- */

.modal-backdrop {
    background:
        #020617;
}

.modal-content {
    overflow: hidden;
}

.modal-header {
    border-bottom:
        1px solid var(--atlas-border);
}

.modal-footer {
    border-top:
        1px solid var(--atlas-border);

    background:
        #F8FAFC;
}

/* ----------------------------------------------------------
   TOASTS / NOTIFICATIONS
---------------------------------------------------------- */

.toast-message,
.msgprint {
    border-radius:
        var(--atlas-radius-md);
}

/* ----------------------------------------------------------
   LOGIN
---------------------------------------------------------- */

body[data-path="login"],
body.login-page {
    background:
        #F7F8FA !important;
}

body[data-path="login"] .page-card,
body.login-page .page-card {
    border:
        1px solid rgba(15, 23, 42, .07);

    border-radius:
        18px !important;

    background:
        rgba(255, 255, 255, .96);

    box-shadow:
        0 28px 80px rgba(8, 16, 32, .10);
}

body[data-path="login"] .page-card-head img,
body.login-page .page-card-head img {
    max-width:
        180px !important;

    max-height:
        64px !important;
}

/* ----------------------------------------------------------
   ATLAS BLUE AXIS
   assinatura visual sutil do produto
---------------------------------------------------------- */

.atlas-axis {
    position: relative;
}

.atlas-axis::before {
    content: "";

    position: absolute;

    top: 0;
    bottom: 0;
    left: 0;

    width: 2px;

    border-radius: 10px;

    background:
        var(--atlas-blue);
}

/* ----------------------------------------------------------
   DARK MODE PREPARATION
---------------------------------------------------------- */

[data-theme="dark"] {
    --atlas-bg: #080B12;
    --atlas-surface: #10151F;
    --atlas-surface-secondary: #141A25;
    --atlas-border: #232B39;

    --atlas-text: #F8FAFC;
    --atlas-text-secondary: #94A3B8;
    --atlas-text-muted: #64748B;
}

[data-theme="dark"] body,
[data-theme="dark"] .layout-main-section,
[data-theme="dark"] .page-container,
[data-theme="dark"] .page-body {
    color:
        var(--atlas-text);

    background:
        var(--atlas-bg);
}

/* ----------------------------------------------------------
   RESPONSIVE
---------------------------------------------------------- */

@media (max-width: 768px) {
    .atlas-product-signature small {
        display: none;
    }
}
