/* 2.0.5 UI polish: less "kansli", more compact */
.td-wrap{
  background: transparent !important;
  border-radius: 0 !important;
}

/* Legacy containers become lighter cards (less padding/radius) */
.td-box{background: var(--td-bg) !important;border: 1px solid rgba(0,0,0,0.06) !important;box-shadow: var(--td-shadow-sm) !important;border-radius: var(--td-radius-md) !important;padding: var(--td-space-4) !important;}

/* Post-it-styling styrs längre ner (ATVOF-tokens). */

/* Tables: reduce heavy lines and padding */
.td-table th,
.td-table td,
.td-items th,
.td-items td{
  border-bottom: 1px solid rgba(0,0,0,0.06) !important;
  padding: 8px 10px !important;
}

/* Mobile: render table rows as compact cards */
@media (max-width: 767px){
  .td-table,
  .td-items{
    border-collapse: separate !important;
    border-spacing: 0 var(--td-space-2) !important;
  }
  .td-table thead,
  .td-items thead{
    display:none !important;
  }
  .td-table tr,
  .td-items tr{
    display:block !important;
    background: var(--td-bg) !important;
    box-shadow: var(--td-shadow-sm) !important;
    border-radius: var(--td-radius-sm) !important;
    padding: var(--td-space-2) var(--td-space-3) !important;
  }
  .td-table td,
  .td-items td{
    display:block !important;
    border-bottom: none !important;
    padding: 4px 0 !important;
  }
}


/* =========================================================
   Träningsdagbok – UI-polish för att matcha ATVOF-mockup
   Fokus: luft, mjuka ytor, zebra istället för hårda linjer,
   post-it som lugn markering, 16px radius på action-knappar.
   ========================================================= */

/* Root + design tokens */
.traningsdagbok,
.td-page{
  --td-text: #1F1F1F;
  --td-text-muted: #6B6B6B;
  --td-bg: #F6F4F1;
  --td-surface: #FFFFFF;
  --td-surface-soft: #EFE9E3;
  --td-border: #DDD6CF;
  --td-accent: #C65A1E;
  --td-accent-hover: #A94D19;
  --td-zebra: #F2EEE9;
  --td-radius-cta:5px;
  --td-radius-action:5px;
  /* Kortbredd/luft: vissa vyer (t.ex. Utvärdera) blev oönskat "smalare" när pad ökades.
     Vi använder 0 som default och lägger luft inuti specifika komponenter vid behov. */
  --td-card-pad: 16px;
  --td-card-pad-mobile: 16px;
  color: var(--td-text);
  box-sizing: border-box;
  overflow-x: hidden; /* fångar breddspill utan att skapa ”ful remsa” */
}

.traningsdagbok *,
.td-page *{
  box-sizing: border-box;
}

