/* BugTrack - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --primary: #1a56db;
    --primary-dark: #1244b8;
    --secondary: #374151;
    --success: #047857;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0369a1;
    --bg: #f3f4f6;
    --surface: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
    --text-muted: #6b7280;
    --sidebar-bg: #111827;
    --sidebar-text: #d1d5db;
    --sidebar-active: #1a56db;
    --font: 'DM Sans', sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 13.5px; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- LAYOUT ---- */
.wrapper { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px; background: var(--sidebar-bg); color: var(--sidebar-text);
    display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
    height: 100vh; z-index: 1000; transition: transform 0.3s;
}
.sidebar-logo {
    padding: 14px 16px; display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-logo img { width: 30px; height: 30px; border-radius: 6px; }
.sidebar-logo span { font-weight: 700; font-size: 15px; color: #fff; letter-spacing: -0.3px; }
.sidebar nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.sidebar nav a {
    display: flex; align-items: center; gap: 9px; padding: 8px 16px;
    color: var(--sidebar-text); font-size: 13px; font-weight: 500;
    border-left: 3px solid transparent; transition: all 0.15s;
}
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,0.06); text-decoration: none; }
.sidebar nav a.active { color: #fff; background: rgba(26,86,219,0.2); border-left-color: var(--sidebar-active); }
.sidebar nav a .icon { width: 16px; text-align: center; font-size: 14px; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.07); font-size: 12px; color: #9ca3af; }
.sidebar-footer .user-name { color: #fff; font-weight: 500; font-size: 13px; }

.main-content { margin-left: 220px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0 20px; height: 50px; display: flex; align-items: center;
    justify-content: space-between; position: sticky; top: 0; z-index: 100;
}
.topbar-title { font-weight: 600; font-size: 14px; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.hamburger { display: none; background: none; border: none; cursor: pointer; color: var(--text); font-size: 20px; }
.page-body { padding: 16px 20px; flex: 1; }

/* ---- CARDS ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
.card-header { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h6 { font-weight: 600; font-size: 13px; margin: 0; }
.card-body { padding: 14px; }

/* ---- STATS CARDS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.stat-icon { width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.stat-icon.blue { background: #dbeafe; color: #1d4ed8; }
.stat-icon.red { background: #fee2e2; color: #b91c1c; }
.stat-icon.green { background: #d1fae5; color: #065f46; }
.stat-icon.orange { background: #fef3c7; color: #92400e; }
.stat-num { font-size: 22px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---- PROJECT CARDS ---- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; transition: box-shadow 0.15s; }
.project-card:hover { box-shadow: var(--shadow-md); }
.project-card-title { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.project-card-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-card-meta { display: flex; align-items: center; justify-content: space-between; }
.bug-count { background: #fee2e2; color: #b91c1c; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.bug-count.zero { background: #d1fae5; color: #065f46; }

/* ---- TABLES ---- */
.table-responsive { overflow-x: auto; }
table.dataTable { width: 100% !important; font-size: 12.5px; border-collapse: collapse; }
table.dataTable thead th { background: #f9fafb; font-weight: 600; font-size: 12px; color: var(--secondary); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.dataTable tbody td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.dataTable tbody tr:hover { background: #f9fafb; }
.dt-filter-row th { padding: 4px 6px !important; }
.dt-filter-row input { width: 100%; font-size: 11px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; }

/* ---- FORMS ---- */
.form-label { font-size: 12px; font-weight: 600; margin-bottom: 3px; display: block; }
.form-control, .form-select {
    font-family: var(--font); font-size: 13px; padding: 6px 10px;
    border: 1px solid var(--border); border-radius: var(--radius);
    width: 100%; background: #fff; color: var(--text); outline: none;
    transition: border-color 0.15s;
}
.form-control:focus, .form-select:focus { border-color: var(--primary); }
.form-control.is-invalid { border-color: var(--danger); }
textarea.form-control { resize: vertical; min-height: 70px; }

/* ---- BUTTONS ---- */
.btn { font-family: var(--font); font-size: 12.5px; font-weight: 500; padding: 6px 14px; border: none; border-radius: var(--radius); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: opacity 0.15s; }
.btn:hover { opacity: 0.88; text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 11px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-light { background: #f3f4f6; color: var(--text); border: 1px solid var(--border); }
.btn-outline-primary { background: transparent; color: var(--primary); border: 1px solid var(--primary); }

/* ---- BADGES ---- */
.badge { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 20px; display: inline-block; }
.bg-danger { background: #fee2e2; color: #b91c1c; }
.bg-warning { background: #fef3c7; color: #92400e; }
.bg-secondary { background: #f3f4f6; color: #4b5563; }
.bg-success { background: #d1fae5; color: #065f46; }
.bg-primary { background: #dbeafe; color: #1d4ed8; }

/* ---- BUG LIST ---- */
.bug-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; background: #fff; display: flex; align-items: flex-start; gap: 10px; }
.bug-item.done-item { opacity: 0.6; background: #f9fafb; }
.bug-check { flex-shrink: 0; margin-top: 2px; }
.bug-check input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--success); }
.bug-body { flex: 1; min-width: 0; }
.bug-title { font-weight: 500; font-size: 13px; margin-bottom: 3px; }
.bug-meta { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bug-actions { flex-shrink: 0; display: flex; gap: 4px; }
.bug-files { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.bug-files a { color: var(--info); }

/* ---- URL LIST ---- */
.url-list { display: flex; flex-wrap: wrap; gap: 6px; }
.url-chip { background: #dbeafe; color: #1e40af; font-size: 11.5px; padding: 3px 10px; border-radius: 20px; display: inline-flex; align-items: center; gap: 4px; }

/* ---- FILE LIST ---- */
.file-list { display: flex; flex-wrap: wrap; gap: 6px; }
.file-chip { background: #f3f4f6; border: 1px solid var(--border); font-size: 11.5px; padding: 3px 10px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; }
.file-chip a { color: var(--text); }
.file-chip .del-file { color: var(--danger); cursor: pointer; font-size: 13px; line-height: 1; }

/* ---- MODALS ---- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 2000; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal-box { background: #fff; border-radius: 8px; width: 90%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.modal-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h6 { font-weight: 600; font-size: 14px; margin: 0; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 16px; }
.modal-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ---- TOAST ---- */
#toast-container { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 9999; pointer-events: none; }
.toast-msg { background: #111827; color: #fff; padding: 10px 20px; border-radius: 6px; font-size: 13px; font-weight: 500; box-shadow: 0 8px 30px rgba(0,0,0,0.2); opacity: 0; transition: opacity 0.3s; text-align: center; min-width: 200px; }
.toast-msg.show { opacity: 1; }
.toast-msg.success { background: #065f46; }
.toast-msg.error { background: #b91c1c; }
.toast-msg.warning { background: #92400e; }

/* ---- LOGIN ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 36px 32px; width: 100%; max-width: 360px; box-shadow: var(--shadow-md); }
.login-logo { text-align: center; margin-bottom: 20px; }
.login-logo img { width: 56px; height: 56px; border-radius: 12px; }
.login-logo h4 { font-size: 18px; font-weight: 700; margin-top: 8px; }

/* ---- PRIORITY INDICATOR ---- */
.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; margin-top: 4px; }
.priority-dot.high { background: var(--danger); }
.priority-dot.medium { background: var(--warning); }
.priority-dot.low { background: #9ca3af; }

/* ---- MISC ---- */
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 10px; }
.empty-state { text-align: center; padding: 30px 20px; color: var(--text-muted); }
.empty-state i { font-size: 32px; margin-bottom: 8px; opacity: 0.4; }
.empty-state p { font-size: 13px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex-1 { flex: 1; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.fw-600 { font-weight: 600; }
.fs-12 { font-size: 12px; }
.mono { font-family: var(--mono); }
.w-100 { width: 100%; }

/* ---- URL ENTRY ROW ---- */
.url-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.url-row .form-control { flex: 1; }
.url-row .btn-danger { flex-shrink: 0; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .hamburger { display: block; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .project-grid { grid-template-columns: 1fr; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .page-body { padding: 12px; }
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; }
    .sidebar-overlay.show { display: block; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .login-card { padding: 24px 18px; }
}

/* ---- PASTE ZONE ---- */
#paste-zone { transition: border-color 0.15s, background 0.15s; }
#paste-zone:focus-within, #paste-zone.drag-over { border-color: var(--primary); background: #eff6ff; }
.bugtype-scope { background: #f3f4f6; color: #4b5563; }
.bugtype-bug   { background: #fee2e2; color: #b91c1c; }
.bugtype-extra { background: #dbeafe; color: #1d4ed8; }
