/* BSOL Kundenportal – Stylesheet
   Farben: #2d718f (Brand), #51d0d6 (Teal), #0b174c (Navy), #dee0e0 (Grau)
   Font: Raleway (Google Fonts)
*/

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --brand:   #2d718f;
    --teal:    #51d0d6;
    --navy:    #0b174c;
    --gray:    #dee0e0;
    --bg:      #f0f4f7;
    --white:   #ffffff;
    --text:    #1a2332;
    --muted:   #6b7c93;
    --danger:  #c0392b;
    --success: #27ae60;
    --warning: #e67e22;
    --radius:  10px;
    --shadow:  0 4px 20px rgba(0,0,0,.10);
}

body {
    font-family: 'Raleway', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Login Page ── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy) 0%, var(--brand) 60%, var(--teal) 100%);
    padding: 24px;
}
.login-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}
.login-logo { margin-bottom: 24px; }
.login-logo img { display: inline-block; }
.login-title { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.login-sub   { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.login-card .form-group { text-align: left; margin-bottom: 16px; }
.login-card .btn-primary { width: 100%; margin-top: 8px; }
.login-footer { margin-top: 24px; color: var(--muted); font-size: 12px; }

/* ── Portal Layout: Sidebar + Main ── */
.portal-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--navy) 0%, #162154 100%);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}
.sidebar-logo {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
}
.sidebar-logo img { width: 160px; height: auto; display: block; }

.sidebar-customer {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 8px;
}
.sidebar-customer-label {
    display: block;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--teal);
    font-weight: 600;
    margin-bottom: 4px;
}
.sidebar-customer-name {
    display: block;
    color: rgba(255,255,255,.9);
    font-size: 13px;
    font-weight: 600;
}

.nav-menu {
    list-style: none;
    padding: 8px 0;
    flex: 1;
}
.nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
    border-left: 3px solid transparent;
}
.nav-item a:hover {
    color: var(--white);
    background: rgba(255,255,255,.07);
    border-left-color: var(--teal);
}
.nav-item.active a {
    color: var(--white);
    background: rgba(81,208,214,.12);
    border-left-color: var(--teal);
}
.nav-icon { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }

.nav-section-label {
    padding: 16px 20px 4px;
    pointer-events: none;
}
.nav-section-label span {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,.3);
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.nav-logout {
    display: block;
    color: rgba(255,255,255,.5);
    text-decoration: none;
    font-size: 13px;
    padding: 8px 0;
    transition: color .2s;
}
.nav-logout:hover { color: rgba(255,255,255,.9); }

/* Main Content */
.portal-main {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.portal-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray);
    padding: 18px 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.portal-page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy);
}
.portal-content {
    padding: 28px 32px;
    flex: 1;
}

/* ── Welcome Banner ── */
.welcome-banner {
    background: linear-gradient(135deg, var(--brand) 0%, var(--navy) 100%);
    border-radius: var(--radius);
    padding: 20px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}
.welcome-greeting {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,.65);
    font-weight: 500;
    letter-spacing: .5px;
    margin-bottom: 2px;
}
.welcome-name {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
}

/* ── Dashboard Cards ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-icon--blue  { background: rgba(45,113,143,.12); color: var(--brand); }
.stat-icon--teal  { background: rgba(81,208,214,.15); color: #2ab5bb; }
.stat-icon--navy  { background: rgba(11,23,76,.10);  color: var(--navy); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 500; }

/* Dashboard Action Cards */
.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 8px;
}
.action-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 20px;
    text-decoration: none;
    color: var(--text);
    transition: all .2s;
    border: 2px solid transparent;
    text-align: center;
}
.action-card:hover {
    border-color: var(--teal);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.action-icon { font-size: 28px; margin-bottom: 12px; color: var(--brand); }
.action-title { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.action-sub   { font-size: 12px; color: var(--muted); }

/* ── Ticket-Tabelle ── */
.filter-bar {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
}
.filter-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}
.filter-form select {
    padding: 7px 12px;
    border: 1.5px solid var(--gray);
    border-radius: 7px;
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    outline: none;
}

.summary-bar {
    background: rgba(45,113,143,.08);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: var(--brand);
}

.table-wrap {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.portal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.portal-table th {
    background: linear-gradient(90deg, var(--brand), var(--navy));
    color: var(--white);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.portal-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.portal-table tbody tr:hover { background: #f8fbfc; }
.portal-table tfoot td {
    border-top: 2px solid var(--gray);
    background: #fafbfc;
    padding: 12px 16px;
}
.ticket-number a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    font-family: monospace;
    font-size: 13px;
}
.ticket-number a:hover { text-decoration: underline; }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.badge-new     { background: #e8f4fd; color: #1a6fb0; }
.badge-open    { background: #e8f8ef; color: #1a7a44; }
.badge-pending { background: #fff8e1; color: #856404; }
.badge-closed  { background: #f0f0f0; color: #6b7c93; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }

/* Conditional hidden row */
.conditional-row { display: none; }
.conditional-row.visible { display: grid; }

/* Checkbox-Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid var(--gray);
    border-radius: 7px;
    cursor: pointer;
    transition: all .2s;
    background: #fafbfc;
}
.checkbox-item:hover { border-color: var(--teal); background: var(--white); }
.checkbox-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0; }
.checkbox-item.checked { border-color: var(--brand); background: rgba(45,113,143,.06); }
.checkbox-item span { font-size: 13px; font-weight: 500; }
.form-group .hint { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Form Elements ── */
.section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}
.section-header {
    background: linear-gradient(90deg, var(--brand), var(--navy));
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-header h2 {
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.section-header .icon { color: var(--teal); font-size: 16px; }
.section-body { padding: 24px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.form-row.full  { grid-template-columns: 1fr; }
.form-row.third { grid-template-columns: 1fr 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text); }
.form-group label .required { color: var(--danger); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="date"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray);
    border-radius: 7px;
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: #fafbfc;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(81,208,214,.15);
    background: var(--white);
}
textarea { resize: vertical; min-height: 80px; }
select   { cursor: pointer; }

/* ── Buttons ── */
.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--navy));
    color: var(--white);
    border: none;
    padding: 13px 32px;
    border-radius: 8px;
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .5px;
    transition: opacity .2s, transform .1s;
    text-decoration: none;
    display: inline-block;
}
.btn-primary:hover  { opacity: .92; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: 7px;
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 500;
}
.alert-error   { background: #fdecea; color: var(--danger);  border: 1px solid #f5c6c2; }
.alert-success { background: #eafaf1; color: var(--success); border: 1px solid #a9dfbf; }
.alert-timeout { background: #fff8e1; color: #856404;        border: 1px solid #ffc107; }

/* ── Submit Bar ── */
.submit-bar {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.submit-bar .info { font-size: 13px; color: var(--muted); }
.submit-bar .info strong { color: var(--text); }

/* ── Success Card ── */
.success-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px 40px;
}
.success-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--teal), var(--brand));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    color: white;
}
.success-card h2 { color: var(--navy); font-size: 24px; margin-bottom: 12px; }
.success-card p  { color: var(--muted); font-size: 15px; line-height: 1.6; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { width: 100%; height: auto; position: relative; }
    .portal-main { margin-left: 0; }
    .portal-layout { flex-direction: column; }
    .form-row, .form-row.third { grid-template-columns: 1fr; }
    .portal-content { padding: 16px; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .login-card { padding: 28px 20px; }
}
