/* --- GLOBAL / SHARED RESET --- */
* {
    box-sizing: border-box;
}

/* --- LOGIN PAGE (login.php) --- */
body.page-login {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: radial-gradient(circle at top right, #f8fafc, #e2e8f0);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #1e293b;
}
.page-login .login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(30, 41, 59, 0.1);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    border: 1px solid rgba(226, 232, 240, 0.8);
}
.page-login .logo-container {
    text-align: center;
    margin-bottom: 25px;
}
.page-login .logo-text {
    font-size: 28px;
    font-weight: 800;
    color: #1b365d;
    letter-spacing: 2px;
    margin: 0;
}
.page-login .logo-sub {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #64748b;
    margin-top: 5px;
    font-weight: bold;
}
.page-login .logo-img {
    max-width: 150px;
    margin-bottom: 10px;
}
.page-login .error-banner {
    background: #fdf2f2;
    border-left: 4px solid #ef4444;
    color: #b91c1c;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 500;
}
.page-login .form-group {
    margin-bottom: 20px;
}
.page-login .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}
.page-login .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.page-login .form-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.page-login .btn-submit {
    width: 100%;
    padding: 14px;
    background: #1b365d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}
.page-login .btn-submit:hover {
    background: #254a80;
}
.page-login .footer {
    text-align: center;
    margin-top: 25px;
    font-size: 12px;
    color: #64748b;
}

/* --- INDEX PAGE (index.php) --- */
body.page-index {
    font-family: 'Segoe UI', sans-serif;
    background: #f4f6f9;
    margin: 0;
    display: flex;
    height: 100vh;
}
.page-index .sidebar {
    width: 400px;
    background: white;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}
.page-index .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #1b365d;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.page-index .sidebar-header .app-brand {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1.5px;
}
.page-index .sidebar-header .btn-logout {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}
.page-index .sidebar-header .btn-logout:hover {
    color: white;
    background: #ef4444;
    border-color: #ef4444;
}
.page-index .search-box {
    padding: 15px;
    border-bottom: 1px solid #eee;
}
.page-index .search-box input {
    width: 90%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.page-index .article-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}
