/* Aura Cotizador - UI Styles
   Palette:
   - Violet Dark: #5D1DA4
   - Violet Light:#802AC7
   - Off white:   #EFF0F1
*/

:root{
  --bg: #EFF0F1;
  --card: #ffffff;
  --text: #1e1e1e;
  --muted: rgba(30,30,30,.65);

  --violet: #5D1DA4;
  --violet2:#802AC7;

  --border: rgba(0,0,0,.08);
  --shadow: 0 10px 28px rgba(0,0,0,.10);

  --radius: 18px;
  --radius2: 12px;

  --tile-min-h: 96px;

  --focus: 0 0 0 4px rgba(93,29,164,.18);

  --danger: #b42318;
  --ok: #067647;
  --warn: #b54708;

  --fab-size: 58px;
}

/* Dark mode (toggle by adding .theme-dark to body) */
body.theme-dark{
  --bg: #0f0f14;
  --card: #161622;
  --text: #EFF0F1;
  --muted: rgba(239,240,241,.68);
  --border: rgba(255,255,255,.10);
  --shadow: 0 14px 40px rgba(0,0,0,.45);
  --focus: 0 0 0 4px rgba(128,42,199,.22);
}

*{ box-sizing: border-box; }
html, body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

a{ color: inherit; text-decoration:none; }
button, input, select, textarea{ font: inherit; }
img{ max-width:100%; display:block; }
:focus{ outline: none; }
:focus-visible{ box-shadow: var(--focus); border-radius: 10px; }

/* App shell */
#app{ min-height: 100vh; }
.app{ min-height: 100vh; }

/* Loading (index.html fallback) */
.loading{
  min-height: 100vh;
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  gap: 6px;
  color: var(--muted);
}
.loading__title{
  font-weight: 800;
  color: var(--violet);
  letter-spacing: .3px;
}
.loading__sub{
  font-size: 13px;
}

/* Layout container */
.container{
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 14px 110px; /* bottom padding for FAB */
}

/* Topbar */
.topbar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 14px 12px;
  position: sticky;
  top:0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(239,240,241,.92) 0%, rgba(239,240,241,.76) 70%, rgba(239,240,241,0) 100%);
  backdrop-filter: blur(10px);
}

body.theme-dark .topbar{
  background: linear-gradient(180deg, rgba(15,15,20,.92) 0%, rgba(15,15,20,.76) 70%, rgba(15,15,20,0) 100%);
}

.topbar__left{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}

.topbar__brand{
  width: 36px;
  height: 36px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  display:grid;
  place-items:center;
  flex: 0 0 auto;
}

.topbar__logo{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  opacity: .95;
}

.topbar__text{
  display:flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.topbar__title{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .2px;
}

.topbar__subtitle{
  font-size: 12.5px;
  color: var(--muted);
}

.topbar__right{
  display:flex;
  gap: 10px;
  align-items:center;
}

.icon-btn{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.70);
  display:grid;
  place-items:center;
  cursor:pointer;
}
body.theme-dark .icon-btn{
  background: rgba(255,255,255,.06);
}

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

.chip{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.70);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--muted);
}
body.theme-dark .chip{
  background: rgba(255,255,255,.06);
}

