:root {
    --primary: #0066cc;
    --secondary: #f5f8fa;
    --accent: #f3961c;
    --error: #e74c3c;
    --success: #27ae60;
    --font: 'Segoe UI', 'Arial', sans-serif;
    --border-radius: 8px;
}

body {
    background: var(--secondary);
    font-family: var(--font);
    margin: 0 50px;
    padding: 0;
    color: #222;
}

h2 {
    color: var(--primary);
    margin-top: 2rem;
    text-align: center;
}

/* Reset form styling so forms behave as neutral containers */
form {
    all: unset;
    display: contents;
}
label {
    display: block;
    margin-bottom: .4rem;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: .5rem .6rem;
    margin-bottom: 1rem;
    border: 1px solid #d0d6db;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

button {
    padding: .7rem 1.6rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.18s;
    margin-top: .5rem;
}
button:hover {
    background: var(--accent);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.error-message {
    color: var(--error);
    background: #fff0f0;
    border: 1px solid var(--error);
    padding: .7rem 1.2rem;
    margin-bottom: 1.2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.success-message {
    color: var(--success);
    background: #ecfff4;
    border: 1px solid var(--success);
    padding: .7rem 1.2rem;
    margin-bottom: 1.2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.container {
    max-width: 600px;
    margin: 3rem auto;
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.text-center {
    text-align: center;
}

.mt-2 { margin-top: 2rem; }
.mt-1 { margin-top: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-1 { margin-bottom: 1rem; }

/* --- HEADER, MENU, USER --- */
.header {
    position: sticky;
    top: 0; left: 0; right: 0;
    z-index: 1050;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 22px rgba(60, 100, 180, 0.07), 0 1px 2px rgba(0,0,0,0.04);
    border-bottom: 1px solid rgba(230,230,240,0.54);
    transition: background 0.22s;
}
.header-container {
    max-width: 1150px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .8em 1.5em .7em 1.5em;
    gap: 1.15rem;
}
.branding {
    display: flex;
    align-items: center;
    gap: .7rem;
}
.logo {
    height: 45px;
    border-radius: 2px;
    box-shadow: 0 1px 8px rgba(0,102,204,0.08);
    background: #fff;
}
.product-name {
    font-size: 1.11rem;
    font-weight: 700;
    color: var(--primary, #0066cc);
    letter-spacing: 0.01em;
    opacity: 0.96;
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    margin-right: 1rem;
    background: none;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
}
.main-nav a {
    color: var(--primary, #0066cc);
    background: transparent;
    font-weight: 500;
    text-decoration: none;
    padding: .21em .59em;    /* Weniger Padding! */
    border-radius: 6px;
    font-size: 0.99rem;
    line-height: 1.2;
    transition: background 0.14s, color 0.13s;
    white-space: nowrap;
}
.main-nav a.active,
.main-nav a:hover {
    background: rgba(220,230,255,0.94);
    color: var(--accent, #f3961c);
}

.user-nav {
    display: flex;
    align-items: center;
    gap: .55rem;
}
.user-name {
    font-size: 1.01rem;
    color: #444;
    margin-right: 0.19rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.logout-link {
    color: #fff;
    background: var(--error, #e74c3c);
    padding: .31em .92em;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.02rem;
    transition: background 0.12s;
    font-weight: 500;
    box-shadow: 0 1px 8px rgba(231,76,60,0.07);
}
.logout-link:hover {
    background: #c0392b;
    color: #fff;
}

/* Responsive */
@media (max-width: 800px) {
    .header-container {
        flex-wrap: wrap;
        padding: .23em .5em;
        gap: 0.5rem;
    }
    .main-nav {
        margin: .16em 0;
        gap: .19rem;
    }
}
@media (max-width: 550px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: .3rem;
        padding: .17em .19em;
    }
    .main-nav {
        width: 100%;
        gap: .1rem;
        margin: 0;
    }
}

/* --- DASHBOARD & GRID --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);   /* Maximal 3 Kacheln pro Zeile */
    gap: 2rem;
    max-width: 1100px;
    margin: 2.5rem auto;
    padding: 0 2rem;
}
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 600px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 2rem 1.5rem 1.4rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 230px;
    transition: box-shadow 0.18s;
}
.dashboard-card:hover {
    box-shadow: 0 4px 24px rgba(0,102,204,0.08);
}
.dashboard-card h3 {
    color: var(--primary);
    margin-top: 0;
    font-size: 1.15rem;
}
.dashboard-card p {
    flex: 1 1 auto;
    font-size: 1rem;
    color: #444;
}
.dashboard-btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    padding: .55rem 1.3rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    margin-top: .6rem;
    transition: background 0.16s;
}
.dashboard-btn:hover {
    background: var(--accent);
}
.dashboard-card .dashboard-btn {
    display: block;
	margin-left: auto;
    margin-right: auto;
    width: 90%;
    text-align: center;
    margin-top: .6rem;
}


/* --- FOOTER --- */
.footer {
    background: #fafbfc;
    color: #aaa;
    padding: 1.2rem 0 0.8rem 0;
    font-size: 0.98rem;
    border-top: 1px solid #eee;
}

/* --- RESPONSIVE --- */
@media (max-width: 800px) {
    .header-container {
        flex-wrap: wrap;
        padding: 0.11rem 0.4rem;
    }
    .main-nav {
        margin: 0.2rem 0;
        gap: .27rem;
    }
    .dashboard-grid {
        gap: 1.1rem;
        padding: 0 0.3rem;
    }
}

@media (max-width: 530px) {
    .branding, .user-nav {
        flex: 1 1 100%;
        justify-content: center;
    }
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: .3rem;
    }
    .main-nav {
        justify-content: center;
        width: 100%;
        margin: 0;
    }
    .dashboard-card {
        padding: 1.1rem 0.5rem 1rem 0.5rem;
        min-height: 170px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.98rem;
    background: #fff;
}
th, td {
    padding: .52em .45em;
    text-align: left;
}
th {
    background: var(--secondary);
    color: var(--primary);
    font-weight: 600;
    border-bottom: 2px solid #e3e8ee;
}
tr:hover {
    background: #f7faff;
}
.password-table-container {
    max-width: 90vw;
    margin: 3rem auto;
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}
/* --- Shared list & table styles extracted from devices/list.php --- */
.device-header-bar,
.ticket-header-bar,
.user-header-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 1.2em;
    gap: 1.3em;
    flex-wrap: wrap;
}
.dashboard-btn.small {
    padding: .22em .85em;
    font-size: 0.96em;
}
.pretty-table {
    width: 100%;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 3px 20px #0001;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    font-size: 1.04em;
    min-width: 560px;
}
.pretty-table th, .pretty-table td {
    padding: .75em 1.2em;
    text-align: left;
}
.pretty-table thead tr {
    background: var(--secondary, #f8fafd);
}
.pretty-table tbody tr {
    border-bottom: 1px solid #f0f2f4;
    transition: background 0.12s;
}
.pretty-table tbody tr:hover {
    background: #f5faff;
}
.badge-status {
    display: inline-block;
    border-radius: 1em;
    padding: .23em .8em .23em .65em;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: 0.01em;
    min-width: 92px;
}
.empty-info {
    padding: 2.5em 0 2em 0;
    color: #999;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(24,32,54,0.28);
    z-index: 2222;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #fff;
    border-radius: 16px;
    min-width: 300px;
    max-width: 96vw;
    position: relative;
    box-shadow: 0 6px 30px rgba(0,80,180,0.13), 0 2px 8px rgba(0,102,204,0.09);
    animation: pop .21s cubic-bezier(.5,1.6,.4,1);
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
@keyframes pop { from { transform: scale(.93); } to { transform: scale(1); } }
.close-modal {
    position: absolute;
    right: 1.2em;
    top: .9em;
    font-size: 2em;
    color: #b0b8d0;
    cursor: pointer;
    font-weight: 400;
    background: transparent;
    border: none;
    line-height: 1;
    transition: color 0.2s;
}
.close-modal:focus,
.close-modal:hover {
    color: #e74c3c;
    outline: none;
}
@media (max-width: 700px) {
    .pretty-table { min-width: 300px; font-size: 0.97em; }
    .container { padding: 0.8em !important; }
    .device-header-bar,
    .ticket-header-bar,
    .user-header-bar {
        position: sticky;
        top: 56px;
        background: #fff;
        z-index: 2;
        margin-bottom: .8em;
    }
}
.badge-admin {
    display: inline-block;
    background: #0066cc18;
    color: var(--primary, #0066cc);
    border-radius: 1.5em;
    padding: .25em .85em;
    font-size: 0.98em;
    font-weight: 600;
    margin-right: 0.09em;
}
.action-link {
    font-size: 1.1em;
    text-decoration: none;
    margin-right: 0.5em;
    margin-left: 0.1em;
}
.action-link:hover {
    color: var(--accent, #f3961c);
}
.pretty-table.user-table { min-width: 520px; }
