* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    color: #172033;
}

.public-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(22,101,52,.35), transparent 35%),
        radial-gradient(circle at bottom left, rgba(15,23,42,.95), transparent 40%),
        linear-gradient(135deg, #020617, #0f172a, #14532d);
}

/* Header */
.public-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    padding: 18px 24px;
    z-index: 50;
}

.public-header-inner {
    max-width: 1150px;
    margin: 0 auto;
    background: rgba(15, 23, 42, .88);
    border: 1px solid rgba(255,255,255,.10);
    backdrop-filter: blur(14px);
    border-radius: 22px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 16px 35px rgba(0,0,0,.22);
}

.site-logo {
    color: white;
    font-weight: bold;
    font-size: 16px;
    letter-spacing: .5px;
}

.login-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #166534, #22c55e);
    color: white;
    text-decoration: none;
    padding: 11px 17px;
    border-radius: 15px;
    font-weight: bold;
    box-shadow: 0 10px 25px rgba(0,0,0,.30);
    transition: .25s ease;
    border: 1px solid rgba(255,255,255,.18);
}

.login-icon-btn:hover {
    transform: translateY(-2px) scale(1.02);
    background: linear-gradient(135deg, #14532d, #16a34a);
}

.login-icon-btn .icon {
    font-size: 20px;
}

/* Public Page */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 35px;
}

.card {
    background: rgba(255,255,255,.96);
    border-radius: 28px;
    box-shadow: 0 30px 90px rgba(0,0,0,.25);
    border: 1px solid rgba(255,255,255,.5);
}

.main-card,
.login-card {
    width: 100%;
    max-width: 580px;
    padding: 36px;
}

.brand-badge {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: bold;
    margin-bottom: 14px;
}

h1, h2 {
    margin-top: 0;
    color: #0f172a;
}

p {
    color: #64748b;
    line-height: 1.8;
}

label {
    display: block;
    margin: 16px 0 7px;
    font-weight: bold;
    color: #334155;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d8dee8;
    background: #fff;
    border-radius: 15px;
    padding: 14px;
    font-size: 15px;
    outline: none;
    font-family: Tahoma, Arial, sans-serif;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #166534;
    box-shadow: 0 0 0 4px rgba(22,101,52,.12);
}

.primary-btn {
    width: 100%;
    margin-top: 22px;
    padding: 15px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #166534, #0f172a);
    color: white;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
}

.primary-btn:hover {
    opacity: .93;
}

.secondary-btn {
    width: 100%;
    margin-top: 14px;
    padding: 13px;
    border: none;
    border-radius: 15px;
    background: #0f172a;
    color: white;
    font-size: 15px;
    cursor: pointer;
    font-weight: bold;
}

.secondary-btn:hover {
    opacity: .92;
}

.admin-link,
.back-link,
.primary-link {
    display: inline-block;
    margin-top: 18px;
    color: #166534;
    text-decoration: none;
    font-weight: bold;
}

.alert {
    padding: 14px;
    border-radius: 14px;
    margin: 18px 0;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.alert.success {
    background: #dcfce7;
    color: #14532d;
}

.result-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 18px;
    margin: 20px 0;
}

.result-box span {
    display: block;
    color: #64748b;
    margin-bottom: 8px;
}

.result-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.result-actions button,
.result-actions a {
    border: none;
    background: #166534;
    color: white;
    padding: 10px 15px;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
}

.qr-preview {
    margin-top: 16px;
    width: 150px;
    height: 150px;
    border-radius: 14px;
    background: white;
    padding: 8px;
}

.qr-large {
    width: 320px;
    max-width: 100%;
    border-radius: 18px;
    padding: 10px;
    background: white;
}

.hidden-field {
    display: none;
}