/* Grid */
.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}
@media (min-width: 960px){
  .grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Tiles */
.tile{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  padding: 14px 14px;
  min-height: var(--tile-min-h);
  display:flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.tile:active{ transform: translateY(1px); }

.tile__top{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tile__label{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}

.tile__value{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .2px;
}

.tile__icon{
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.02);
}
body.theme-dark .tile__icon{ background: rgba(255,255,255,.04); }

.tile--primary{
  color: #fff;
  border: none;
  background: linear-gradient(135deg, rgba(93,29,164,.98) 0%, rgba(128,42,199,.96) 100%);
  box-shadow: var(--shadow);
}
.tile--primary .tile__label{ color: rgba(255,255,255,.78); }
.tile--primary .tile__icon{
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
}

/* Notifications preview tile (dashboard) */
.notif-list{
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.notif-item{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.55);
}
body.theme-dark .notif-item{
  background: rgba(255,255,255,.05);
}

.notif-item__left{
  display:flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.notif-item__title{
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item__meta{
  font-size: 12px;
  color: var(--muted);
  display:flex;
  gap: 8px;
  align-items:center;
  flex-wrap: wrap;
}
.badge{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  background: rgba(255,255,255,.65);
}
body.theme-dark .badge{ background: rgba(255,255,255,.06); }

.badge--dot::before{
  content:"";
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--violet2);
}

.badge--unread{
  border-color: rgba(128,42,199,.35);
  background: rgba(128,42,199,.10);
  color: rgba(128,42,199,.98);
}

/* Generic cards/pages */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  padding: 14px;
}

.section-title{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin: 18px 0 10px;
}

/* Client name format helper */
.client-name{
  font-weight: 800;
}
.client-id{
  font-style: italic;
  font-weight: 300;
  color: var(--muted);
  margin-left: 6px;
}

/* Lists */
.list{
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.list-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.55);
}
body.theme-dark .list-row{ background: rgba(255,255,255,.05); }

.list-row__left{
  display:flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.list-row__title{
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-row__sub{
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: var(--muted);
}

/* Inputs */
.input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.75);
  color: var(--text);
}
body.theme-dark .input{ background: rgba(255,255,255,.06); }

.input:focus-visible{ box-shadow: var(--focus); }

.row{
  display:flex;
  gap: 10px;
}
.row > *{ flex:1; }
@media (max-width: 520px){
  .row{ flex-direction: column; }
}

/* Buttons */
.btn{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  color: var(--text

  background: rgba(255,255,255,.72);
  color: var(--text);
  padding: 11px 12px;
  border-radius: 14px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  font-weight: 700;
}
body.theme-dark .btn{ background: rgba(255,255,255,.06); }

.btn{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  color: var(--text);
  padding: 11px 12px;
  border-radius: 14px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  font-weight: 700;
}
body.theme-dark .btn{ background: rgba(255,255,255,.06); }

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


.btn--primary{
  border: none;
  background: linear-gradient(135deg, rgba(93,29,164,.98) 0%, rgba(128,42,199,.96) 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn--ghost{
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-weight: 700;
}

.btn--danger{
  border-color: rgba(180,35,24,.35);
  background: rgba(180,35,24,.08);
  color: #ffd7d4;
}
body.theme-dark .btn--danger{
  color: #ffd7d4;
}

/* FAB */
.fab{
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 18px;
  border: none;
  background: var(--violet);
  color: #fff;
  box-shadow: var(--shadow);
  cursor:pointer;
  display:grid;
  place-items:center;
  z-index: 40;
}
.fab:active{ transform: translateY(1px); }
.fab:hover{ filter: brightness(1.03); }

/* Simple modal */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding: 12px;
  z-index: 60;
}
@media (min-width: 720px){
  .modal-backdrop{ align-items: center; }
}

.modal{
  width: 100%;
  max-width: 520px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.modal__title{
  font-weight: 900;
  font-size: 16px;
  margin: 2px 0 10px;
}

.modal__text{
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 12px;
}

.modal__actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal__actions .btn{ flex: 1; }

/* Status pills */
.pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.65);
  color: var(--muted);
}
body.theme-dark .pill{ background: rgba(255,255,255,.06); }

.pill--ok{
  border-color: rgba(6,118,71,.35);
  background: rgba(6,118,71,.10);
  color: rgba(6,118,71,1);
}
.pill--warn{
  border-color: rgba(181,71,8,.35);
  background: rgba(181,71,8,.10);
  color: rgba(181,71,8,1);
}
.pill--danger{
  border-color: rgba(180,35,24,.35);
  background: rgba(180,35,24,.10);
  color: rgba(180,35,24,1);
}

/* Empty states */
.empty{
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  background: rgba(255,255,255,.45);
}
body.theme-dark .empty{ background: rgba(255,255,255,.04); }

.empty__title{
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}
.empty__sub{
  font-size: 13.5px;
}

/* Toast */
.toast{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 88px;
  background: rgba(0,0,0,.82);
  color:#fff;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 80;
  max-width: 92vw;
}

/* Services: nicer primary FAB */
.fab.fab--primary{
  width: 62px;
  height: 62px;
  border-radius: 22px;
  right: 20px;
  bottom: 20px;
  background: linear-gradient(135deg, rgba(93,29,164,.98) 0%, rgba(128,42,199,.96) 100%);
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.22);
}
.fab.fab--primary svg{
  width: 24px;
  height: 24px;
}
