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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fb;
    color: #111827;
}

/* Login */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #3b82f6 0, #111827 55%, #020617 100%);
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 16px;
}

.login-box {
    background: #0b1120;
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.7);
    color: #e5e7eb;
}

.login-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
}

.login-form label {
    display: block;
    margin-bottom: 16px;
    font-size: 14px;
}

.login-form label span {
    display: block;
    margin-bottom: 6px;
    color: #9ca3af;
}

.login-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 8px;
}

.btn-secondary {
    background: transparent;
    color: #93c5fd;
    border-color: rgba(147, 197, 253, 0.4);
}

.btn-secondary:hover {
    color: #bfdbfe;
    border-color: rgba(147, 197, 253, 0.8);
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #374151;
    background: #020617;
    color: #f9fafb;
    outline: none;
}

.login-form input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #e5e7eb;
    color: #111827;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: #2563eb;
    color: #f9fafb;
    border-color: #1d4ed8;
}

.btn-primary:hover {
    background: #1d4ed8;
}

/* Alerts */

.alert {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Layout */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    background: #020617;
    color: #e5e7eb;
    padding: 20px 16px;
}

.sidebar-header {
    margin-bottom: 20px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-user {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 4px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.sidebar-link {
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    color: #d1d5db;
    text-decoration: none;
}

.sidebar-link:hover {
    background: #1f2937;
}

.sidebar-link.active {
    background: #2563eb;
    color: #f9fafb;
}

.main {
    flex: 1;
    background: #f9fafb;
    padding: 20px 24px;
}

.main-content h1 {
    font-size: 22px;
    margin-bottom: 18px;
}

.main-content p {
    margin-bottom: 10px;
}

/* Cards */

.cards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    min-width: 180px;
}

.card-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

.card-value {
    font-size: 22px;
    font-weight: 600;
}

/* Tables */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.table th,
.table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.table th {
    background: #f3f4f6;
    font-weight: 500;
    color: #4b5563;
}

.table tbody tr:hover {
    background: #f9fafb;
}

.table-actions {
    white-space: nowrap;
}

.table-link {
    font-size: 13px;
    color: #2563eb;
    text-decoration: none;
    margin-right: 10px;
}

.table-link:hover {
    text-decoration: underline;
}

.text-danger {
    color: #b91c1c;
}

/* Post cards (admin posts list) */

.post-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.post-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.post-card-image-wrap {
    width: 100%;
    height: 180px;
    background: #e5e7eb;
}

.post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #6b7280;
}

.post-card-body {
    padding: 14px 16px 12px;
}

.post-card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.post-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d4ed8;
}

.post-card-excerpt {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 6px;
}

.post-card-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.post-card-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.btn-small {
    padding: 6px 10px;
    font-size: 13px;
}

.btn-danger {
    background: #ef4444;
    color: #f9fafb;
    border-color: #dc2626;
}

/* Status badges */

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.status-published {
    background: #dcfce7;
    color: #166534;
}

.status-draft {
    background: #e5e7eb;
    color: #374151;
}

/* Page header */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
}

.search-form {
    position: relative;
    width: 100%;
    max-width: 420px;
}

.search-form-inline {
    max-width: 420px;
}

.search-form input[type="text"] {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    outline: none;
    background: #ffffff;
}

.search-form input[type="text"]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb33;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #9ca3af;
}

/* Forms */

.form {
    max-width: 760px;
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.form-group {
    margin-bottom: 14px;
}

.form-group label span {
    display: block;
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 6px;
}

.form input[type="text"],
.form select,
.form textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb33;
}

.field-hint {
    margin-top: 4px;
    font-size: 12px;
}

.field-hint-muted {
    color: #9ca3af;
}

.field-hint-ok {
    color: #15803d;
}

.field-hint-warn {
    color: #92400e;
}

.field-hint-bad {
    color: #b91c1c;
}

/* Rich text editor (CKEditor) */

.editor-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.editor-card-header {
    background: #111827;
    color: #f9fafb;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
}

.editor-card .cke_chrome {
    border-radius: 0 !important;
    border: 1px solid #d1d5db !important;
    border-top: none !important;
    box-shadow: none;
}

.cke_top {
    background: #f9fafb !important;
    border-bottom: 1px solid #e5e7eb !important;
    padding: 4px 8px !important;
}

.cke_bottom {
    background: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
}

.editor-meta {
    padding: 6px 10px;
    font-size: 12px;
    color: #6b7280;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.editor-card .editor-meta {
    border-radius: 0 0 10px 10px;
}

.banner-preview {
    margin-top: 8px;
}

.banner-preview-current {
    max-width: 480px;
}

.banner-preview-current span {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.banner-preview-img {
    display: block;
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
    background: #e5e7eb;
}

.cke_toolgroup {
    border-radius: 8px !important;
    border-color: transparent !important;
    background: transparent !important;
}

.cke_button {
    padding: 2px 4px !important;
}

.cke_button_on,
.cke_button:hover {
    background-color: #e5effe !important;
    border-radius: 6px !important;
}
