@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --font-body: 'Manrope', 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', 'Manrope', sans-serif;

    --primary: #0ea5a4;
    --primary-dark: #0f766e;
    --primary-light: #5eead4;
    --secondary: #f97316;
    --secondary-dark: #ea580c;
    --primary-btn: #6366f1;
    --primary-btn-dark: #4f46e5;
    --bg: #f7f9fc;
    --bg-card: #ffffff;
    --bg-muted: #eef3f8;
    --bg-gradient: radial-gradient(1400px circle at 8% -18%, rgba(94, 234, 212, 0.18), transparent 45%),
        radial-gradient(1200px circle at 92% 18%, rgba(249, 115, 22, 0.12), transparent 50%),
        #f7f9fc;
    --text: #0b1220;
    --text-light: #526070;
    --border: #e3e9f1;
    --border-strong: #d2dbe6;
    --success: #16a34a;
    --error: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 30px 80px rgba(15, 23, 42, 0.16);
    --radius: 20px;
    --radius-sm: 14px;
    --radius-lg: 28px;
    --transition: all 0.2s ease;

    --form-border-width: 2px;
    --form-border: var(--border);
    --form-border-focus: var(--primary);
    --form-bg: rgba(255, 255, 255, 0.96);
    --form-bg-focus: #ffffff;
    --form-radius: var(--radius);
    --form-padding-y: 0.95rem;
    --form-padding-x: 1.1rem;
    --form-font-size: 0.98rem;
    --form-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    --form-shadow-focus: 0 0 0 4px rgba(14, 165, 164, 0.12), 0 8px 18px rgba(15, 23, 42, 0.08);
    --form-textarea-min-height: 220px;
    --checkbox-size: 18px;

    --page-padding: 2.5rem;
    --page-padding-mobile: 1.25rem;
}

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

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    letter-spacing: -0.01em;
    position: relative;
    isolation: isolate;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(620px circle at 18% 8%, rgba(255, 255, 255, 0.7), transparent 55%),
        radial-gradient(900px circle at 82% -6%, rgba(94, 234, 212, 0.16), transparent 60%),
        radial-gradient(800px circle at 12% 88%, rgba(249, 115, 22, 0.1), transparent 60%);
    opacity: 0.85;
    pointer-events: none;
    z-index: -1;
}

h1,
h2,
h3,
.posts-section-title {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

body.sidebar-open {
    overflow: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:where(a, button, input, select, textarea, .btn, .nav-item, .action-btn, .logout-btn, .mobile-toggle, .filter-dropdown-toggle):focus-visible {
    outline: 3px solid rgba(14, 165, 164, 0.45);
    outline-offset: 2px;
}

.filter-select {
    padding: var(--form-padding-y) var(--form-padding-x);
    border: var(--form-border-width) solid var(--form-border);
    border-radius: var(--form-radius);
    font-size: var(--form-font-size);
    font-family: inherit;
    background: var(--form-bg);
    color: var(--text);
    cursor: pointer;
    line-height: 1.2;
    height: 44px;
    min-width: 180px;
    box-shadow: var(--form-shadow);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

select.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.5rem;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(0, 0, 0, 0.55) 50%),
        linear-gradient(135deg, rgba(0, 0, 0, 0.55) 50%, transparent 50%),
        linear-gradient(to right, transparent, transparent);
    background-position:
        calc(100% - 18px) 18px,
        calc(100% - 12px) 18px,
        calc(100% - 2.5rem) 0.5rem;
    background-size:
        6px 6px,
        6px 6px,
        1px 2.5rem;
    background-repeat: no-repeat;
}

select.filter-select[multiple] {
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
    height: auto;
    min-height: 44px;
    padding-right: 1rem;
    background-image: none;
}

select.filter-select[multiple] option {
    padding: 0.25rem 0.5rem;
}

select.filter-select option {
    color: var(--text);
}

input.filter-select[type="date"],
input.filter-select[type="time"] {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 0.85rem;
}

input.filter-select::-webkit-calendar-picker-indicator {
    opacity: 0.65;
    cursor: pointer;
}

input.filter-select::-webkit-calendar-picker-indicator:hover {
    opacity: 0.9;
}

.filter-select:hover {
    border-color: var(--border-strong);
    background: #fff;
}

.filter-select:focus {
    outline: none;
    border-color: var(--form-border-focus);
    box-shadow: var(--form-shadow-focus);
    background: var(--form-bg-focus);
}

.filter-dropdown {
    position: relative;
    z-index: 1;
}

.filter-dropdown.is-open {
    z-index: 2001;
}

.filter-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    line-height: 1.2;
    height: 44px;
    min-width: 180px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.filter-dropdown-toggle:hover {
    border-color: var(--border-strong);
    background: #fff;
}

.filter-dropdown.is-open .filter-dropdown-toggle {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(14, 165, 164, 0.12), 0 8px 18px rgba(15, 23, 42, 0.08);
    background: #fff;
}

.filter-dropdown-label {
    display: inline-block;
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-dropdown-caret {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.55);
}

.filter-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1000;
    min-width: 240px;
    max-width: 320px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    display: none;
}

