/* =========================================================
   DISTAK ERP — UI 2026
   Camada visual inspirada em interfaces iOS
   Mantém a identidade DISTAK: azul-marinho + dourado
   ========================================================= */

:root{
  --ios-primary:#0f172a;
  --ios-accent:#d7aa4a;

  --ios-bg:#f5f6f8;
  --ios-surface:#ffffff;
  --ios-surface-soft:#f8fafc;

  --ios-text:#111827;
  --ios-muted:#6b7280;

  --ios-border:rgba(15,23,42,.07);

  --ios-radius-sm:10px;
  --ios-radius:14px;
  --ios-radius-lg:18px;
  --ios-radius-xl:22px;

  --ios-shadow:
    0 4px 18px rgba(15,23,42,.045);

  --ios-shadow-hover:
    0 8px 24px rgba(15,23,42,.08);

  --ink:var(--ios-text);
}


/* =========================
   BASE
   ========================= */

body{
  background:var(--ios-bg);
  color:var(--ios-text);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "SF Pro Text",
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing:antialiased;
}

.content{
  max-width:1800px;
}


/* =========================
   SIDEBAR DESKTOP
   ========================= */

.sidebar{
  background:var(--ios-primary);
  border-right:1px solid rgba(255,255,255,.05);
}

.brand{
  letter-spacing:-.02em;
}

.nav{
  border-radius:12px;
  transition:
    background .18s ease,
    color .18s ease,
    transform .18s ease;
}

.nav:hover{
  transform:translateX(2px);
}

.nav.active{
  background:rgba(255,255,255,.11);
  box-shadow:
    inset 3px 0 0 var(--ios-accent);
}


/* =========================
   TÍTULOS
   ========================= */

.topbar h2,
.employee-head h2,
.company-hero h2{
  letter-spacing:-.025em;
}

.topbar p{
  font-size:14px;
}


/* =========================
   CARDS
   ========================= */

.panel,
.stats article,
.employee-summary article,
.crm-summary article,
.crm-tab-panel,
.company-card{
  background:var(--ios-surface);
  border:1px solid var(--ios-border);
  border-radius:var(--ios-radius-lg);
  box-shadow:var(--ios-shadow);

  transition:
    transform .18s ease,
    box-shadow .18s ease;
}

.stats article:hover,
.employee-summary article:hover{
  transform:translateY(-2px);
  box-shadow:var(--ios-shadow-hover);
}


/* =========================
   ESTATÍSTICAS
   ========================= */

.stats{
  gap:14px;
}

.stats article{
  min-height:116px;
  padding:18px;
}

.stats span{
  font-size:12px;
  font-weight:600;
}

.stats strong{
  font-size:26px;
  letter-spacing:-.035em;
}


/* =========================
   BOTÕES
   ========================= */

.btn{
  min-height:42px;

  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;

  padding:10px 16px;

  border-radius:12px;

  font-weight:650;

  transition:
    transform .13s ease,
    box-shadow .18s ease,
    opacity .18s ease,
    background .18s ease;
}

.btn:hover{
  transform:translateY(-1px);
}

.btn:active{
  transform:scale(.97);
}

.btn.primary,
.primary{
  background:var(--ios-primary);
  color:#fff;

  box-shadow:
    0 4px 12px rgba(15,23,42,.15);
}

.btn.light,
.light{
  background:#fff;
  border:1px solid var(--ios-border);
}

.btn.danger,
.danger{
  background:#fff1f2;
  color:#b42318;
}

.btn.small,
.small{
  min-height:34px;
  border-radius:10px;
}


/* =========================
   FORMULÁRIOS
   ========================= */

input,
select,
textarea{
  min-height:44px;

  padding:10px 13px;

  background:#fff;

  border:1px solid var(--ios-border);
  border-radius:12px;

  transition:
    border .18s ease,
    box-shadow .18s ease;
}

textarea{
  min-height:100px;
}

input:focus,
select:focus,
textarea:focus{
  border-color:rgba(215,170,74,.65);

  box-shadow:
    0 0 0 4px rgba(215,170,74,.12);

  outline:none;
}


/* =========================
   TOOLBARS
   ========================= */

.toolbar{
  align-items:center;
}

.toolbar input{
  background:var(--ios-surface);
}


/* =========================
   TABELAS DESKTOP
   ========================= */

.table-scroll{
  border-radius:var(--ios-radius);
}

