* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}
body {
    background: #f8f9fa;
    color: #1f2937;
    min-height: 100vh;
}
a {
    color: #2563eb;
    text-decoration: none;
}

/* AUTH SCREEN (login) */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 75% 15%, rgba(37, 99, 235, 0.08), transparent 50%),
        radial-gradient(circle at 10% 85%, rgba(124, 58, 237, 0.07), transparent 50%);
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(17, 24, 39, 0.08);
}
.auth-logo {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
}
.auth-sub {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 28px;
}
.field {
    margin-bottom: 18px;
}
.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.field input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: #111827;
    transition: 0.2s;
}
.field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
}
.draft-image-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 8px 0 0;
}
.draft-video-note {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: #2563eb;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 8px 0;
}
.btn-block {
    width: 100%;
    padding: 13px 0;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}
.btn-block:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}
.auth-back {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #9ca3af;
}
.auth-back:hover {
    color: #6b7280;
}

/* APP SHELL */
.app-shell {
    display: flex;
    min-height: 100vh;
}
.app-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #111827;
    color: #e5e7eb;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
}
.app-logo {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 32px;
    letter-spacing: -0.3px;
}
.app-logo span {
    background: linear-gradient(90deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.app-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.app-nav a {
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: 8px;
    transition: 0.2s;
}
.app-nav a.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.app-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.app-logout {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #9ca3af;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}
.app-logout:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.app-main {
    flex: 1;
    padding: 40px 48px;
    max-width: 1100px;
}
.app-main h1 {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}
.app-main .page-sub {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 32px;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}
.stat-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 4px 16px rgba(17, 24, 39, 0.04);
}
.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 2px;
}
.stat-card .stat-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}
.empty-panel {
    background: #fff;
    border: 1px dashed #d1d5db;
    border-radius: 14px;
    padding: 48px 24px;
    text-align: center;
}
.empty-panel h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}
.empty-panel p {
    color: #6b7280;
    font-size: 14px;
}

/* PAGE HEADER */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}
.page-header .heading-group h1 {
    margin-bottom: 4px;
}
.page-header .heading-group .page-sub {
    margin-bottom: 0;
}
.btn-solid {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 22px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
}
.btn-solid:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* PROJECT CARD GRID */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}
.project-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 16px rgba(17, 24, 39, 0.04);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.project-card.is-archived {
    opacity: 0.6;
}
.project-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}
.project-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.project-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.project-card-title {
    flex: 1;
    min-width: 0;
}
.project-card-title h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-active {
    background: #ecfdf5;
    color: #059669;
}
.badge-archived {
    background: #f3f4f6;
    color: #6b7280;
}
.badge-danger {
    background: #fef2f2;
    color: #b91c1c;
}
.project-card-desc {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.project-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}
.chip-btn {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.15s;
}
.chip-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}
.chip-btn.chip-danger {
    color: #b91c1c;
}
.chip-btn.chip-danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
}
.chip-btn.chip-primary {
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    border: none;
    color: #fff;
    font-weight: 600;
}
.chip-btn.chip-primary:hover {
    opacity: 0.92;
}
.chip-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.sync-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}
.sync-badge.sync-fresh {
    background: #ecfdf5;
    color: #059669;
}
.sync-badge.sync-stale {
    background: #fef3c7;
    color: #92400e;
    cursor: help;
}
.sync-badge.sync-unavailable {
    background: #f3f4f6;
    color: #9ca3af;
}

/* DRAWER (create/edit project) */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.4);
    display: flex;
    justify-content: flex-end;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
.drawer-panel {
    width: 100%;
    max-width: 520px;
    background: #f8f9fa;
    height: 100%;
    overflow-y: auto;
    padding: 32px;
    transform: translateX(24px);
    transition: transform 0.2s;
}
.drawer-overlay.open .drawer-panel {
    transform: translateX(0);
}
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.drawer-header h2 {
    font-size: 20px;
    margin-bottom: 0;
}
.drawer-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
}
.drawer-close:hover {
    color: #111827;
}
.form-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin: 24px 0 12px;
}
.form-section-title:first-of-type {
    margin-top: 0;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: #111827;
    resize: vertical;
    min-height: 70px;
    transition: 0.2s;
}
.field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.field .hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
}
.drawer-footer {
    display: flex;
    gap: 10px;
    margin-top: 28px;
}
.drawer-footer .btn-solid {
    flex: 1;
    justify-content: center;
}
.btn-cancel {
    flex: 0 0 auto;
    padding: 12px 20px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}
.btn-cancel:hover {
    background: #f9fafb;
}

/* FILTER BAR */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}
.filter-bar select,
.filter-bar input {
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    color: #374151;
    background: #fff;
}
.filter-bar input {
    flex: 1;
    min-width: 220px;
}
.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: #2563eb;
}

/* DRAFT LIST */
.draft-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.draft-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: 0 4px 16px rgba(17, 24, 39, 0.04);
}
.draft-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.badge-platform {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}
.draft-project {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.draft-date {
    margin-left: auto;
    font-size: 12px;
    color: #9ca3af;
}
.draft-headline {
    font-size: 16px;
    margin-bottom: 6px;
}
.draft-caption {
    font-size: 13px;
    color: #4b5563;
    white-space: pre-wrap;
    margin-bottom: 10px;
}
.hashtag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.hashtag-chip {
    font-size: 12px;
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
    padding: 3px 10px;
    border-radius: 20px;
}
.draft-image {
    display: block;
    max-width: 280px;
    width: 100%;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* NEWS SOURCES (project edit drawer) */
.source-list {
    list-style: none;
    margin: 8px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}
.source-item-label {
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.source-item-empty {
    font-size: 13px;
    color: #9ca3af;
    list-style: none;
    padding: 4px 0;
}
.source-add-row {
    display: flex;
    gap: 8px;
}
.source-add-row input,
.source-add-row select {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
}

/* HISTORY / CRON LOG */
.cron-log-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cron-log-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 4px 16px rgba(17, 24, 39, 0.04);
}
.cron-log-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.cron-log-date {
    margin-left: auto;
    font-size: 12px;
    color: #9ca3af;
}
.cron-log-empty {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}
.cron-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.cron-log-table td {
    padding: 8px 10px;
    border-top: 1px solid #f3f4f6;
    color: #374151;
}
.cron-log-table tr:first-child td {
    border-top: none;
}
