/* ============================================================
   app.css  –  WP Auto Publisher Panel Stilleri
   Tipografi: Plus Jakarta Sans + JetBrains Mono
   Tema: Dark Professional
   ============================================================ */

:root {
    --sidebar-w:      240px;
    --topbar-h:       60px;
    --bg-base:        #0d1117;
    --bg-card:        #161b22;
    --bg-card-hover:  #1c2331;
    --bg-sidebar:     #010409;
    --border:         #30363d;
    --accent:         #2ea043;
    --accent-glow:    rgba(46,160,67,.25);
    --accent-blue:    #388bfd;
    --accent-orange:  #e3b341;
    --accent-red:     #f85149;
    --text-primary:   #e6edf3;
    --text-muted:     #7d8590;
    --text-faint:     #484f58;
    --mono:           'JetBrains Mono', monospace;
    --sans:           'Plus Jakarta Sans', sans-serif;
    --radius:         8px;
    --radius-lg:      14px;
    --shadow:         0 4px 24px rgba(0,0,0,.4);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--sans);
    font-size: 14px;
    background: var(--bg-base);
    color: var(--text-primary);
    margin: 0;
    overflow-x: hidden;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform .25s ease;
}
.sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--border);
}
.brand-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--accent), #1a7431);
    border-radius: 8px;
    display: grid; place-items: center;
    font-size: 18px;
}
.brand-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -.3px;
}

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    transition: background .15s, color .15s;
    margin-bottom: 2px;
}
.sidebar-nav .nav-link:hover  { background: var(--bg-card); color: var(--text-primary); }
.sidebar-nav .nav-link.active {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(46,160,67,.3);
}
.sidebar-nav .nav-link i { font-size: 15px; width: 18px; text-align: center; }
.nav-divider { height: 1px; background: var(--border); margin: 10px 4px; }
.nav-link-danger:hover { color: var(--accent-red) !important; }
.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    font-size: 12px;
}

/* ===================== MAIN ===================== */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    transition: margin .25s ease;
}
.main-wrapper.expanded { margin-left: 0; }

/* ===================== TOPBAR ===================== */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky; top: 0; z-index: 100;
}
.sidebar-toggle {
    background: none; border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    display: none;
}
.topbar-title h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.topbar-right { margin-left: auto; }
.status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-base);
    padding: 4px 12px;
    border-radius: 99px;
    border: 1px solid var(--border);
}
.status-dot {
    width: 7px; height: 7px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%,100% { opacity:1; }
    50%      { opacity:.4; }
}

/* ===================== PAGE ===================== */
.page-content { padding-top: 24px; }

/* ===================== CARDS ===================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

/* ===================== STAT CARDS ===================== */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color .2s, box-shadow .2s;
}
.stat-card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 1px var(--accent-blue), var(--shadow);
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: grid; place-items: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-icon.green  { background: rgba(46,160,67,.15);  color: var(--accent); }
.stat-icon.blue   { background: rgba(56,139,253,.15); color: var(--accent-blue); }
.stat-icon.orange { background: rgba(227,179,65,.15); color: var(--accent-orange); }
.stat-icon.red    { background: rgba(248,81,73,.15);  color: var(--accent-red); }
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .6px;
}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--mono);
    line-height: 1;
}

/* ===================== TABLES ===================== */
.table {
    color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border);
}
.table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border) !important;
    padding: 10px 12px;
}
.table td { padding: 12px; vertical-align: middle; }
.table-hover tbody tr:hover td { background: var(--bg-card-hover); }

/* ===================== FORMS ===================== */
.form-control, .form-select {
    background: var(--bg-base);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius);
    font-size: 13.5px;
    padding: 8px 12px;
}
.form-control:focus, .form-select:focus {
    background: var(--bg-base);
    border-color: var(--accent-blue);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(56,139,253,.15);
}
.form-control::placeholder { color: var(--text-faint); }
.form-label { font-weight: 500; font-size: 13px; margin-bottom: 6px; }
.form-text  { color: var(--text-muted); font-size: 12px; }

/* Textarea mono */
textarea.code-area { font-family: var(--mono); font-size: 13px; }

/* ===================== BUTTONS ===================== */
.btn { font-weight: 600; font-size: 13px; border-radius: var(--radius); }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover { background: #3fb950; border-color: #3fb950; }
.btn-outline-secondary {
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-outline-secondary:hover { color: var(--text-primary); background: var(--bg-card-hover); border-color: var(--border); }
.btn-sm { font-size: 12px; padding: 4px 10px; }

/* ===================== BADGE ===================== */
.badge { font-size: 11px; font-weight: 600; letter-spacing: .3px; }

/* ===================== ALERTS ===================== */
.alert {
    border-radius: var(--radius);
    font-size: 13.5px;
    border-left-width: 3px;
}
.alert-success { background: rgba(46,160,67,.12);  border-color: var(--accent);       color: #7ee787; }
.alert-danger  { background: rgba(248,81,73,.12);  border-color: var(--accent-red);   color: #ff9492; }
.alert-warning { background: rgba(227,179,65,.12); border-color: var(--accent-orange); color: #f0c040; }
.alert-info    { background: rgba(56,139,253,.12); border-color: var(--accent-blue);  color: #79c0ff; }

/* ===================== LOGIN PAGE ===================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow);
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo .logo-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--accent), #1a7431);
    border-radius: 14px;
    display: inline-grid; place-items: center;
    font-size: 28px;
    margin-bottom: 12px;
}
.login-logo h2 { font-size: 20px; font-weight: 700; margin: 0; }
.login-logo p  { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }

/* ===================== SCHEDULE TOGGLE ===================== */
#scheduled-options { display: none; }
#scheduled-options.show { display: block; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .stat-value { font-size: 22px; }
}
