/**
 * DVBugsTracker - Professional UI Styles
 */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --light: #f8fafc;
    --dark: #1e293b;
    --border: #e2e8f0;
    --text: #334155;
    --text-muted: #94a3b8;
    --navbar-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    background: #f1f5f9;
}

/* Layout */
.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar - Horizontal */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    height: var(--navbar-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    color: var(--dark);
}

.navbar-brand i {
    font-size: 24px;
    color: var(--primary);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-nav .nav-item {
    margin: 0;
}

.navbar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.navbar-nav .nav-link:hover {
    background: #f1f5f9;
    color: var(--text);
}

.navbar-nav .nav-link.active {
    background: var(--primary);
    color: #fff;
}

.navbar-nav .nav-link i {
    font-size: 16px;
}

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

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.user-btn:hover {
    background: #f1f5f9;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.user-name-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.user-btn i.bi-chevron-down {
    font-size: 12px;
    color: var(--text-muted);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    min-width: 200px;
    display: none;
    z-index: 1001;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-header {
    padding: 12px 16px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: #f8fafc;
}

.dropdown-item i {
    font-size: 16px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.content-body {
    /* Wrapper for cards */
}

/* Footer */
.footer {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 20px 0;
    margin-top: auto;
}

.footer p {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

/* Cards - Increased margin */
.card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafbfc;
    border-radius: 10px 10px 0 0;
}

.card-body {
    padding: 20px;
}

.card-body.compact {
    padding: 16px;
}

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

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 6px;
    font-weight: 500;
}

.stat-card.primary { border-left: 4px solid var(--primary); }
.stat-card.success { border-left: 4px solid var(--success); }
.stat-card.warning { border-left: 4px solid var(--warning); }
.stat-card.danger { border-left: 4px solid var(--danger); }
.stat-card.info { border-left: 4px solid var(--info); }

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tr:hover {
    background: #f8fafc;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
}

.status-open {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-process {
    background: #fef3c7;
    color: #b45309;
}

.status-test {
    background: #e0e7ff;
    color: #4338ca;
}

.status-closed {
    background: #d1fae5;
    color: #047857;
}

.status-cancel {
    background: #fee2e2;
    color: #b91c1c;
}

.status-success {
    background: #d1fae5;
    color: #047857;
}

.status-muted {
    background: #f1f5f9;
    color: #64748b;
}

/* Priority Badges */
.priority {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-low {
    background: #f0fdf4;
    color: #15803d;
}

.priority-medium {
    background: #fffbeb;
    color: #b45309;
}

.priority-high {
    background: #fef2f2;
    color: #b91c1c;
}

.priority-critical {
    background: #b91c1c;
    color: #fff;
}

/* Role Badges */
.role {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
}

.role-admin {
    background: #fef2f2;
    color: #b91c1c;
}

.role-user {
    background: #f1f5f9;
    color: #64748b;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: #f1f5f9;
    color: var(--text);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-select {
    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: 16px;
    padding-right: 36px;
}

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

/* Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.col {
    padding: 0 12px;
    flex: 1;
}

.col-6 { width: 50%; flex: none; padding: 0 12px; }
.col-4 { width: 33.333%; flex: none; padding: 0 12px; }
.col-3 { width: 25%; flex: none; padding: 0 12px; }
.col-8 { width: 66.666%; flex: none; padding: 0 12px; }

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #d1fae5;
    color: #047857;
}

.alert-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.alert-warning {
    background: #fef3c7;
    color: #b45309;
}

.alert-info {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Bug Item */
.bug-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.bug-item:hover {
    background: #f8fafc;
}

.bug-item:last-child {
    border-bottom: none;
}

.bug-id {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 50px;
}

.bug-content {
    flex: 1;
    min-width: 0;
}

.bug-title {
    font-weight: 500;
    color: var(--dark);
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.bug-title:hover {
    color: var(--primary);
}

.bug-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.bug-actions {
    display: flex;
    gap: 6px;
}

/* Activity Item */
.activity-item {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-muted);
}

.activity-content {
    flex: 1;
    font-size: 13px;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.2);
}

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

.login-logo i {
    font-size: 48px;
    color: var(--primary);
}

.login-logo h1 {
    font-size: 24px;
    margin-top: 12px;
    color: var(--dark);
}

.login-logo p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 56px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-bar .form-control,
.filter-bar .form-select {
    width: auto;
    min-width: 150px;
}

/* Details Section */
.detail-section {
    margin-bottom: 24px;
}

.detail-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.detail-value {
    background: #f8fafc;
    padding: 14px;
    border-radius: 8px;
    font-size: 14px;
    white-space: pre-wrap;
}

/* Attachments */
.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    color: var(--text);
}

.attachment-item:hover {
    background: #e2e8f0;
}

/* History Timeline */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary);
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.timeline-user {
    font-weight: 500;
    font-size: 14px;
}

.timeline-time {
    font-size: 12px;
    color: var(--text-muted);
}

.timeline-body {
    font-size: 13px;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 992px) {
    .navbar-nav {
        display: none;
    }

    .col-6, .col-4, .col-3, .col-8 {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .navbar-container {
        padding: 0 16px;
    }

    .container {
        padding: 0 16px;
    }

    .main-content {
        padding: 20px 0;
    }
}

/* Utilities */
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-sm { font-size: 13px !important; }
.text-xs { font-size: 12px !important; }
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 16px !important; }
.p-0 { padding: 0 !important; }
.d-flex { display: flex !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.align-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.flex-1 { flex: 1 !important; }
