:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --primary-color: #6366f1;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* Dark Mode Theme */
body.dark-mode {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --primary-color: #818cf8;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 2.5rem 1rem;
    display: flex;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1100px;
}

/* Top Action Buttons (Darkmode & Login) */
.top-actions {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.action-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.action-btn.active {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* Header & Suche */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.search-box {
    position: relative;
    max-width: 450px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    outline: none;
    font-size: 0.95rem;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Layout & Kacheln */
.category-section {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.6rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.75rem 1.25rem 1.25rem 1.25rem;
    position: relative;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.card-main-link {
    text-decoration: none;
    color: inherit;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-icon {
    font-size: 2.2rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-radius: 1rem;
    margin-bottom: 1rem;
    transition: transform 0.2s ease;
}

.card:hover .card-icon {
    transform: scale(1.05);
}

.card-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.card-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* Brand Farben - Light Mode */
.brand-audiobooks     { background-color: #fef3c7; color: #d97706; }
.brand-jellyfin       { background-color: #f3e8ff; color: #a855f7; }
.brand-bitwarden      { background-color: #dbeafe; color: #1d4ed8; }
.brand-homeassistant  { background-color: #e0f2fe; color: #0284c7; }
.brand-immich         { background-color: #fce7f3; color: #db2777; }
.brand-paperless      { background-color: #ccfbf1; color: #0d9488; }
.brand-adguard        { background-color: #dcfce7; color: #16a34a; }
.brand-aruba          { background-color: #ffedd5; color: #ea580c; }
.brand-cisco          { background-color: #fee2e2; color: #dc2626; }
.brand-guacamole      { background-color: #dcfce7; color: #15803d; }
.brand-octoprint     { background-color: #dcfce7; color: #22c55e; }
.brand-proxmox        { background-color: #ffedd5; color: #d97706; }
.brand-nginx          { background-color: #d1fae5; color: #059669; }
.brand-fronius        { background-color: #fee2e2; color: #b91c1c; }
.brand-stash          { background-color: #e0e7ff; color: #4338ca; }
.brand-truenas        { background-color: #e0f2fe; color: #0369a1; }
.brand-waermepumpe    { background-color: #ffedd5; color: #c2410c; }

/* Brand Farben - Dark Mode */
body.dark-mode .brand-audiobooks    { background-color: rgba(217, 119, 6, 0.2); }
body.dark-mode .brand-jellyfin      { background-color: rgba(168, 85, 247, 0.2); }
body.dark-mode .brand-bitwarden     { background-color: rgba(29, 78, 216, 0.2); }
body.dark-mode .brand-homeassistant { background-color: rgba(2, 132, 199, 0.2); }
body.dark-mode .brand-immich        { background-color: rgba(219, 39, 119, 0.2); }
body.dark-mode .brand-paperless     { background-color: rgba(13, 148, 136, 0.2); }
body.dark-mode .brand-adguard       { background-color: rgba(22, 163, 74, 0.2); }
body.dark-mode .brand-aruba         { background-color: rgba(234, 88, 12, 0.2); }
body.dark-mode .brand-cisco         { background-color: rgba(220, 38, 38, 0.2); }
body.dark-mode .brand-guacamole     { background-color: rgba(21, 128, 61, 0.2); }
body.dark-mode .brand-octoprint    { background-color: rgba(34, 197, 94, 0.2); }
body.dark-mode .brand-proxmox       { background-color: rgba(217, 119, 6, 0.2); }
body.dark-mode .brand-nginx         { background-color: rgba(5, 150, 105, 0.2); }
body.dark-mode .brand-fronius       { background-color: rgba(185, 28, 28, 0.2); }
body.dark-mode .brand-stash         { background-color: rgba(67, 56, 202, 0.2); }
body.dark-mode .brand-truenas       { background-color: rgba(3, 105, 161, 0.2); }
body.dark-mode .brand-waermepumpe   { background-color: rgba(194, 65, 12, 0.2); }

/* App-Store Links */
.app-links {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    width: 100%;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.app-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.app-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Status LED & Latenz-Anzeige */
.status-badge {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #94a3b8;
    box-shadow: 0 0 0 3px var(--card-bg);
    transition: background-color 0.3s ease;
}

.status-badge.online { 
    background-color: #10b981; 
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4), 0 0 0 3px var(--card-bg); 
}

.status-badge.offline { 
    background-color: #ef4444; 
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4), 0 0 0 3px var(--card-bg); 
}

.latency-text {
    position: absolute;
    top: 1.05rem;
    right: 2.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    opacity: 0.75;
    font-family: monospace;
    pointer-events: none;
    line-height: 1;
}

/* Admin Login Modal Styling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1000;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(10px) scale(0.95);
    transition: transform 0.25s ease;
    text-align: center;
}

.modal-backdrop.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.modal-icon {
    font-size: 2rem;
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.modal-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Passwort-Eingabefeld mit Toggle-Auge */
.password-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 0.5rem;
}

.password-wrapper input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.password-wrapper input:focus {
    border-color: var(--primary-color);
}

.toggle-password-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.toggle-password-btn:hover {
    color: var(--primary-color);
}

.login-error {
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: none;
}

.login-error.visible {
    display: block;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-secondary {
    background-color: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

.btn-secondary:hover {
    background-color: rgba(148, 163, 184, 0.25);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

/* Footer Styles */
.footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}