* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f5f4;
    color: #292524;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.admin-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 280px;
    background: #0c0a09;
    color: #fafaf9;
    display: flex;
    flex-direction: column;
}

.brand {
    padding: 28px 24px;
    border-bottom: 1px solid #292524;
}

.brand-kicker {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #a8a29e;
}

.brand-title {
    margin-top: 10px;
    font-size: 28px;
    font-weight: 700;
}

.sidebar-nav {
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    padding: 14px 16px;
    border-radius: 14px;
    color: #d6d3d1;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: #1c1917;
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid #292524;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e7e5e4;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
}

.page-subtitle {
    margin: 8px 0 0;
    color: #78716c;
    font-size: 14px;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-name {
    font-size: 14px;
    font-weight: 700;
    text-align: right;
}

.user-email {
    font-size: 12px;
    color: #78716c;
    text-align: right;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: #1c1917;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.content {
    padding: 32px;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.card {
    background: #fff;
    border: 1px solid #e7e5e4;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.stat-label {
    font-size: 14px;
    color: #78716c;
}

.stat-value {
    margin-top: 12px;
    font-size: 34px;
    font-weight: 700;
}

.card-header h2 {
    margin: 0;
    font-size: 22px;
}

.card-header p {
    margin: 8px 0 0;
    color: #78716c;
    font-size: 14px;
}

.table-wrap {
    margin-top: 22px;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    text-align: left;
    padding: 16px 10px;
    border-bottom: 1px solid #f0efee;
    font-size: 14px;
}

.table th {
    color: #78716c;
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background: #d1fae5;
    color: #047857;
}

.empty-row {
    text-align: center;
    color: #a8a29e;
    padding: 28px 0;
}

.btn {
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-full {
    width: 100%;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top left, #e7e5e4, transparent 35%),
        radial-gradient(circle at bottom right, #d6d3d1, transparent 30%),
        #f5f5f4;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #e7e5e4;
    border-radius: 24px;
    box-shadow: 0 20px 45px rgba(28, 25, 23, 0.08);
    padding: 34px;
}

.auth-kicker {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #78716c;
}

.auth-title {
    margin: 12px 0 0;
    font-size: 32px;
    font-weight: 700;
    color: #1c1917;
}

.auth-text {
    margin: 10px 0 0;
    color: #57534e;
    font-size: 14px;
    line-height: 1.5;
}

.form-group {
    margin-top: 18px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #292524;
}

.form-input {
    width: 100%;
    border: 1px solid #d6d3d1;
    background: #fff;
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    border-color: #44403c;
    box-shadow: 0 0 0 3px rgba(68, 64, 60, 0.10);
}

.form-error {
    margin-top: 8px;
    font-size: 13px;
    color: #b91c1c;
}

.form-row {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #57534e;
    font-size: 14px;
}

.btn-primary {
    width: 100%;
    border: none;
    border-radius: 14px;
    background: #1c1917;
    color: #fff;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 700;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: #292524;
}

.status-box {
    margin-bottom: 18px;
    border-radius: 14px;
    background: #ecfdf5;
    color: #065f46;
    padding: 12px 14px;
    font-size: 14px;
}

.mb-24 {
    margin-bottom: 24px;
}

.filters-bar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.filters-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 16px;
    flex: 1;
    min-width: 320px;
}

.no-margin {
    margin-top: 0;
}

.filters-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-dark {
    background: #1c1917;
    color: #fff;
}

.btn-dark:hover {
    background: #292524;
}

.btn-light {
    background: #f5f5f4;
    color: #292524;
    border: 1px solid #d6d3d1;
}

.btn-light:hover {
    background: #e7e5e4;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-neutral {
    background: #e7e5e4;
    color: #44403c;
}

.pagination-wrap {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

.pagination-wrap nav {
    display: flex;
}

.pagination-wrap .flex {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-wrap span,
.pagination-wrap a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid #e7e5e4;
    background: #fff;
    color: #292524;
    font-size: 14px;
}

.pagination-wrap .bg-\[\#1c1917\],
.pagination-wrap .text-white {
    background: #1c1917 !important;
    color: #fff !important;
    border-color: #1c1917 !important;
}

.table-link {
    color: #1c1917;
    font-weight: 600;
}

.table-link:hover {
    text-decoration: underline;
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.detail-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.detail-item {
    padding-bottom: 14px;
    border-bottom: 1px solid #f0efee;
}

.detail-label {
    font-size: 13px;
    color: #78716c;
    margin-bottom: 6px;
}

.detail-value {
    font-size: 15px;
    color: #292524;
    font-weight: 600;
    word-break: break-word;
}

.card-form {
    max-width: 860px;
}

.stack-form {
    margin-top: 20px;
}

.form-textarea {
    width: 100%;
    border: 1px solid #d6d3d1;
    background: #fff;
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 14px;
    outline: none;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-textarea:focus {
    border-color: #44403c;
    box-shadow: 0 0 0 3px rgba(68, 64, 60, 0.10);
}

.form-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
}

.form-code {
    width: 100%;
    min-height: 380px;
    border: 1px solid #d6d3d1;
    background: #111827;
    color: #f9fafb;
    border-radius: 14px;
    padding: 16px;
    font-size: 13px;
    font-family: Consolas, Monaco, monospace;
    line-height: 1.6;
    outline: none;
    resize: vertical;
}

.form-code:focus {
    border-color: #44403c;
    box-shadow: 0 0 0 3px rgba(68, 64, 60, 0.10);
}

.code-block {
    margin-top: 20px;
    background: #111827;
    color: #f9fafb;
    border-radius: 16px;
    padding: 20px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-inline {
    font-family: Consolas, Monaco, monospace;
    background: #f5f5f4;
    border: 1px solid #e7e5e4;
    border-radius: 10px;
    padding: 8px 10px;
    display: inline-block;
}

.template-preview {
    margin-top: 20px;
    border: 1px solid #e7e5e4;
    border-radius: 18px;
    background: #ffffff;
    overflow: hidden;
    padding: 0;
}

@media (max-width: 1100px) {
    .grid-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .topbar {
        padding: 20px;
    }

    .content {
        padding: 20px;
    }

    .grid-cards {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 24px;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }

    .filters-actions {
        width: 100%;
    }

    .filters-actions .btn {
        flex: 1;
        text-align: center;
    }
}