/* Minimal modern responsive styles */
:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --accent:#293C7B;
  --accent_muted:#2980b9;
  --accent_green:#27ae60;  
  --attention:#d9534f;  
  --muted:#6c757d;
  --radius:10px;
}
*{box-sizing:border-box}
a {text-decoration: none;}
body{font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial; margin:0;background:var(--bg);color:#111}
.container{max-width:980px;margin:20px auto;padding:16px}
.card{background:var(--card);padding:16px;border-radius:var(--radius);box-shadow:0 6px 18px rgba(15,15,15,0.20)}
header{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}
.logo-img-login {height: 100px;width: auto;display: block;}
.logo-img {height: 50px;width: auto;display: block;}
h1{font-size:1.25rem;margin:0}
.small{color:var(--muted);font-size:0.9rem}
.small_grey{color:var(--muted);font-size:0.7rem}
form label{display:block;margin-bottom:10px;font-size:0.95rem}
/*ALT  input[type="text"],input[type="email"],input[type="password"],input[type="number"],input[type="datetime-local"],input[type="date"],select,textarea{width:100%;padding:10px;border:1px solid #e3e6ea;border-radius:8px;background:#fff;font-size:1rem}*/
input,select,textarea{width:100%;padding:8px;border:1px solid #e3e6ea;border-radius:8px;background:#fff;font-family: inherit;font-size:1rem}
button{background:var(--accent);color:#fff;padding:10px 14px;border:none;border-radius:8px;cursor:pointer}
button.secondary{background: none;color:var(--accent);font-size:0.8rem;padding:5px;}
button.kassenschnitt{padding:5px 14px;border-radius:5px;background:var(--accent_green);}
button.small_danger{background:#fff;color:var(--attention)}
.btn-admin{padding:4px 14px;border-radius:5px;background:#5b5c5c; color:#fff;font-size:0.7rem;text-decoration:none}
.btn-dashboard{padding:8px 14px;border-radius:5px;border:1px solid #e3e6ea;background:#ffffff; color:#000;font-size:0.7rem;text-decoration:none}
[class^="btn-"]:hover{filter: brightness(0.80)}
.button-container {display:flex;flex-wrap:wrap;gap:10px;align-items:center}
table{width:100%;border-collapse:collapse;margin-top:10px}
th,td{padding:4px;border-bottom:1px solid #eef2f6;text-align:left;font-size:0.7rem;}
th{background:#fbfcfe;font-weight:600}
tbody tr:hover {background-color: #f0f7ff !important; transition: background-color 0.2s ease;}

.tp-modern-table th {
    background: #fcfcfc;
    padding: 12px 15px;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #eee;
}

/*Fehleranzeige in Tabellenzeilen*/
.row-error {background-color: rgba(255, 0, 0, 0.05) !important;}
/* Optional: Ein roter linker Rand für noch mehr Fokus */
.row-error td:first-child {border-left: 4px solid #dc3545;}
.actions a{margin-right:8px;color:var(--accent);text-decoration:none}
.flex{display:flex;gap:8px;margin-top: 10px;align-items:center}

/* Payment method button group */
.payment-methods{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0}
.pm-btn{padding:10px 14px;border-radius:8px;border:1px solid #e3e6ea;background:#fff;cursor:pointer;font-weight:600;color:#222}
.pm-btn.active{background:var(--accent);color:#fff;border-color:var(--accent);box-shadow:0 2px 6px rgba(0,0,0,0.15)}

@media (max-width:420px){
  .pm-btn{flex:1;padding:12px;text-align:center}
}

/* Hour selection grid for small screens */
.hour-grid{display:none;margin:8px 0;gap:8px}
.hour-grid .hour-btn{padding:10px 2px;border-radius:8px;border:1px solid #e3e6ea;background:#fff;cursor:pointer;font-weight:600;color:#222;flex:1;text-align:center}
.hour-grid .hour-row{display:flex;gap:5px;padding:2px}
.hour-grid .hour-btn.future{background:#f0f0f0;color:#8a8a8a;border-color:#e6e6e6}
.hour-grid .hour-btn.active{background:var(--accent);color:#fff;border-color:var(--accent);box-shadow:0 2px 6px rgba(0,0,0,0.15)}
.hour-grid .hour-btn.current{background:var(--accent_green);;color:#fff;border-color:var(--accent_green);}
.hour-grid .hour-btn.current.active{background:var(--accent);color:#fff;border-color:var(--accent_green);}


/* show a simple booking-time label on small screens */
.booking-time-label{display:none;margin-bottom:6px}
@media (max-width:768px){
  .booking-time-label{display:block}
  .datetime-label{display:none}
}

/*Error Overlay*/
.overlay-error {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999;
}
.overlay-content {
    background: white;
    padding: 20px;
    margin: 10px;
    border-radius:var(--radius);
    text-align: center;
    max-width: 400px;
    border: 3px solid var(--attention);
}
.overlay-content button {
    background: var(--attention);
    color: white;
    border: none;
    padding: 10px 20px;
    margin-top: 15px;
    cursor: pointer;
    border-radius: 5px;
}
.error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23fdeaea'/%3E%3Cpath d='M8 8L16 16M16 8L8 16' stroke='%23d9534f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

/*Link Icons zb Download*/
.icon-link {
    background: none !important; /*damit es bei allen buttons geht!*/
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color:var(--accent);
    transition: all 0.2s ease;
    padding: 5px;
    border-radius: 4px;
    text-decoration: none;
}
.icon-link:hover {
    color:var(--accent_muted); /* Etwas dunkler beim Hover */
    background-color: rgba(52, 152, 219, 0.1)!important; /* Zarter blauer Hintergrund */
    transform: translateY(-2px); /* Kleiner "Lift"-Effekt */
}
/* Falls der Vertrag fehlt, kannst du das Icon grau färben */
.icon-disabled {
    color: #bdc3c7;
    cursor: not-allowed;
}
/*BEISPIEL:
<td data-label="Vertrag">
    <?php if (!empty($user['contract'])): ?>
        <a href="uploads/contracts/<?= htmlspecialchars($user['contract']) ?>" class="icon-link" title="Vertrag laden" download>
            <svg ... > </svg>
        </a>
    <?php else: ?>
        <span class="icon-disabled" title="Kein Vertrag hinterlegt">❌</span>
    <?php endif; ?>
</td>*/

/* Basis-Stil für alle Icon-Links */

/*.link-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color:var(--accent_muted);
    transition: all 0.2s ease;
}*/

/* Spezifischer adressieren, um andere Regeln zu überschreiben */
li a.link-with-icon {
    display: inline-flex !important; 
    align-items: center !important;
    gap: 10px !important; /* Teste es mit 10px, um den Unterschied zu sehen */
    text-decoration: none;
}

/* Verhindert, dass das SVG kollabiert */
.link-with-icon svg {
    display: inline-block;
    flex-shrink: 0;
    margin: 0; /* Verhindert ungewollte Abstände aus anderen Regeln */
}

/* Hover-Effekt: Der Pfeil bewegt sich leicht */
.link-with-icon:hover {
    color:var(--accent_green);
}

.link-with-icon:hover svg {
    transform: translate(2px, -2px); /* Leicht nach rechts und oben */
}

/* Speziell für den internen Pfeil: Nur nach rechts schieben */
.link-internal:hover svg {
    transform: translateX(3px);
}

/* Farben für die Datumsanzeige */
.date-today {
    color:var(--accent_green);
    font-weight: bold;
}

.date-yesterday {
    color:var(--accent_muted); 
    font-weight: bold;
}

.date-default {
    color: #7f8c8d;
}

.date-empty {
    color: #bdc3c7;
}

.help-section { margin-top: 20px; }
.help-item { 
    background: #f9f9f9; 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 10px; 
    cursor: pointer;
    border: 1px solid #eee;
}
.help-item summary { list-style: none; outline: none; }
.help-item p { margin-top: 10px; line-height: 1.5; color: #555; }
.help-item[open] { background: #fff; border-color: #007bff; }

/* Badges & Status */
.tp-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #ccc; }
.tp-status-dot.is-active { background: #27ae60; }

.tp-badge-type {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}
.tp-badge-type.pro { background: #e3f2fd; color: #007bff; }
.tp-badge-type.junior { background: #fff3e0; color: #fd7e14; }
.tp-badge-type.base { background: #f5f5f5; color: #666; }


/* Upload Kreis Loader Overlay */
#loader-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.7); z-index: 2000; text-align: center; padding-top: 20%; }
.spinner { width: 50px; height: 50px; border: 5px solid #f3f3f3; border-top: 5px solid #5b5c5c; border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }


/*++++++++++++++++++++++++++++
NAVIGATIONSMENÜ STYLES
++++++++++++++++++++++++++++*/

/* simple top nav */
.nav{display:flex;gap:8px}
.nav a{color:var(--accent);text-decoration:none;font-weight:600}

.menu-btn, .menu-btn-adm {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  background: transparent; /* Hintergrund entfernt */
  border: none;
  cursor: pointer;
  padding: 5px;
  transition: transform 0.2s ease;
}

@media (hover: hover) {
    .menu-btn:hover, .menu-btn-adm:hover {
        transform: scale(1.1);
    }
}

.menu-btn:active .menu-icon {
    box-shadow: 0 0 0 10px rgba(27, 122, 42, 0.2); /* Kurzer grüner Schein */
    border-radius: 50%;
    transition: box-shadow 0.2s ease;
}

.menu-icon {
  width: 40px;  /* Hier kannst du die Größe deines Icons anpassen */
  height: 40px;
  object-fit: contain;
  display: block;
}

.side-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    
    /* WICHTIG: Die Höhe begrenzen */
    height: 100vh; /* Nutzt die volle verfügbare Bildschirmhöhe */
    
    /* WICHTIG: Scrollen erlauben */
    overflow-y: auto; /* Zeigt nur einen Scrollbalken, wenn nötig */
    
    background: #fff;
    z-index: 1000;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.4s ease-in-out;
    
    /* Verhindert horizontales Scrollen im Menü */
    overflow-x: hidden; 
    /* Flexbox einschalten */
    display: flex;
    flex-direction: column;
}

/* Optional: Den Scrollbalken etwas schöner stylen (für Chrome/Edge/Safari) */
.side-nav::-webkit-scrollbar {
    width: 6px;
}
.side-nav::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius:var(--radius);
}

.side-nav.open {
  transform: translateX(0); /* Hereinsegeln */
}

/* Der mittlere Teil darf scrollen */
.menu-body {
    flex: 1; 
    overflow-y: auto; 
    padding: 20px;
}

/* Der untere Teil bleibt fixiert */
.menu-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.logout-link {
    display: block;
    text-align: center;
    color: var(--attention);
    font-weight: bold;
    text-decoration: none;
    padding: 10px;
    border: 1px solid var(--attention);
    border-radius: 5px;
}
.logout-link:hover {
    background: var(--attention);
    color: #fff;
}
/* Overlay Effekt */
.menu-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 999;
}

.menu-overlay.show {
  display: block;
}

/* Menü-Inhalt Styling */
.side-nav ul { list-style: none; padding: 0; margin-top: 40px; }
.side-nav ul li { padding: 15px 0; border-bottom: 1px solid #eee; }
.side-nav ul li a { text-decoration: none; color: #333; font-weight: bold; display: block; }

/* Grundstyling der Liste */
.side-nav ul li {
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

/* Der aktive Zustand */
.side-nav ul li.active {
    background-color: #f8f9fa; /* Hellgrauer Hintergrund */
    padding-left: 10px;        /* Einrücken */
    border-left: 4px solid var(--accent); /* Balken links */
}

.side-nav ul li.active a {
    color: var(--accent); 
    font-weight: bold;
}

/* Der Pfeil (erscheint nur bei active) */
.side-nav ul li.active::after {
    content: '';              /* Oder ein Icon-Code */
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 1.2rem;
}

/* Hover-Effekt für nicht-aktive Links */
.side-nav ul li:not(.active):hover {
    background-color: #fdfdfd;
    padding-left: 5px;
}

/*++++++++++++++++++++++++++++
NAVIGATIONSMENÜ STYLES ENDE
++++++++++++++++++++++++++++*/

@media (max-width:768px){
  .container{padding:5px;margin:8px}
  th,td{font-size:0.9rem}
  header{flex-direction:column;align-items:flex-start;gap:8px;margin-bottom:0px}
  .icon-link {padding: 15px;} /* Mehr Klickfläche für Icons */

  /* hide datetime-local inputs and show hour-grid */
  .dashboard input[type="datetime-local"]{display:none}
  .dashboard .hour-grid{display:block}

  /* Responsive stacked table for small screens */
  table.responsive, table.responsive thead, table.responsive tbody, table.responsive th, table.responsive td, table.responsive tr {
    display:block;
  }
  table.responsive thead { display:none; }
  table.responsive tr { margin-bottom:12px; border:1px solid #eef2f6; border-radius:8px; padding:5px; background:#fff }
  table.responsive td {
    display:flex; justify-content:space-between; padding:4px 5px; border-bottom:0; font-size:0.9rem;
  }
  table.responsive td::before {
    content: attr(data-label); font-weight:600; color:var(--muted); margin-right:8px;
  }
  .actions { display:flex; gap:8px; align-items:center; }

  /* Responsive form flex layout */
  .flex {
    flex-direction: column; /* untereinander */
    align-items: stretch; /* volle Breite */
  }
  .flex label,
  .flex div {
    width: 100%; /* Dropdowns füllen die Breite */
  }
}