.filter-dropdown.is-open .filter-dropdown-panel {
    display: block;
}

.filter-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    color: var(--text);
}

.filter-dropdown-item:hover {
    background: var(--bg);
}

.filter-dropdown-item input {
    width: var(--checkbox-size);
    height: var(--checkbox-size);
}

.filter-dropdown-item span {
    font-size: 0.95rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-end;
}

.search-box input {
    width: 100%;
    padding: var(--form-padding-y) var(--form-padding-x);
    border: var(--form-border-width) solid var(--form-border);
    border-radius: var(--form-radius);
    font-size: var(--form-font-size);
    background: var(--form-bg);
    box-shadow: var(--form-shadow);
    height: 44px;
    line-height: 1.2;
    transition: var(--transition);
}

.search-box input:hover {
    border-color: var(--border-strong);
}

.search-box input:focus {
    outline: none;
    border-color: var(--form-border-focus);
    background: var(--form-bg-focus);
    box-shadow: var(--form-shadow-focus);
}

.search-box .filter-select {
    width: 100%;
}

.filters-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sidebar-backdrop {
    display: none;
}

ul,
ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.btn svg {
    display: block;
    flex-shrink: 0;
}

button.btn {
    appearance: none;
    -webkit-appearance: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-btn), var(--primary-btn-dark));
    color: #fff;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
    background: var(--bg-muted);
    border-color: rgba(14, 165, 164, 0.45);
}

.btn-danger {
    background: var(--error);
    color: white;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: #dc2626;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(8px);
    z-index: 3000;
}

.confirm-modal.show {
    display: flex;
}

.confirm-modal-panel {
    width: min(520px, 94vw);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.35);
    overflow: visible;
}

.confirm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.confirm-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.confirm-modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 1.75rem;
    line-height: 1;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.confirm-modal-close:hover {
    background: rgba(226, 232, 240, 0.65);
    color: var(--text);
}

.confirm-modal-body {
    padding: 1rem 1.25rem;
    overflow: visible;
}

.confirm-modal .filter-dropdown.is-open {
    z-index: 4001;
}

.confirm-modal .filter-dropdown-panel {
    z-index: 4000;
}

.confirm-modal-text {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: break-word;
}

.confirm-modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fef2f2;
    color: var(--error);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: var(--warning);
    border: 1px solid #fde68a;
}

.text-center {
    text-align: center;
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(14, 165, 164, 0.25) 0%, rgba(249, 115, 22, 0.2) 100%);
    padding: 1rem;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(226, 232, 240, 0.55);
    border-radius: 14px;
    margin-bottom: 1.25rem;
}