table{
  background:#fff;
}

th{
  padding:14px 12px;

  background:#fafbfc;

  color:#7b8493;

  font-size:11px;
  font-weight:700;

  letter-spacing:.03em;
}

td{
  padding:14px 12px;
}

tbody tr{
  transition:background .15s ease;
}

tbody tr:hover{
  background:#fafbfc;
}


/* =========================
   BADGES
   ========================= */

.badge,
.budget-status{
  border-radius:999px;
  font-size:11px;
  font-weight:700;
}


/* =========================
   MODAIS
   ========================= */

dialog{
  border-radius:22px;

  box-shadow:
    0 32px 80px rgba(15,23,42,.25);

  overflow:hidden;
}

dialog::backdrop{
  background:rgba(15,23,42,.45);
  backdrop-filter:blur(3px);
}

.modal-form{
  background:#fff;
}


/* =========================
   CRM
   ========================= */

.crm-dialog{
  border-radius:22px;
}

.crm-head{
  background:var(--ios-primary);
}

.crm-tabs{
  border-color:var(--ios-border);
}

.crm-tabs button{
  transition:color .15s ease;
}

.crm-tabs button.active{
  color:var(--ios-primary);
  border-bottom-color:var(--ios-accent);
}

.crm-field{
  background:#fbfcfd;
  border-color:var(--ios-border);
  border-radius:12px;
}


/* =========================
   EMPRESA
   ========================= */

.company-hero{
  border-radius:22px;

  background:
    linear-gradient(
      135deg,
      #0f172a,
      #202d42
    );

  box-shadow:
    0 12px 30px rgba(15,23,42,.12);
}


/* =========================
   ORÇAMENTOS
   ========================= */

.orcamento-itens-section{
  border-color:var(--ios-border);
  border-radius:16px;
}

.orcamento-total-box{
  border-radius:16px;
}


/* =========================
   MOBILE
   ========================= */

@media(max-width:850px){

  body{
    background:#f5f6f8;
  }

  .content{
    padding:
      14px
      12px
      90px;
  }

  .sidebar{
    position:fixed;

    top:auto;
    bottom:0;
    left:0;
    right:0;

    z-index:999;

    display:block;

    padding:
      7px
      max(8px,env(safe-area-inset-right))
      max(7px,env(safe-area-inset-bottom))
      max(8px,env(safe-area-inset-left));

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

    color:var(--ios-text);

    border-top:1px solid var(--ios-border);

    box-shadow:
      0 -5px 24px rgba(15,23,42,.08);

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

  .sidebar .brand,
  .sidebar-bottom{
    display:none;
  }

  .sidebar nav{
    display:flex;

    gap:4px;

    overflow-x:auto;

    scrollbar-width:none;
  }

  .sidebar nav::-webkit-scrollbar{
    display:none;
  }

  .nav{
    flex:1 0 68px;

    min-width:68px;
    min-height:54px;

    padding:8px 6px;

    text-align:center;

    color:#7b8493;

    background:transparent;

    border-radius:12px;

    font-size:10px;
  }

  .nav:hover{
    transform:none;
  }

  .nav.active{
    color:var(--ios-primary);

    background:rgba(215,170,74,.12);

    box-shadow:none;
  }

  .stats{
    grid-template-columns:
      repeat(2,minmax(0,1fr));

    gap:10px;
  }

  .stats article{
    min-height:105px;

    padding:15px;

    border-radius:16px;
  }

  .stats strong{
    font-size:22px;
  }

  .panel{
    border-radius:16px;
  }

}


/* =========================
   MOBILE PEQUENO
   ========================= */

@media(max-width:520px){

  .content{
    padding-top:12px;
    padding-left:10px;
    padding-right:10px;
  }

  .stats{
    grid-template-columns:
      repeat(2,minmax(0,1fr));
  }

  .stats article{
    min-width:0;
  }

  .stats span{
    font-size:11px;
  }

  .stats strong{
    font-size:20px;
  }

  .toolbar{
    gap:8px;
  }

  .panel{
    padding:13px;
  }

  dialog{
    border-radius:20px;
  }

  .modal-form{
    border-radius:20px;
  }

}


/* =========================
   MICRO INTERAÇÕES
   ========================= */

a,
button{
  -webkit-tap-highlight-color:transparent;
}

button{
  touch-action:manipulation;
}

::selection{
  background:rgba(215,170,74,.25);
}
