@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #714B67; /* Odoo's classic purple hue */
    --primary-hover: #5a3c52;
    --bg-main: #f9f9f9;
    --card-bg: #ffffff;
    --text-main: #212529;
    --text-muted: #6c757d;
    --border: #dee2e6;
    
    /* Stages */
    --stage-new: #17a2b8;
    --stage-progress: #ffc107;
    --stage-solved: #28a745;
    --stage-cancelled: #dc3545;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: white;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: #00A09D; /* Odoo Teal */
    color: white;
}

.btn-primary:hover {
    background: #008784;
}

.btn-outline {
    background: transparent;
    color: white;
    border: 1px solid white;
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
}

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    flex-grow: 1;
}

/* Dashboard Layout */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.view-switcher a {
    padding: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
}
.view-switcher a.active {
    color: var(--primary);
    font-weight: bold;
}

/* Kanban / Ticket Board */
.board {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    align-items: flex-start;
}

.column {
    min-width: 320px;
    width: 320px;
    background: #f1f3f4;
    border-radius: 4px;
    padding: 0.5rem;
}

.column-header {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    color: #495057;
}

/* Ticket Card */
.ticket-card {
    background: white;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.ticket-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.ticket-title {
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #111827;
}

.ticket-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.tag {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    color: white;
    font-weight: 500;
}

.ticket-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Stars for Priority */
.stars {
    color: #d1d5db;
    font-size: 1rem;
}
.stars .filled {
    color: #fbbf24;
}

/* Avatar */
.avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Table View */
.table-view {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.table-view th {
    background: #f8f9fa;
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.table-view td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    vertical-align: middle;
}

.table-view tbody tr:hover {
    background: #f9fafb;
    cursor: pointer;
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
}

/* View Ticket / Form View */
.form-view-header {
    background: white;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    display: flex;
    justify-content: space-between;
}

.form-view-body {
    background: white;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 4px 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.statusbar {
    display: flex;
    gap: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.statusbar-item {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #f8f9fa;
    border-right: 1px solid var(--border);
    position: relative;
}

.statusbar-item.active {
    background: white;
    color: var(--primary);
}

/* Chatter */
.chatter {
    margin-top: 2rem;
    max-width: 800px;
}

.message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #495057;
}

.message-body {
    flex: 1;
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1rem;
}

.message.internal .message-body {
    background: #fff8e1; /* Odoo note yellow */
    border-color: #ffe082;
}

.msg-header {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    margin-bottom: 0.5rem;
}
.msg-author { font-weight: 600; font-size: 0.9rem; }
.msg-time { color: var(--text-muted); font-size: 0.8rem; }