.page-index .article-item {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: grab;
}
.page-index .article-item:active {
    cursor: grabbing;
}
.page-index .article-item:hover {
    background: #f8f9fa;
}
.page-index .sortable-ghost {
    opacity: 0.4;
    background: #cbd5e1;
}
.page-index .viewer {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #fff;
    margin: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.page-index .btn-generate {
    background: #3498db;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.page-index .btn-generate:hover {
    background: #2980b9;
}
.page-index .btn-generate-dpgf {
    background: #2ecc71;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
}
.page-index .btn-generate-dpgf:hover {
    background: #27ae60;
}
.page-index .badge-img {
    background: #e67e22;
    color: white;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 3px;
}
.page-index .category-block {
    margin-bottom: 8px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.page-index .category-header {
    background: #f8fafc;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    user-select: none;
    font-size: 13px;
    color: #334155;
    font-weight: bold;
    transition: background 0.15s ease;
    border-bottom: 1px solid #e2e8f0;
}
.page-index .category-header:hover {
    background: #f1f5f9;
}
.page-index .category-toggle-icon {
    margin-right: 8px;
    font-size: 9px;
    transition: transform 0.2s ease;
    display: inline-block;
    color: #64748b;
}
.page-index .category-toggle-icon.collapsed {
    transform: rotate(-90deg);
}
.page-index .category-content {
    transition: max-height 0.25s ease-out;
}
.page-index .category-content.collapsed {
    display: none;
}

/* --- IMPORT PAGE (import.php) --- */
body.page-import {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    margin: 0;
    padding: 40px;
}
.page-import .container {
    max-width: 600px;
    background: white;
    margin: 0 auto;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.page-import h1 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 5px;
    text-align: center;
}
.page-import .slogan {
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 30px;
}
.page-import .upload-box {
    border: 2px dashed #3498db;
    padding: 30px;
    text-align: center;
    border-radius: 6px;
    background: #eef7fc;
    cursor: pointer;
    transition: background 0.2s;
}
.page-import .upload-box:hover {
    background: #e1f0fa;
}
.page-import input[type="file"] {
    display: none;
}
.page-import .btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.2s;
}
.page-import .btn:hover {
    background: #27ae60;
}
.page-import .alert {
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    font-size: 14px;
}
.page-import .alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.page-import .alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.page-import .file-name {
    margin-top: 10px;
    font-weight: bold;
    color: #34495e;
}
.page-import .loading {
    display: none;
    text-align: center;
    margin-top: 15px;
    color: #3498db;
    font-weight: bold;
}

/* --- IMPORT CATEGORIES PAGE (import_categories.php) --- */
body.page-import-categories {
    font-family: 'Segoe UI', sans-serif;
    background: #f4f6f9;
    padding: 40px;
    color: #333;
    margin: 0;
}
.page-import-categories .container {
    max-width: 750px;
    background: white;
    margin: 0 auto;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.page-import-categories h1 {
    color: #1b365d;
    font-size: 22px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 20px;
}
.page-import-categories .success-item {
    background: #eef9f6;
    border-left: 4px solid #2ecc71;
    padding: 12px 18px;
    margin-bottom: 12px;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
}
.page-import-categories .summary {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-weight: bold;
    font-size: 16px;
    color: #2c3e50;
}
.page-import-categories .error-message {
    background: #fdf2f2;
    border-left: 4px solid #e74c3c;
    padding: 15px;
    border-radius: 0 4px 4px 0;
    color: #c0392b;
    margin-bottom: 20px;
    font-weight: bold;
}

/* --- ADMIN PAGE (admin_article.php) --- */
body.page-admin {
    font-family: 'Segoe UI', sans-serif;
    background: #f4f6f9;
    margin: 0;
    padding: 40px;
    color: #333;
}
.page-admin .container {
    max-width: 900px;
    background: white;
    margin: 0 auto;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.page-admin h1 {
    color: #1b365d;
    font-size: 22px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.page-admin .btn-back {
    font-size: 13px;
    background: #64748b;
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s;
}
.page-admin .btn-back:hover {
    background: #475569;
}
.page-admin .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.page-admin .form-group {
    display: flex;
    flex-direction: column;
}
.page-admin .form-group.full-width {
    grid-column: span 2;
}
.page-admin .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}
.page-admin .form-group input, 
.page-admin .form-group select {
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.page-admin .form-group input:focus, 
.page-admin .form-group select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.page-admin .btn-save {
    padding: 12px 24px;
    background: #1b365d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.page-admin .btn-save:hover {
    background: #254a80;
}
.page-admin .btn-save-continue {
    padding: 12px 24px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.page-admin .btn-save-continue:hover {
    background: #059669;
}
.page-admin .btn-duplicate {
    padding: 12px 24px;
    background: #e28743;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.page-admin .btn-duplicate:hover {
    background: #c56e2f;
}
.page-admin .alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}
.page-admin .alert-success {
    background: #eef9f6;
    color: #1e7e34;
    border-left: 4px solid #2ecc71;
}
.page-admin .alert-error {
    background: #fdf2f2;
    color: #b91c1c;
    border-left: 4px solid #ef4444;
}
.page-admin .action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* --- GLOBAL ADMIN NAVIGATION HEADER --- */
.admin-nav {
    background: #1b365d;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    border-bottom: 3px solid #3498db;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.admin-nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}
.admin-nav-links .nav-brand {
    color: white;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 1px;
    margin-right: 20px;
    text-transform: uppercase;
}
.admin-nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
    padding: 6px 12px;
    border-radius: 4px;
}
.admin-nav-links a:hover, .admin-nav-links a.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}
.admin-nav .btn-logout {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}
.admin-nav .btn-logout:hover {
    color: white;
    background: #dc2626;
    border-color: #dc2626;
}

/* --- RIGHT SIDEBAR SUMMARY PANEL --- */
.right-sidebar {
    width: 380px;
    background: white;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.right-sidebar .summary-content {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
}
.right-sidebar .trade-section {
    margin-bottom: 20px;
}
.right-sidebar .trade-title {
    color: #1b365d;
    font-size: 14px;
    font-weight: bold;
    border-bottom: 2px solid #1b365d;
    padding-bottom: 6px;
    margin-top: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: move;
}
.right-sidebar .category-section {
    margin-bottom: 15px;
    margin-left: 10px;
}
.right-sidebar .category-title {
    color: #2c3e50;
    font-size: 13px;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 8px;
    cursor: move;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}
.right-sidebar .category-title:hover {
    background: #f1f5f9;
}
.right-sidebar .category-drag-handle {
    font-size: 14px;
    color: #94a3b8;
    flex-shrink: 0;
    line-height: 1;
    user-select: none;
}
.right-sidebar .articles-container {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 6px;
    min-height: 40px;
}
.right-sidebar .summary-article-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 5px;
    font-size: 12px;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.right-sidebar .summary-article-item:active {
    cursor: grabbing;
}
.right-sidebar .summary-article-item:last-child {
    margin-bottom: 0;
}
.right-sidebar .summary-article-number {
    font-weight: bold;
    color: #3498db;
    font-size: 11px;
}
.right-sidebar .summary-article-title {
    font-weight: 500;
    color: #334155;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