/* Container: symmetrisk luft + maxbredd */
.traningsdagbok .td-wrap,
.td-page .td-wrap{
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

@media (max-width: 768px){
  .traningsdagbok .td-wrap,
  .td-page .td-wrap{
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Kort/paneler: konsekvent padding */
.traningsdagbok .td-card,
.traningsdagbok .td-panel,
.traningsdagbok .td-box,
.td-page .td-card,
.td-page .td-panel,
.td-page .td-box,
  background: var(--td-surface);
  border-radius: var(--td-radius-cta);
  padding: var(--td-card-pad);
}

@media (max-width: 768px){
  .traningsdagbok .td-card,
  .traningsdagbok .td-panel,
  .traningsdagbok .td-box,
  .td-page .td-card,
  .td-page .td-panel,
  .td-page .td-box,
    padding: var(--td-card-pad-mobile);
  }
}

/* Post-it: ”Viktigast just nu” */
.traningsdagbok .td-postit,
.traningsdagbok .td-important-now,
.traningsdagbok .td-highlight-note,
.td-page .td-postit,
.td-page .td-important-now,
.td-page .td-highlight-note{
  background: #fefaf1;
  border: 1px solid #efe7d6;
  border-radius: var(--td-radius-action);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* Tabeller/listor: zebra-ränder, minimalt med borders */
.traningsdagbok table,
.td-page table{
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.traningsdagbok table th,
.traningsdagbok table td,
.td-page table th,
.td-page table td{
  padding: 12px 14px;
  vertical-align: middle;
  border: 0 !important;
}

.traningsdagbok table tbody tr:nth-child(even),
.td-page table tbody tr:nth-child(even){
  background-color: var(--td-zebra);
}

.traningsdagbok table tbody tr,
.td-page table tbody tr{
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.04);
}

/* Filterbar / formulär: ingen ram */
.td-wrap .td-filterbar,
.td-wrap form.td-form{
  border: 0 !important;
}

/* Inputs: mjukare */
.traningsdagbok input[type="text"],
.traningsdagbok input[type="search"],
.traningsdagbok select,
.traningsdagbok textarea,
.td-page input[type="text"],
.td-page input[type="search"],
.td-page select,
.td-page textarea{
  border-radius: 12px;
  border: 1px solid var(--td-border);
  background: var(--td-surface);
  padding: 10px 12px;
}

.traningsdagbok input[type="text"]:focus,
.traningsdagbok input[type="search"]:focus,
.traningsdagbok select:focus,
.traningsdagbok textarea:focus,
.td-page input[type="text"]:focus,
.td-page input[type="search"]:focus,
.td-page select:focus,
.td-page textarea:focus{
  outline: 2px solid rgba(198,90,30,0.25);
  outline-offset: 2px;
}

/* Knappar i TD: 16px radie (globala CTA hanteras via tema/CTA-regel) */
.traningsdagbok button,
.traningsdagbok .button,
.traningsdagbok a.button,
.traningsdagbok .elementor-button,
.td-page button,
.td-page .button,
.td-page a.button,
.td-page .elementor-button{
  border-radius: var(--td-radius-action) !important;
}

/* Bilder/tabeller ska aldrig spilla ut */
.traningsdagbok img,
.traningsdagbok table,
.td-page img,
.td-page table{
  max-width: 100%;
}


/* =========================================================
   WooCommerce – ATVOF cleanup (sitewide)
   ========================================================= */

/* Stoppa “Title Case” / text-transform: capitalize */
.woocommerce h1,
.woocommerce h2,
.woocommerce h3,
.woocommerce h4,
.woocommerce h5,
.woocommerce h6,
.woocommerce .product_title,
.woocommerce .woocommerce-products-header__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce .related > h2,
.woocommerce .upsells > h2,
.woocommerce .cross-sells > h2{
  text-transform: none;
}

.traningsdagbok .woocommerce a.button,
.traningsdagbok .woocommerce button.button,
.traningsdagbok .woocommerce input.button,
.traningsdagbok .woocommerce button.single_add_to_cart_button,
.traningsdagbok .woocommerce a.checkout-button,
.td-page .woocommerce a.button,
.td-page .woocommerce button.button,
.td-page .woocommerce input.button,
.td-page .woocommerce button.single_add_to_cart_button,
.td-page .woocommerce a.checkout-button{
  text-transform: none;
}

/* Produktsidan: Tabs */
.woocommerce div.product .woocommerce-tabs{
  background: transparent;
  border: 0;
  margin-top: 24px;
}

.woocommerce div.product .woocommerce-tabs ul.tabs{
  margin: 0 0 16px 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li{
  border: 0;
  background: transparent;
  margin: 0 8px 0 0;
  padding: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a{
  display: inline-block;
  padding: 10px 14px;
  border-radius: 16px;
  color: #1F1F1F;
  background: #EFE9E3;
  text-decoration: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a{
  background: #FFFFFF;
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

.woocommerce div.product .woocommerce-tabs .panel{
  background: #FFFFFF;
  border-radius: 24px;
  padding: 24px;
  border: 1px solid #DDD6CF;
  margin: 0;
}

.woocommerce div.product .woocommerce-tabs .panel h2,
.woocommerce div.product .woocommerce-tabs .panel h3{
  margin-top: 0;
  margin-bottom: 12px;
  text-transform: none;
}

/* Woo-knappar (ATVOF-stil) – endast i TD-skal */
.traningsdagbok .woocommerce a.button,
.traningsdagbok .woocommerce button.button,
.traningsdagbok .woocommerce input.button,
.traningsdagbok .woocommerce #respond input#submit,
.traningsdagbok .woocommerce a.add_to_cart_button,
.traningsdagbok .woocommerce button.single_add_to_cart_button,
.traningsdagbok .woocommerce a.checkout-button,
.td-page .woocommerce a.button,
.td-page .woocommerce button.button,
.td-page .woocommerce input.button,
.td-page .woocommerce #respond input#submit,
.td-page .woocommerce a.add_to_cart_button,
.td-page .woocommerce button.single_add_to_cart_button,
.td-page .woocommerce a.checkout-button{
  border-radius: var(--td-radius-action);
  padding: 14px 28px;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.3px;
  background: #C65A1E;
  color: #FFFFFF;
  border: 0;
  box-shadow: none;
  text-decoration: none;
}

.traningsdagbok .woocommerce a.button:hover,
.traningsdagbok .woocommerce button.button:hover,
.traningsdagbok .woocommerce input.button:hover,
.traningsdagbok .woocommerce #respond input#submit:hover,
.traningsdagbok .woocommerce a.add_to_cart_button:hover,
.traningsdagbok .woocommerce button.single_add_to_cart_button:hover,
.traningsdagbok .woocommerce a.checkout-button:hover,
.td-page .woocommerce a.button:hover,
.td-page .woocommerce button.button:hover,
.td-page .woocommerce input.button:hover,
.td-page .woocommerce #respond input#submit:hover,
.td-page .woocommerce a.add_to_cart_button:hover,
.td-page .woocommerce button.single_add_to_cart_button:hover,
.td-page .woocommerce a.checkout-button:hover{
  background: #A94D19;
  color: #FFFFFF;
}

.traningsdagbok .woocommerce a.button.alt,
.traningsdagbok .woocommerce button.button.alt,
.traningsdagbok .woocommerce input.button.alt,
.td-page .woocommerce a.button.alt,
.td-page .woocommerce button.button.alt,
.td-page .woocommerce input.button.alt{
  background: transparent;
  color: #C65A1E;
  border: 2px solid #C65A1E;
}

.traningsdagbok .woocommerce a.button.alt:hover,
.traningsdagbok .woocommerce button.button.alt:hover,
.traningsdagbok .woocommerce input.button.alt:hover,
.td-page .woocommerce a.button.alt:hover,
.td-page .woocommerce button.button.alt:hover,
.td-page .woocommerce input.button.alt:hover{
  background: #C65A1E;
  color: #FFFFFF;
}

.woocommerce .product_meta,
.woocommerce div.product form.cart{
  border: 0;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price{
  color: #1F1F1F;
}


/* =========================================================
   Träningsdagbok – ATVOF-mockup (styrande overrides)
   Lämnas sist i filen för att vinna över tidigare regler.
   ========================================================= */

/* Root-variabler enligt mockup */
.traningsdagbok.td-page,
.traningsdagbok{
  --td-text: #1F1F1F;
  --td-text-muted: #6B6B6B;

  --td-bg: #F6F4F1;
  --td-surface: #FFFFFF;
  --td-surface-soft: #EFE9E3;
  --td-border: #DDD6CF;

  --td-accent: #C65A1E;
  --td-accent-hover: #A94D19;

  --td-zebra: #F2EEE9;

  --td-radius-cta:5px;
  --td-radius-action:5px;
  --td-card-pad: 16px;
  --td-card-pad-mobile: 16px;
}

/* Ta bort "död yta" och gör symmetrisk container */
.traningsdagbok.td-page{overflow-x:hidden;box-sizing:border-box;}
.traningsdagbok.td-page *{box-sizing:border-box;}

.traningsdagbok.td-page .td-container{
  max-width:1140px;
  margin-left:auto;
  margin-right:auto;
  padding-left:24px;
  padding-right:24px;
}

@media (max-width:768px){
  .traningsdagbok.td-page .td-container{padding-left:16px;padding-right:16px;}
}

.td-plan-this-week{margin:0 0 16px;}
/* Planera: undvik td-section-padding som gör inner-korten smalare än rubrikerna */
.td-plan-this-week{background:transparent !important;padding:0 !important;border-radius:0 !important;}

/* Kort/paneler: konsekvent luft (inte på layout-wrappers som .td-section/.td-widget) */
.traningsdagbok.td-page .td-card,
.traningsdagbok.td-page .td-panel,
.traningsdagbok.td-page .td-box{
  background: var(--td-surface);
  border-radius: var(--td-radius-cta);
  padding: var(--td-card-pad);
}

@media (max-width:768px){
  .traningsdagbok.td-page .td-card,
  .traningsdagbok.td-page .td-panel,
  .traningsdagbok.td-page .td-box{padding: var(--td-card-pad-mobile);}  
}

/* Post-it (Viktigast just nu) */
.traningsdagbok.td-page .td-postit,
.traningsdagbok.td-page .td-important-now,
.traningsdagbok.td-page .td-highlight-note{
  background:#FFF6CC !important;
  border:1px solid #E6D8A8 !important;
  color:#1F1F1F;
  border-radius: var(--td-radius-action) !important;
  padding: var(--td-card-pad);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

@media (max-width:768px){
  .traningsdagbok.td-page .td-postit,
  .traningsdagbok.td-page .td-important-now,
  .traningsdagbok.td-page .td-highlight-note{padding: var(--td-card-pad-mobile);}  
}

/* Tabeller: zebra istället för hårda linjer */
.traningsdagbok.td-page table,
.traningsdagbok.td-page table th,
.traningsdagbok.td-page table td{border:0 !important;}

.traningsdagbok.td-page table{border-collapse:separate;border-spacing:0;width:100%;}
.traningsdagbok.td-page table th,
.traningsdagbok.td-page table td{padding:12px 14px;vertical-align:middle;}
.traningsdagbok.td-page table tbody tr:nth-child(even){background-color:var(--td-zebra);}
.traningsdagbok.td-page table tbody tr{box-shadow: inset 0 -1px 0 rgba(0,0,0,0.04);}

/* Inputs */
.traningsdagbok.td-page input[type="text"],
.traningsdagbok.td-page input[type="search"],
.traningsdagbok.td-page select,
.traningsdagbok.td-page textarea{
  border-radius:12px;
  border:1px solid var(--td-border);
  background:var(--td-surface);
  padding:10px 12px;
}

.traningsdagbok.td-page input[type="text"]:focus,
.traningsdagbok.td-page input[type="search"]:focus,
.traningsdagbok.td-page select:focus,
.traningsdagbok.td-page textarea:focus{
  outline:2px solid rgba(198,90,30,0.25);
  outline-offset:2px;
}

/* Action-knappar i TD ska vara 16px */
.traningsdagbok.td-page button,
.traningsdagbok.td-page .button,
.traningsdagbok.td-page a.button,
.traningsdagbok.td-page .elementor-button,
.traningsdagbok.td-page .td-action-button,
.traningsdagbok.td-page .td-icon-button{border-radius:var(--td-radius-action) !important;}

/* Fix: grå "ram" (filter/form-paneler) – ska inte ha border */
.traningsdagbok.td-page .td-wrap .td-filterbar,
.traningsdagbok.td-page .td-wrap form.td-form{
  border:0 !important;
}

/* Fix: breddspill som skapar ojämna kanter */
.traningsdagbok.td-page img,
.traningsdagbok.td-page table{max-width:100%;}


/* 1333/1351: Förbättringsförslag – pyjamasränder som i listvy (varannan rad = egen bakgrund) */
.td-suggestions-cards{display:block;margin-top:12px;}
.td-suggestions-cards .td-card--suggestion{margin:0 !important;border:0 !important;box-shadow:none !important;border-radius:0 !important;background:transparent !important;padding:12px 14px !important;}
.td-suggestions-cards .td-card--suggestion:nth-child(even){background:rgba(0,0,0,0.04) !important;}
.td-suggestions-cards .td-card--suggestion:first-child{border-top-left-radius:10px !important;border-top-right-radius:10px !important;}
.td-suggestions-cards .td-card--suggestion:last-child{border-bottom-left-radius:10px !important;border-bottom-right-radius:10px !important;}

/* 1343: Q&A – pyjamasränder för "Mina frågor" (samma beteende som förbättringsförslag). */
.td-qa-cards{display:block;margin-top:12px;}
.td-qa-cards .td-card--qa{margin:0 !important;border:0 !important;box-shadow:none !important;border-radius:0 !important;background:transparent !important;padding:12px 14px !important;}
.td-qa-cards .td-card--qa:nth-child(even){background:rgba(0,0,0,0.04) !important;}
.td-qa-cards .td-card--qa:first-child{border-top-left-radius:10px !important;border-top-right-radius:10px !important;}
.td-qa-cards .td-card--qa:last-child{border-bottom-left-radius:10px !important;border-bottom-right-radius:10px !important;}
.td-card--suggestion .td-card__meta{margin-top:6px;font-size:14px;display:flex;flex-wrap:wrap;gap:6px;align-items:center;}
.td-card--suggestion .td-card__sep{opacity:.6;margin:0 4px;}
.td-card--suggestion .td-card__desc{margin-top:10px;white-space:pre-wrap;}

/* 1336: Delningsstatus-ikoner i listvy – gör status + kopiera identiska (ingen ram/bakgrund) */
.td-share-meta .td-icon-btn{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  padding:0 !important;
  min-width:auto !important;
  min-height:auto !important;
  width:auto !important;
  height:auto !important;
  border-radius:0 !important;
}
.td-share-meta .dashicons{font-size:18px;line-height:1;}

/* Enhetlig sidrubrik/struktur (vyer) */
.td-main { display: block; }
.td-main__header { margin: 16px 0 12px; }
.td-main__title { margin: 0; font-size: 22px; line-height: 1.2; }
.td-main__body { display: block; }


/* 1457: jämna ut vertikala avstånd mellan kort på Träna/Utvärdera/Planera */
.td-train-v1 .td-card,
.td-eval-v1 .td-card,
.td-plan-v1 .td-card{
  margin-top:10px !important;
  margin-bottom:10px !important;
}



/* Planera: kort ska linjera med rubriker (inga extra sidopaddings på wrappers) */
.td-plan-v1 .td-section{padding-left:0 !important;padding-right:0 !important;}
.td-plan-v1 .td-card{width:100% !important;max-width:none !important;box-sizing:border-box;}

/* Spacing: standardisera avstånd mellan toppkort på Träna/Utvärdera/Planera */
.td-plan-v1 > .td-card,
.td-train-v1 > .td-card,
.td-eval-v1 > .td-card{margin-top:16px !important;margin-bottom:16px !important;}


/* Planera: sektion-stack utan extra indrag och med jämna mellanrum */
.td-plan-section{margin:16px 0 !important;padding:0 !important;}
.td-plan-v1 .td-plan-this-week{margin:0 !important;padding:0 !important;}
.td-plan-v1 .td-plan-this-week > .td-card{margin:16px 0 !important;}

.td-plan-v1 .td-section--plan{margin:0 !important;padding:0 !important;max-width:none !important;}

/* Mallar: se till att dashicons inte blir nedärvt osynligt */
.td-create-item-actions .td-icon-btn{color:var(--td-primary) !important;}



.td-create-item-actions{
  display:grid !important;
  grid-template-columns: 40px 40px !important;
  gap:8px !important;
  justify-content:end !important;
  align-items:center !important;
}




/* Mallar: radlayout (titel + actions) – ersätter td-row (flex) för stabilt grid */
.td-create-picker .td-create-item-row{
  display:grid !important;
  grid-template-columns: 1fr 96px !important;
  align-items:center !important;
  gap:12px !important;
}

/* Mallar: actions i två fasta kolumner (pdf + skapa) */
.td-create-picker .td-create-item-actions{
  display:grid !important;
  grid-template-columns: 44px 44px !important;
  gap:8px !important;
  justify-content:end !important;
  align-items:center !important;
}

/* Ikonknappar: samma storlek och centrerad ikon */
.td-create-picker .td-icon-btn{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:44px !important;
  height:44px !important;
  line-height:1 !important;
}




/* Mallar (desktop): om td-row (flex) ändå ligger kvar, tvinga grid med högre specificitet */
.td-create-picker .td-row.td-create-item-row{
  display:grid !important;
  grid-template-columns: 1fr 96px !important;
  align-items:center !important;
  gap:12px !important;
}



/* Mallar: tvinga actions till högerkant även om row blir flex av tema */
.td-create-picker .td-create-item-row{justify-content:space-between !important;}


/* Dashboard views: add safe side padding so cards don’t touch screen edges on mobile.
   Evaluate has its own layout; avoid double-padding there. */
body.td-page.td-hide-theme-chrome.td-has-dashboard:not(.td-view-evaluate) .td-main{
  padding-left: var(--td-space-4);
  padding-right: var(--td-space-4);
}



/* ===== TD layout gutters (avoid Elementor double padding) ===== */
html.td-page { --td-page-gutter: 16px; }
@media (min-width: 769px) {
  html.td-page { --td-page-gutter: 24px; }
}

/* Keep outer wrapper centered, but do NOT add padding here (Elementor often already adds it). */
.traningsdagbok.td-page .td-wrap{
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}

/* Apply gutters on the TD main element when it exists (most app views). */
.traningsdagbok.td-page .td-main{
  padding-left: var(--td-page-gutter) !important;
  padding-right: var(--td-page-gutter) !important;
  box-sizing: border-box;
}

/* Elementor pages often already have padding on the widget/container.
   Avoid double gutters on mobile ("för mycket indrag"). */
body.elementor-page .traningsdagbok.td-page .td-main{
  padding-left: 0 !important;
  padding-right: 0 !important;
}


/* 1481: Veckoplanering form/edit – håll övningar + veckans träningspass i samma visuella kort. */
.td-weekplan-inline-note,
.td-weekplan-inline-section{
  margin: 12px 0 !important;
  padding: 12px 0 0 !important;
  border-top: 1px solid rgba(0,0,0,.08);
}

.td-weekplan-inline-section > h3,
.td-weekplan-inline-note > strong{
  display:block;
  margin:0 0 8px 0;
}

.td-weekplan-inline-section .td-muted,
.td-weekplan-inline-note .td-muted{
  margin-top: 6px;
}

.td-weekplan-exercises-inline ul,
.td-weekplan-trainingpasses-inline ul{
  margin-bottom: 0;
}

/* 1621: weekplan/freetext – inline sektioner och visningsblock ska ligga i samma visuella kort */
.td-weekplan-inline-section,
.td-weekplan-inline-note,
.td-weekplan-exercises-view{
  grid-column: 1 / -1;
  width: 100%;
}

.td-weekplan-inline-note,
.td-weekplan-exercises-view,
#td-weekplan-trainingpasses.td-weekplan-inline-section,
#td-weekplan-exercises.td-weekplan-inline-section{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.td-entry-answer-block{
  padding: 12px 0;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.td-entry-answer-block:first-of-type{
  border-top: 0;
  padding-top: 0;
}

.td-entry-answer-block__answer > :first-child{margin-top:0;}
.td-entry-answer-block__answer > :last-child{margin-bottom:0;}