.auth-tab {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.is-active {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: var(--shadow);
}

.auth-panel {
    display: none;
}

.auth-panel.is-active {
    display: block;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.005em;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: var(--form-padding-y) var(--form-padding-x);
    border: var(--form-border-width) solid var(--form-border);
    border-radius: var(--form-radius);
    font-size: var(--form-font-size);
    font-family: inherit;
    transition: var(--transition);
    background: var(--form-bg);
    color: var(--text);
    box-shadow: var(--form-shadow);
}

.input-wrapper.has-icon input {
    padding-left: calc(var(--form-padding-x) + 2rem);
}

.input-wrapper.has-toggle input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    padding: 0;
    background: transparent;
    color: var(--text-light);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    transition: var(--transition);
}

.password-toggle:hover {
    background: rgba(226, 232, 240, 0.65);
    color: var(--text);
}

.password-toggle-icon {
    display: block;
    width: 20px;
    height: 20px;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--form-border-focus);
    background: var(--form-bg-focus);
    box-shadow: var(--form-shadow-focus);
}

.input-wrapper input::placeholder {
    color: var(--text-light);
}

.form-group :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    width: 100%;
    padding: var(--form-padding-y) var(--form-padding-x);
    border: var(--form-border-width) solid var(--form-border);
    border-radius: var(--form-radius);
    font-size: var(--form-font-size);
    font-family: inherit;
    background: var(--form-bg);
    color: var(--text);
    transition: var(--transition);
    box-shadow: var(--form-shadow);
}

.form-group textarea {
    min-height: var(--form-textarea-min-height);
    resize: vertical;
    line-height: 1.7;
}

.form-group :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
    outline: none;
    border-color: var(--form-border-focus);
    background: var(--form-bg-focus);
    box-shadow: var(--form-shadow-focus);
}

.form-group :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):disabled {
    background: var(--bg);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-hint,
.form-group small {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.35;
    margin-top: 0.5rem;
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

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

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(244, 247, 251, 0.92) 100%);
    border-right: 1px solid rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    backdrop-filter: blur(18px);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    color: var(--text-light);
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(14, 165, 164, 0.08);
    color: var(--primary-dark);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(14, 165, 164, 0.14), rgba(249, 115, 22, 0.1));
    color: var(--primary-dark);
    font-weight: 700;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(14, 165, 164, 0.08);
    border-radius: var(--radius);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error);
    transform: scale(1.05);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: var(--page-padding);
}

.main-content {
    min-width: 0;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.25rem;
    padding: 1.6rem 1.75rem;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.mobile-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg);
}

.mobile-toggle:active {
    transform: translateY(1px);
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.15;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.header-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 44px;
    min-height: 44px;
}

.header-actions form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

.header-actions form .btn {
    margin: 0;
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: inline-flex;
    }

    .sidebar {
        transform: translateX(-110%);
        transition: transform 0.25s ease;
        will-change: transform;
        z-index: 120;
        width: min(90vw, 320px);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 110;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

    .main-content {
        margin-left: 0;
        padding: var(--page-padding-mobile);
    }

    .header {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .header-left {
        width: 100%;
    }

    .header h1 {
        font-size: 1.35rem;
        white-space: normal;
    }

    .header-actions {
        width: 100%;
        gap: 0.5rem;
        justify-content: flex-start;
    }

    .header-actions form {
        flex: 1;
    }

    .header-actions .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }

    .btn-primary:hover,
    .post-item:hover,
    .stat-card:hover,
    .nav-item:hover,
    .logout-btn:hover,
    .action-btn:hover {
        transform: none !important;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.75rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

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

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
}

.stat-icon.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.1));
}

.stat-icon.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.1));
}

.stat-icon.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(248, 113, 113, 0.1));
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: visible;
    transition: var(--transition);
    margin-bottom: 2.25rem;
    backdrop-filter: blur(8px);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.posts-section-title {
    margin: 1rem 0 0.75rem;
    font-weight: 700;
    color: var(--text);
}

