/* Chain74 – Leather Style inspired by Titan CRM */

:root {
    --leather-dark:    #2d0f1a;
    --leather-mid:     #3d1525;
    --leather-light:   #4a1a2e;
    --leather-hover:   #5a2a3e;
    --gold:            #d4a855;
    --gold-light:      #f5e6d3;
    --gold-dim:        #c9a87c;
    --primary:         #4a1a2e;
    --primary-dark:    #2d0f1a;
    --primary-light:   #f9f0e8;
    --success:         #2d5a3d;
    --danger:          #8b2635;
    --warning:         #b87333;
    --info:            #2c5282;
    --gray-50:         #faf8f5;
    --gray-100:        #f3ede6;
    --gray-200:        #e8ddd3;
    --gray-300:        #d4c4b8;
    --gray-500:        #8a7060;
    --gray-700:        #4a3830;
    --gray-900:        #1c1008;
    --radius:          8px;
    --shadow:          0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    --shadow-md:       0 4px 12px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
    --shadow-lg:       0 10px 30px rgba(0,0,0,0.18);
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-900);
    background-color: #f1ebe3;
    background-image:
        repeating-linear-gradient(45deg,  rgba(180,120,80,0.04) 0, rgba(180,120,80,0.04) calc(5px/2), transparent calc(5px/2), transparent 5px),
        repeating-linear-gradient(-45deg, rgba(180,120,80,0.04) 0, rgba(180,120,80,0.04) calc(5px/2), transparent calc(5px/2), transparent 5px);
    background-size: 5px 5px;
    min-height: 100vh;
}

/* Layout */
.layout { display: flex; min-height: 100vh; }

/* Sidebar – Leder-Effekt */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    position: relative;
    color: white;
    padding: 1.5rem 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(0,0,0,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.03) 0%, transparent 40%),
        radial-gradient(ellipse at 40% 80%, rgba(0,0,0,0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(255,255,255,0.02) 0%, transparent 35%),
        repeating-linear-gradient(90deg, transparent 0px, transparent 3px, rgba(0,0,0,0.03) 3px, rgba(0,0,0,0.03) 6px),
        repeating-linear-gradient(0deg,  transparent 0px, transparent 2px, rgba(0,0,0,0.02) 2px, rgba(0,0,0,0.02) 4px),
        linear-gradient(180deg, #4a1a2e 0%, #3d1525 30%, #35121f 70%, #2d0f1a 100%);
    box-shadow: inset -3px 0 8px rgba(0,0,0,0.3), inset 0 3px 8px rgba(0,0,0,0.2), 3px 0 12px rgba(0,0,0,0.2);
}

/* Steppnaht Sidebar */
.sidebar::after {
    content: '';
    position: absolute;
    top: 8px; left: 8px; right: 8px; bottom: 8px;
    border: 2px dashed rgba(210,180,140,0.45);
    border-radius: 6px;
    pointer-events: none;
}

.sidebar-logo {
    font-size: 1.3rem;
    font-weight: 700;
    padding: 0 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(210,180,140,0.25);
    margin-bottom: 1rem;
    color: var(--gold-light);
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    letter-spacing: 0.02em;
}

.sidebar-nav a {
    display: block;
    padding: 0.65rem 1.5rem;
    color: #e8d5c4;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a.hidden { display: none; }

.sidebar-nav a:hover {
    color: white;
    background: rgba(255,255,255,0.08);
    border-left-color: var(--gold);
}

.sidebar-nav a.active {
    color: var(--gold);
    background: rgba(212,168,85,0.15);
    border-left-color: var(--gold);
}

/* Main content */
.main-content { flex: 1; padding: 2rem; max-width: 1200px; }

.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--leather-light); }
.page-header p  { color: var(--gray-500); margin-top: 0.25rem; }

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(180,130,90,0.15);
}

.card-header {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--leather-light);
}

/* Stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    border: 1px solid rgba(180,130,90,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-label { font-size: 0.8rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.75rem; font-weight: 700; margin-top: 0.25rem; color: var(--gray-900); }
.stat-value.highlight { color: var(--leather-light); }

/* Login – Leder-Hintergrund */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 15% 25%, rgba(0,0,0,0.20) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 15%, rgba(255,255,255,0.03) 0%, transparent 35%),
        radial-gradient(ellipse at 50% 80%, rgba(0,0,0,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 55%, rgba(255,255,255,0.02) 0%, transparent 30%),
        repeating-linear-gradient(90deg, transparent 0px, transparent 3px, rgba(0,0,0,0.025) 3px, rgba(0,0,0,0.025) 6px),
        repeating-linear-gradient(0deg,  transparent 0px, transparent 2px, rgba(0,0,0,0.02)  2px, rgba(0,0,0,0.02)  4px),
        linear-gradient(145deg, #5a2030 0%, #3d1525 35%, #2d0f1a 70%, #1e0810 100%);
}

.login-card {
    position: relative;
    background: linear-gradient(160deg, #3d1525 0%, #2d0f1a 100%);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

/* Steppnaht Login-Karte */
.login-card::before {
    content: '';
    position: absolute;
    top: 10px; left: 10px; right: 10px; bottom: 10px;
    border: 2px dashed rgba(210,180,140,0.4);
    border-radius: 8px;
    pointer-events: none;
}

.login-card h1 {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--gold-light);
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    letter-spacing: 0.04em;
    font-weight: 700;
}

.login-card .subtitle {
    text-align: center;
    color: var(--gold-dim);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.login-card .form-group label { color: #e8d5c4; }

.login-card .form-control {
    background: rgba(245, 235, 220, 0.92);
    border: 1.5px solid rgba(180, 130, 80, 0.5);
    color: var(--gray-900);
    border-radius: 6px;
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
    transition: all 0.2s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.login-card .form-control::placeholder {
    color: #9a8070;
}

.login-card .form-control:focus {
    background: rgba(255, 248, 238, 0.98);
    border-color: var(--gold);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06), 0 0 0 3px rgba(212,168,85,0.3);
    outline: none;
}

.login-card .btn-primary {
    background: linear-gradient(160deg, #5a2a3e 0%, #3d1525 100%);
    color: var(--gold-light);
    border: 2px dashed rgba(210,180,140,0.5);
    box-shadow:
        0 0 0 3px rgba(45,15,26,0.8),
        2px 2px 8px 3px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.05);
    font-size: 1rem;
    letter-spacing: 0.04em;
    padding: 0.75rem 1.25rem;
}

.login-card .btn-primary:hover {
    background: linear-gradient(160deg, #6a3a4e 0%, #4d2535 100%);
    color: white;
    box-shadow:
        0 0 0 3px rgba(45,15,26,0.9),
        3px 3px 10px 3px rgba(0,0,0,0.45),
        inset 0 1px 0 rgba(255,255,255,0.08);
}

.login-card .alert-error {
    background: rgba(139,38,53,0.2);
    color: #ffc8c8;
    border-color: rgba(139,38,53,0.4);
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1.5px solid #6b2040;
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: white;
    color: var(--gray-900);
}

.form-control:focus {
    outline: none;
    border-color: var(--leather-light);
    box-shadow: 0 0 0 3px rgba(75,26,46,0.15);
}

select.form-control { appearance: auto; }

input[type="file"].form-control { padding: 0.5rem; line-height: 1.5; }
input[type="file"].form-control::file-selector-button {
    padding: 0.4rem 1rem;
    border: 1.5px solid #6b2040;
    border-radius: 4px;
    background: var(--gray-100);
    color: var(--leather-light);
    cursor: pointer;
    margin-right: 0.75rem;
    font-size: 0.9rem;
}
input[type="file"].form-control::file-selector-button:hover { background: var(--gray-200); }

/* Buttons – Leder-Steppnaht */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    border: 2px dashed rgba(255,255,255,0.35);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

.btn-primary {
    background: var(--leather-light);
    color: var(--gold-light);
    border-color: rgba(245,230,211,0.4);
    box-shadow: 0 0 0 3px var(--leather-light), 2px 2px 6px 3px rgba(0,0,0,0.25);
}
.btn-primary:hover {
    background: var(--leather-hover);
    color: white;
    box-shadow: 0 0 0 3px var(--leather-hover), 2px 2px 8px 3px rgba(0,0,0,0.3);
}

.btn-success {
    background: var(--success);
    color: #e8f5e9;
    border-color: rgba(232,245,233,0.4);
    box-shadow: 0 0 0 3px var(--success), 2px 2px 6px 3px rgba(0,0,0,0.25);
}
.btn-success:hover {
    background: #3d6a4d;
    color: white;
    box-shadow: 0 0 0 3px #3d6a4d, 2px 2px 8px 3px rgba(0,0,0,0.3);
}

.btn-danger {
    background: var(--danger);
    color: #fce4ec;
    border-color: rgba(252,228,236,0.4);
    box-shadow: 0 0 0 3px var(--danger), 2px 2px 6px 3px rgba(0,0,0,0.25);
}
.btn-danger:hover {
    background: #a33645;
    color: white;
    box-shadow: 0 0 0 3px #a33645, 2px 2px 8px 3px rgba(0,0,0,0.3);
}

.btn-outline {
    background: white;
    color: var(--leather-light);
    border: 2px dashed var(--leather-light);
    box-shadow: none;
    text-shadow: none;
}
.btn-outline:hover {
    background: var(--leather-light);
    color: var(--gold-light);
    box-shadow: 0 0 0 3px var(--leather-light), 2px 2px 6px 3px rgba(0,0,0,0.2);
}

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.65rem 0.75rem; text-align: left; border-bottom: 1px solid var(--gray-200); font-size: 0.9rem; }
th { font-weight: 600; color: var(--leather-light); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; background: var(--gray-50); }
tbody tr:hover { background: #fdf8f3; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error   { background: #fff0f0; color: var(--danger);  border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert-info    { background: var(--primary-light); color: var(--primary-dark); border: 1px solid rgba(180,130,90,0.3); }

/* Balance */
.balance-display { text-align: center; padding: 2rem; }
.balance-amount  { font-size: 3rem; font-weight: 700; color: var(--leather-light); }
.balance-label   { font-size: 0.9rem; color: var(--gray-500); margin-top: 0.25rem; }

/* TOTP */
.totp-input { font-size: 2rem; text-align: center; letter-spacing: 0.5em; font-family: monospace; padding: 0.75rem; }
.qr-area { text-align: center; padding: 1.5rem; background: var(--gray-50); border-radius: var(--radius); margin-bottom: 1.5rem; }
.secret-display { font-family: monospace; font-size: 1rem; background: var(--gray-100); padding: 0.75rem; border-radius: var(--radius); word-break: break-all; margin-top: 1rem; text-align: center; }

/* Badges */
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 99px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #f9f0e8; color: var(--leather-light); }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: 12px; padding: 2rem; max-width: 480px; width: 90%; box-shadow: var(--shadow-lg); border: 1px solid rgba(180,130,90,0.2); }
.modal h2 { margin-bottom: 1rem; color: var(--leather-light); }

/* Nav badge */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: white; font-size: 0.7rem; font-weight: 700; margin-left: 0.5rem; }
.nav-badge.hidden { display: none; }

/* Explorer */
.explorer-detail-grid { display: grid; grid-template-columns: 160px 1fr; gap: 0.5rem 1rem; align-items: baseline; }
.explorer-detail-label { font-weight: 600; color: var(--gray-500); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
.hash-value { font-family: monospace; font-size: 0.85rem; word-break: break-all; color: var(--gray-700); }
.explorer-filter-bar { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.explorer-pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; padding-top: 0.75rem; }
.explorer-nav-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Signature pad */
.signature-pad-container { border: 2px dashed var(--gray-300); border-radius: var(--radius); background: white; cursor: crosshair; }
.signature-pad { display: block; width: 100%; height: 140px; border-radius: var(--radius); touch-action: none; }

/* Contracts */
.contract-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.contract-sig-block { padding: 1rem; border: 1px solid var(--gray-200); border-radius: var(--radius); background: var(--gray-50); }
.contract-sig-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.75rem; color: var(--leather-light); }

/* Check list */
.check-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.check-list li { padding: 0.4rem 0; border-bottom: 1px solid var(--gray-100); font-size: 0.95rem; }
.check-ok  { color: var(--success); }
.check-fail { color: var(--danger); }
.check-list small { color: var(--gray-500); font-size: 0.8rem; }

/* Utility */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none; }

/* Footer */
.site-footer { text-align: center; padding: 1.5rem 1rem; font-size: 0.8rem; color: var(--gray-500); }
.site-footer a { color: var(--gray-500); text-decoration: none; }
.site-footer a:hover { color: var(--leather-light); text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; padding: 1rem 0; }
    .main-content { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .balance-amount { font-size: 2rem; }
    .explorer-detail-grid { grid-template-columns: 1fr; }
    .contract-signatures { grid-template-columns: 1fr; }
}

/* ── Responsive Teilnehmer-Tabelle ───────────────────────── */
.users-cards-mobile { display: none; }

@media (max-width: 1024px) {
    .users-table-desktop { display: none; }
    .users-cards-mobile  { display: block; }
}