.member-box {
    margin-top: 28px;
    padding: 22px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.member-box h3 {
    margin-top: 0;
    color: #0f172a;
}

.member-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.member-actions a {
    flex: 1;
    text-align: center;
    background: #0f172a;
    color: white;
    text-decoration: none;
    padding: 13px;
    border-radius: 15px;
    font-weight: bold;
}

.member-actions a:first-child {
    background: #166534;
}

.member-login-box {
    margin-top: 30px;
    padding: 22px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.member-login-box h3 {
    margin-top: 0;
    color: #0f172a;
}

.member-login-box input {
    margin-top: 10px;
}

.register-link {
    display: block;
    margin-top: 12px;
    text-align: center;
    color: #166534;
    text-decoration: none;
    font-weight: bold;
}

/* Dashboard */
.dashboard-page {
    background: #eef2f5;
    min-height: 100vh;
}

.topbar {
    background: #0f172a;
    color: white;
    padding: 18px 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h2 {
    color: white;
    margin: 0;
}

.topbar a {
    color: white;
    text-decoration: none;
    margin-right: 16px;
}

.container {
    max-width: 1250px;
    margin: 30px auto;
    padding: 0 20px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 22px;
    padding: 25px;
    box-shadow: 0 10px 35px rgba(15,23,42,.08);
}

.stat-card span {
    color: #64748b;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 32px;
    color: #166534;
}

.table-card {
    background: white;
    border-radius: 24px;
    overflow-x: auto;
    box-shadow: 0 10px 35px rgba(15,23,42,.08);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

th {
    background: #f8fafc;
    color: #334155;
    text-align: right;
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
}

td {
    padding: 14px;
    border-bottom: 1px solid #edf2f7;
}

.url-cell {
    max-width: 270px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.badge {
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
}

.badge.active {
    background: #dcfce7;
    color: #166534;
}

.badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.actions a {
    display: inline-block;
    margin: 3px;
    padding: 8px 11px;
    background: #e2e8f0;
    border-radius: 10px;
    color: #0f172a;
    text-decoration: none;
    font-size: 13px;
}

.actions a.danger {
    background: #fee2e2;
    color: #991b1b;
}

.form-wrapper {
    width: 95%;
    max-width: 620px;
    margin: 45px auto;
    padding: 32px;
}

.details-card {
    background: white;
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 25px;
    box-shadow: 0 10px 35px rgba(15,23,42,.08);
}

.center {
    text-align: center;
}

/* Member Details */
.member-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.info-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
}

.info-item span {
    display: block;
    color: #64748b;
    margin-bottom: 7px;
    font-size: 13px;
}

.info-item strong {
    color: #0f172a;
    word-break: break-word;
}

.member-control-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.member-control-panel form {
    margin: 0;
}

.control-card {
    width: 100%;
    border: none;
    border-radius: 18px;
    padding: 18px 14px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 72px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, .12);
}

.control-icon {
    font-size: 24px;
}

.control-card.green {
    background: linear-gradient(135deg, #166534, #22c55e);
}

.control-card.dark {
    background: linear-gradient(135deg, #020617, #334155);
}

.control-card.blue {
    background: linear-gradient(135deg, #1d4ed8, #38bdf8);
}

.control-card.red {
    background: linear-gradient(135deg, #991b1b, #ef4444);
}

.control-card:hover {
    transform: translateY(-2px);
    opacity: .94;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.checkbox-label input {
    width: auto;
}

/* Responsive */
@media (max-width: 750px) {
    .topbar {
        display: block;
        text-align: center;
    }

    .topbar nav {
        margin-top: 14px;
    }

    .main-card,
    .login-card {
        padding: 24px;
    }
}

@media (max-width: 600px) {
    .public-header {
        padding: 12px;
    }

    .public-header-inner {
        border-radius: 18px;
    }

    .site-logo {
        font-size: 14px;
    }

    .login-icon-btn {
        padding: 10px 12px;
        border-radius: 13px;
    }

    .login-icon-btn span:last-child {
        display: none;
    }

    .hero {
        padding-top: 100px;
    }

    .member-actions {
        display: block;
    }

    .member-actions a {
        display: block;
        margin-top: 10px;
    }
}