.posts-section-title:first-child {
    margin-top: 0;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.main-content .card:last-child {
    margin-bottom: 0;
}

.card-body {
    padding: 1.75rem;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg);
    border-radius: var(--radius);
    transition: var(--transition);
    border: 1px solid transparent;
}

.post-item:hover {
    background: #f8fafc;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.post-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    flex: 1;
    min-width: 0;
}

.post-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-preview {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-light);
}

.post-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.post-status.draft {
    background: #f1f5f9;
    color: var(--text-light);
}

.post-status.scheduled {
    background: #fef3c7;
    color: var(--warning);
}

.post-status.published {
    background: #dcfce7;
    color: var(--success);
}

.post-status.error {
    background: #fee2e2;
    color: var(--error);
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: 34px;
    min-width: 34px;
}

.action-btn:hover {
    background: var(--bg);
    color: var(--primary);
    transform: translateY(-1px);
}

.action-btn.delete:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: var(--border);
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

@media (max-width: 900px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .card-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .card-header-actions .btn {
        flex: 1 1 auto;
    }

    .breadcrumbs {
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filters > * {
        width: 100%;
    }

    .filters .filter-dropdown,
    .filters .filter-select,
    .filters .filter-dropdown-toggle,
    .filters-actions {
        width: 100%;
    }

    .filters-actions .btn {
        width: 100%;
    }

    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-row-label {
        width: 100%;
        justify-content: space-between;
    }

    .posts-list .post-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .posts-list .post-thumbnail {
        width: 64px;
        height: 64px;
    }

    .posts-list .post-content {
        width: 100%;
    }

    .posts-list .post-title {
        white-space: normal;
    }

    .posts-list .post-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .posts-list .post-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 1.5rem;
    }
}

@media (max-width: 600px) {
    .filter-dropdown-panel {
        left: 0;
        right: 0;
        min-width: 100%;
        max-width: 100%;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        text-align: center;
    }

    .empty-state {
        padding: 2rem 0.75rem;
    }

    .empty-state svg {
        width: 48px;
        height: 48px;
    }
}

.tooltip {
    position: fixed;
    background: #1e293b;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.tooltip.show {
    opacity: 1;
    transform: translateX(-50%);
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #1e293b;
}

.tooltip.tooltip-bottom::after {
    bottom: auto;
    top: -4px;
    border-top: 0;
    border-bottom: 4px solid #1e293b;
}

.action-btn {
    position: relative;
}

.tooltip.tooltip-inline {
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translate(-50%, 4px);
    z-index: 10;
}

.tooltip.tooltip-inline.show {
    transform: translate(-50%, 0);
}

.tooltip.tooltip-inline::after {
    bottom: auto;
    top: -4px;
    border-top: 0;
    border-bottom: 4px solid #1e293b;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--error);
}

.toast-warning {
    background: var(--warning);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.breadcrumbs a {
    color: var(--text-light);
    transition: var(--transition);
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs .separator {
    color: var(--border);
}

.breadcrumbs .current {
    color: var(--text);
    font-weight: 500;
}

.text-muted {
    color: var(--text-light);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.badge-warning {
    background: var(--warning);
    color: #111827;
}

.inline-form {
    display: inline;
}

.filters-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filters-row-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filters-row-spaced {
    margin-top: 0.75rem;
}

.filter-select-sm {
    min-width: 120px;
    width: 120px;
    flex: 0 0 auto;
    padding-right: 2.4rem;
    padding-left: 0.9rem;
    text-align: center;
    color: var(--text);
    background-color: var(--form-bg);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
    user-select: none;
}


input[type="checkbox"],
input[type="radio"] {
    width: var(--checkbox-size);
    height: var(--checkbox-size);
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label input[type="checkbox"] {
    transition: var(--transition);
}

.checkbox-label input[type="checkbox"]:hover {
    border-color: var(--primary);
}

.checkbox-label span {
    font-weight: 400;
}
