/* Thème bleu canard + or rouille. Compatible Safari iOS 10 :
   flexbox avec -webkit-, pas de variables CSS, pas de grid. */
* { -webkit-box-sizing: border-box; box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: #052e38;
  background: -webkit-radial-gradient(18% 0%, ellipse farthest-corner, #0c5160 0%, #073a46 40%, #031f27 100%);
  background: radial-gradient(ellipse farthest-corner at 18% 0%, #0c5160 0%, #073a46 40%, #031f27 100%);
  background-attachment: fixed;
  color: #f4ead8;
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  cursor: default;
  overflow: hidden;
}
#app { height: 100%; padding: 22px 28px 10px; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; }

/* ---------- Haut : heure + météo ---------- */
#top { display: -webkit-flex; display: flex; -webkit-justify-content: space-between; justify-content: space-between; -webkit-align-items: flex-start; align-items: flex-start; }
#clock { font-size: 104px; font-weight: 100; letter-spacing: 3px; line-height: 1; color: #f4ead8; }
#clock .colon { color: #d29a4a; font-weight: 200; }
#clock .sec { font-size: 46px; font-weight: 200; color: #d29a4a; margin-left: 12px; letter-spacing: 1px; }
#date { font-size: 22px; color: #d29a4a; margin-top: 12px; letter-spacing: 3px; text-transform: uppercase; }

#weather { text-align: right; }
#wnow { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: flex-end; justify-content: flex-end; }
#wicon { font-size: 58px; margin-right: 12px; }
#wtemp { font-size: 68px; font-weight: 100; line-height: 1; color: #f4ead8; }
#wdetail { margin-left: 16px; text-align: left; }
#wcity { font-size: 22px; color: #d29a4a; letter-spacing: 2px; text-transform: uppercase; }
#wfeels { font-size: 15px; color: #8fb3b8; margin-top: 5px; }
#wdays { margin-top: 10px; }
.wday { display: inline-block; margin-left: 18px; font-size: 14px; color: #8fb3b8; text-align: center; }
.wday .wd-i { font-size: 24px; display: block; margin: 2px 0; }
.wday b { color: #d29a4a; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Résumé ---------- */
#summary {
  margin-top: 18px; padding: 12px 0; font-size: 21px; color: #f4ead8;
  border-top: 1px solid rgba(210, 154, 74, 0.45);
  border-bottom: 1px solid rgba(210, 154, 74, 0.45);
}
#servers { float: right; font-size: 15px; color: #8fb3b8; }
#servers span { margin-left: 16px; }

.dot { display: inline-block; width: 13px; height: 13px; border-radius: 7px; margin-right: 10px; background: #5f8a91; vertical-align: middle; }
.dot.ok { background: #5fe3b8; }
.dot.warn { background: #ffc247; }
.dot.down { background: #ff6b5e; }
.dot.unknown { background: #5f8a91; }

/* ---------- Widgets ---------- */
#sites {
  -webkit-flex: 1; flex: 1; margin: 12px -8px 0;
  overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap;
  -webkit-align-content: flex-start; align-content: flex-start;
}
.tile { width: 25%; padding: 8px; position: relative; }
.tile-in {
  position: relative; height: 178px; padding: 16px; overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(210, 154, 74, 0.28);
  -webkit-box-shadow: 0 6px 18px rgba(0, 0, 0, 0.30); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.30);
}
.tile.warn .tile-in { background: rgba(255, 194, 71, 0.10); border-color: rgba(255, 194, 71, 0.40); }
.tile.down .tile-in { background: rgba(255, 107, 94, 0.15); border-color: rgba(255, 107, 94, 0.50); }

.t-top { display: -webkit-flex; display: flex; -webkit-justify-content: space-between; justify-content: space-between; -webkit-align-items: flex-start; align-items: flex-start; }
.t-icon {
  width: 52px; height: 52px; border-radius: 26px; text-align: center; font-size: 26px; line-height: 48px;
  background: rgba(210, 154, 74, 0.16); border: 2px solid #5f8a91;
}
.tile.ok .t-icon { border-color: #5fe3b8; }
.tile.warn .t-icon { border-color: #ffc247; }
.tile.down .t-icon { border-color: #ff6b5e; }
.t-dot { width: 14px; height: 14px; margin: 4px 0 0; }
.tile.ok .t-dot { -webkit-box-shadow: 0 0 10px #5fe3b8; box-shadow: 0 0 10px #5fe3b8; }
.tile.down .t-dot { -webkit-box-shadow: 0 0 10px #ff6b5e; box-shadow: 0 0 10px #ff6b5e; }

.t-name { margin-top: 12px; font-size: 20px; font-weight: 600; color: #f4ead8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-status { margin-top: 3px; font-size: 13px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: #8fb3b8; }
.tile.ok .t-status { color: #5fe3b8; }
.tile.warn .t-status { color: #ffc247; }
.tile.down .t-status { color: #ff8a7f; }
.t-meta { margin-top: 3px; font-size: 13px; color: #8fb3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .hist { position: absolute; left: 16px; right: 16px; bottom: 14px; height: 12px; white-space: nowrap; overflow: hidden; }
.tile .hist i { display: inline-block; width: 5px; height: 12px; margin-right: 2px; border-radius: 2px; background: #5fe3b8; }
.tile .hist i.bad { background: #ff6b5e; }

/* Widget en train d'être déplacé */
.tile.dragging { z-index: 50; pointer-events: none; -webkit-transition: none !important; transition: none !important; }
.tile.dragging .tile-in {
  border-color: #d29a4a;
  -webkit-box-shadow: 0 22px 44px rgba(0, 0, 0, 0.60); box-shadow: 0 22px 44px rgba(0, 0, 0, 0.60);
}
#sites.editing .tile { -webkit-tap-highlight-color: transparent; }
#sites.editing .tile:not(.dragging) .tile-in { opacity: 0.88; }

/* ---------- Pied de page ---------- */
#footer { font-size: 13px; color: #5f8a91; padding-top: 6px; }
#errors { color: #ff9a8f; margin-left: 12px; }
#footer.offline #updated { color: #ffc247; }
#reset, #hint { float: right; margin-left: 16px; color: #5f8a91; }
#reset { cursor: pointer; color: #8fb3b8; padding: 4px 0 4px 8px; }

/* Portrait (iPad vertical) : 3 colonnes, textes un peu plus petits */
@media (orientation: portrait) {
  #clock { font-size: 76px; }
  #clock .sec { font-size: 34px; margin-left: 8px; }
  #wtemp { font-size: 54px; }
  .tile { width: 33.333%; }
  .wday { margin-left: 10px; }
}
