/* ***********
  Admin Panel CSS
  Aufgeräumt & strukturiert
************* */

@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700');

/* ================================
   Root / Farben / Variablen
================================ */
:root {
  --drawer: #16191C;
  --text-primary: #FFFFFF;
  --text-secondary: #86909A;
  --text-faded: #C3C5C7;
  --background-primary: #22272B;
  --background-secondary: #374148;
  --background-secondary-faded: rgba(55,65,72,0.5);
  --background-card: #2C343A;
  --accent-primary: rgba(54,80,209,1);
  --accent-primary-faded: rgba(54,80,209,0.5);
  --accent-primary-transparent: rgba(54,80,209,0);
  --status-red: #EF4836;
  --status-green: #36D744;
  --status-orange: #ff6700;
}

/* ================================
   Scrollbar
================================ */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-thumb {
  background: #e1e1e1;
  border-radius: 50px;
}
::-webkit-scrollbar-thumb:hover { background: #ffffff; }
::-webkit-scrollbar-thumb:active { background: #16191C; }
::-webkit-scrollbar-track {
  background: rgba(102,102,102,0.3);
  border-radius: 50px;
}
::-webkit-scrollbar-track:hover { background: #666; }
::-webkit-scrollbar-track:active { background: #333; }

/* ================================
   Grundlayout
================================ */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Open Sans', sans-serif;
  color: var(--text-primary);
  overflow: hidden;
  line-height: 1.6;
}

.container {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  flex-direction: row;
  position: relative;
}

/* ================================
   Drawer / Sidebar Navigation
================================ */
.container .drawer {
  width: 100px;
  height: 100%;
  background: var(--drawer);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 1px 0 3px rgba(0,0,0,0.16);
  z-index: 2;
}

.drawer .navicon,
.drawer .menu a {
  display: block;
  width: 100px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  font-size: 25px;
  color: var(--text-primary);
  opacity: 0.6;
  transition: all 0.22s ease;
}

.drawer .navicon:hover,
.drawer .menu a:hover { opacity: 1; }

.drawer .menu a.active {
  opacity: 1;
  pointer-events: none;
  cursor: default;
}

.drawer .menu a i { display: block; margin: 0 auto; width: 50px; border-radius: 2px; }
.drawer .menu a.active i { background: var(--accent-primary); animation: fadeIn 0.3s ease-out 1; }

.drawer .credits {
  padding: 20px 0;
  text-align: center;
  font-size: 10px;
  opacity: 0.4;
  cursor: default;
}

/* ================================
   Content
================================ */
.container .content {
  flex-grow: 1;
  height: 100%;
  background: var(--background-primary);
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.page {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 30px;
  transform: scale(1.3);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page.active {
  top: 0;
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.page.noflex { display: block; }

/* ================================
   Header
================================ */
.page > .header {
  width: 100%;
  height: 120px;
  padding: 0 40px;
  box-sizing: border-box;
}

.header .title h2 {
  line-height: 120px;
  margin: 0;
  font-weight: 200;
}

/* ================================
   Grid & Cards
================================ */
.page .grid {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 0 40px;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.card {
  width: 350px;
  height: 250px;
  background: var(--background-card);
  margin-right: 20px;
  padding: 20px 20px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card.wide { width: 650px; }

.card .head {
  display: flex;
  align-items: center;
  height: 75px;
}

.card .head h4 {
  padding: 0 50px;
}

.card .head .icon {
  width: 75px;
  height: 75px;
  line-height: 75px;
  text-align: center;
  background: var(--accent-primary);
  font-size: 1.2em;
}

.card .head .status {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--status-orange);
  display: inline-block;
}

.card .head .status.online { background: var(--status-green); }
.card .head .status.offline { background: var(--status-red); }

.card .body h2 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 30px;
  text-transform: uppercase;
}

.card .body p {
  margin: -5px 0 0;
  font-size: 16px;
  color: var(--text-faded);
}

.card a.download {
  display: inline-block;
  padding: 0 10px;
  height: 32px;
  line-height: 32px;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--status-green);
  opacity: 0.8;
  border-radius: 1px;
  transition: all 0.2s ease;
}
.card a.download:hover { opacity: 1; }

/* ================================
   Traders Tabelle
================================ */
[data-page="trader"] .grid { display: block; padding: 0 40px; overflow-x: auto; }
.traders-table {
  display: table;
  width: 100%;
  background: var(--background-card);
  border-radius: 3px;
  overflow: hidden;
}
.traders-item {
  display: table-row;
  height: 50px;
}
.traders-item.header {
  background: var(--background-secondary);
  text-transform: uppercase;
  user-select: none;
}
.traders-item .table-item {
  display: table-cell;
  padding: 0 10px;
  line-height: 50px;
  color: var(--text-primary);
  cursor: pointer;
  text-overflow: ellipsis;
}
.traders-item:hover .table-item { background: var(--background-secondary-faded); }
.table-item.noflex { width: 40px; }

/* ================================
   Dialog
================================ */
.dialog {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background: rgba(34,39,43,0);
  transition: all 0.22s ease;
  z-index: 1000;
}

.dialog.active {
  pointer-events: auto;
  background: rgba(34,39,43,0.65);
}

.dialog-block {
  width: 450px;
  height: 350px;
  padding: 25px;
  background: var(--background-primary);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 3px 6px rgba(0,0,0,0.16);
  transition: all 0.22s 0.3s ease;
  border-radius: 3px;
}

.dialog.active .dialog-block { transform: translate(-50%, -50%) scale(1); }

.dialog-block h2 {
  text-align: center;
  line-height: 45px;
  font-weight: 300;
}

/* ================================
   Animationen
================================ */
@keyframes fadeIn {
  0% { background: var(--accent-primary-transparent); }
  100% { background: var(--accent-primary); }
}

/* ================================
   Lieferanten hinzufügen Button
================================ */
.button-add-supplier {
  display: inline-block;
  padding: 0 15px;
  margin: 0 0 20px 40px;
  height: 32px;
  line-height: 32px;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--accent-primary);
  opacity: 0.8;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  transition: all 0.2s ease;
  cursor: pointer;
}

.button-add-supplier:hover {
  opacity: 1;
  background: var(--accent-primary-faded);
}


.dialog .edit-form input {
  width: 100%;
  padding: 10px;
  margin: 7px 0;
  background: var(--background-secondary);
  border: none;
  border-radius: 3px;
  color: var(--text-primary);
  font-size: 14px;
  box-sizing: border-box;
}


/* Popup Buttons */
.dialog .controls .button {
  display: inline-block;
  padding: 0 15px;
  height: 32px;
  line-height: 32px;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--accent-primary);
  opacity: 0.8;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  margin: 10px 0;
  transition: all 0.2s ease;
  cursor: pointer;
}

.dialog .controls {
  display: flex;
  justify-content: space-between;
}

.dialog .controls .button:hover {
  opacity: 1;
  background: var(--accent-primary-faded);
}

/* Abbrechen-Button abheben */
.dialog .controls .button[data-dialog-action="cancel"] {
  background: var(--status-red);
  opacity: 0.8;
}

.dialog .controls .button[data-dialog-action="cancel"]:hover {
  background: rgba(239, 72, 54, 0.6);
  opacity: 1;
}

/* Button Server hinzufügen */
.button-add-server {
  display: inline-block;
  padding: 0 15px;
  height: 32px;
  line-height: 32px;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--accent-primary);
  opacity: 0.8;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  transition: all 0.2s ease;
  cursor: pointer;
}

.page > .header {
  display: flex;
  align-items: center;
  justify-content: space-between; /* H2 links, Button rechts */
  width: 100%;
  height: 120px;
  padding: 0 40px;
  box-sizing: border-box;
}
