/* ============================================================
   PANEOTECH QA Platform - Brand Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* PANEOTECH Brand Colors */
    --pt-dark: #1a1a2e;
    --pt-dark-blue: #16213e;
    --pt-navy: #0f3460;
    --pt-blue: #1a56db;
    --pt-blue-light: #3b82f6;
    --pt-accent: #e94560;
    --pt-accent-light: #ff6b81;
    --pt-gold: #f0a500;
    --pt-green: #10b981;
    --pt-orange: #f97316;
    --pt-purple: #8b5cf6;

    /* Neutrals */
    --pt-white: #ffffff;
    --pt-gray-50: #f8fafc;
    --pt-gray-100: #f1f5f9;
    --pt-gray-200: #e2e8f0;
    --pt-gray-300: #cbd5e1;
    --pt-gray-400: #94a3b8;
    --pt-gray-500: #64748b;
    --pt-gray-600: #475569;
    --pt-gray-700: #334155;
    --pt-gray-800: #1e293b;
    --pt-gray-900: #0f172a;

    /* Layout */
    --sidebar-width: 280px;
    --header-height: 64px;
    --border-radius: 10px;
    --border-radius-sm: 6px;
    --border-radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--pt-gray-50);
    color: var(--pt-gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--pt-blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--pt-accent); }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--pt-dark) 0%, var(--pt-dark-blue) 100%);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.sidebar-brand .brand-text {
    color: var(--pt-white);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.sidebar-brand .brand-sub {
    color: var(--pt-gold);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    color: var(--pt-gray-400);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    color: var(--pt-gray-300);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--pt-white);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--pt-accent), #d63751);
    color: var(--pt-white);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

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

.nav-item .badge {
    margin-left: auto;
    background: var(--pt-accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* HEADER */
.top-header {
    background: var(--pt-white);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--pt-gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--pt-gray-900);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--pt-gray-400);
}

.breadcrumb a { color: var(--pt-gray-500); }
.breadcrumb a:hover { color: var(--pt-blue); }
.breadcrumb .separator { color: var(--pt-gray-300); }

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.user-menu:hover { background: var(--pt-gray-50); }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pt-blue), var(--pt-navy));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

/* PAGE CONTENT */
.page-content {
    padding: 32px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--pt-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--pt-gray-200);
    overflow: hidden;
    transition: var(--transition);
}

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

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--pt-gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--pt-gray-900);
}

.card-body {
    padding: 24px;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--pt-white);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    border: 1px solid var(--pt-gray-200);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg { width: 24px; height: 24px; }

.stat-info h3 {
    font-size: 28px;
    font-weight: 800;
    color: var(--pt-gray-900);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 13px;
    color: var(--pt-gray-500);
    font-weight: 500;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
    background: linear-gradient(135deg, var(--pt-accent), #d63751);
    color: white;
    box-shadow: 0 4px 14px rgba(233, 69, 96, 0.25);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.35);
}

.btn-accent {
    background: linear-gradient(135deg, var(--pt-accent), #d63751);
    color: white;
    box-shadow: 0 4px 14px rgba(233, 69, 96, 0.25);
}
.btn-accent:hover { transform: translateY(-1px); }

.btn-success {
    background: linear-gradient(135deg, var(--pt-green), #059669);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--pt-gray-300);
    color: var(--pt-gray-700);
}
.btn-outline:hover {
    border-color: var(--pt-accent);
    color: var(--pt-accent);
    background: rgba(233, 69, 96, 0.04);
}

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--border-radius-sm);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--pt-gray-700);
    margin-bottom: 6px;
}

.form-group label .required {
    color: var(--pt-accent);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    border: 1.5px solid var(--pt-gray-200);
    border-radius: var(--border-radius-sm);
    background: var(--pt-white);
    color: var(--pt-gray-800);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--pt-accent);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.form-control::placeholder {
    color: var(--pt-gray-400);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 36px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input-wrapper input[type="color"] {
    width: 44px;
    height: 38px;
    padding: 2px;
    border: 1.5px solid var(--pt-gray-200);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
}

.color-input-wrapper input[type="text"] {
    flex: 1;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--pt-gray-500);
    background: var(--pt-gray-50);
    border-bottom: 1px solid var(--pt-gray-200);
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--pt-gray-100);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--pt-gray-50);
}

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.priority-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--pt-white);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--pt-gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: var(--pt-gray-100);
    cursor: pointer;
    transition: var(--transition);
    color: var(--pt-gray-600);
}

.modal-close:hover {
    background: var(--pt-accent);
    color: white;
}

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--pt-gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 14px 20px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(233, 69, 96, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(26, 86, 219, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.login-card {
    background: var(--pt-white);
    border-radius: var(--border-radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo img {
    height: 48px;
    margin-bottom: 12px;
}

.login-logo h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--pt-gray-900);
}

.login-logo p {
    font-size: 13px;
    color: var(--pt-gray-500);
    margin-top: 4px;
}

/* ============================================================
   TRACKER PUBLIC INTERFACE
   ============================================================ */
.tracker-layout {
    min-height: 100vh;
    background: var(--pt-gray-50);
}

.tracker-header {
    background: linear-gradient(135deg, var(--pt-dark) 0%, var(--pt-dark-blue) 100%);
    padding: 24px 0;
    color: white;
}

.tracker-header .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tracker-header .brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tracker-header .brand img {
    height: 36px;
}

.tracker-header .brand-info h1 {
    font-size: 16px;
    font-weight: 700;
}

.tracker-header .brand-info p {
    font-size: 12px;
    color: var(--pt-gray-400);
}

.tracker-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

.tracker-welcome {
    margin-bottom: 32px;
}

.tracker-welcome h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--pt-gray-900);
    margin-bottom: 6px;
}

.tracker-welcome p {
    color: var(--pt-gray-500);
    font-size: 15px;
}

/* Issue Card in Tracker View */
.issue-card {
    background: var(--pt-white);
    border-radius: var(--border-radius);
    border: 1px solid var(--pt-gray-200);
    padding: 20px;
    margin-bottom: 12px;
    transition: var(--transition);
    cursor: pointer;
}

.issue-card:hover {
    border-color: var(--pt-blue-light);
    box-shadow: var(--shadow);
    transform: translateX(4px);
}

.issue-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.issue-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--pt-gray-900);
}

.issue-card-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--pt-gray-400);
    font-weight: 500;
}

.issue-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--pt-gray-500);
}

.issue-card-meta svg {
    width: 14px;
    height: 14px;
    margin-right: 3px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    color: var(--pt-gray-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--pt-gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--pt-gray-500);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--pt-gray-700);
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .mobile-toggle {
        display: block;
    }
}

@media (max-width: 640px) {
    .page-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .login-card { padding: 32px 24px; margin: 16px; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.4s ease forwards;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
