:root {
    --primary-color: #f88e37;
    /* HEK-IT Orange */
    --secondary-color: #f4f4f4;
    --text-color: #333;
    --accent-color: #0056b3;
    --white: #ffffff;
    --danger: #dc3545;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--secondary-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.5;
}

header {
    background-color: var(--white);
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .logo img {
    height: 40px;
    width: auto;
}

header nav {
    display: flex;
    align-items: center;
}

.user-greeting {
    margin-right: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

header nav a {
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 1rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

header nav a:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

main {
    flex: 1;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.container {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

h2, h3 {
    color: var(--primary-color);
    margin-top: 0;
}

h2 {
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid #e2e8f0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #edf2f7;
}

th {
    background-color: #f8fafc;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: #f8fafc;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    filter: brightness(110%);
    box-shadow: 0 4px 6px -1px rgba(248, 142, 55, 0.4);
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background-color: #cbd5e1;
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    filter: brightness(110%);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #4a5568;
}

input[type="text"],
input[type="url"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--border-radius);
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
    background-color: #fcfcfc;
    font-family: inherit;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(248, 142, 55, 0.1);
}

.note-item {
    position: relative;
    padding-right: 50px;
}

.note-content {
    white-space: pre-wrap;
    word-break: break-word;
}

.note-meta {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 10px;
}

.note-delete-form {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.btn-delete {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.btn-delete:hover {
    transform: scale(1.2);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.welcome-container {
    text-align: center;
    margin-top: 3rem;
    padding: 4rem 2rem;
}

.welcome-actions {
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .welcome-container {
        margin-top: 1rem;
        padding: 2rem 1rem;
    }
}

.card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-success { background-color: #def7ec; color: #03543f; }
.badge-warning { background-color: #fdf6b2; color: #723b13; }
.badge-info { background-color: #e1effe; color: #1e429f; }

footer {
    text-align: center;
    padding: 2rem 1.5rem;
    background-color: #f8fafc;
    color: #64748b;
    font-size: 0.875rem;
    border-top: 1px solid #e2e8f0;
}

/* Media Queries */
@media (max-width: 768px) {
    header {
        padding: 0.75rem 1rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    header nav {
        position: fixed;
        top: 64px; /* Header height */
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--white);
        flex-direction: column;
        padding: 2rem;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 999;
        align-items: stretch;
    }

    header nav.active {
        transform: translateX(0);
    }

    .user-greeting {
        margin: 0 0 2rem 0;
        text-align: center;
        padding-bottom: 1rem;
        border-bottom: 1px solid #eee;
    }

    header nav a {
        margin: 0.5rem 0;
        text-align: center;
        font-size: 1.1rem;
    }

    main {
        padding: 1rem;
    }

    .container {
        padding: 1.25rem;
    }

    /* Stack flex elements in forms */
    .admin-form-row {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .admin-form-row > div {
        flex: none !important;
        width: 100% !important;
    }

    /* Table adjustments */
    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .btn {
        padding: 0.5rem 0.75rem;
    }

    /* Kanban Optimization for Mobile */
    .kanban-board {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .kanban-column {
        width: 100% !important;
        max-height: none !important;
    }

    .kanban-cards {
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    h2 { font-size: 1.5rem; }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        justify-content: center;
    }

    /* Make tables stack or scroll better */
    .table-responsive {
        border: none;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: #fff;
    }

    td {
        border: none;
        border-bottom: 1px solid #f1f5f9;
        position: relative;
        padding-left: 50% !important;
        text-align: right !important;
    }

    td::before {
        position: absolute;
        top: 0.75rem;
        left: 0.75rem;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        content: attr(data-label);
        font-weight: 700;
        text-align: left;
        color: #64748b;
        font-size: 0.75rem;
        text-transform: uppercase;
    }

    td:last-child {
        border-bottom: none;
    }
}

/* --- Bug Tracking Additions --- */

.bug-label {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    display: inline-block;
}

.kanban-card {
    cursor: pointer;
}

.markdown-content {
    line-height: 1.6;
}

.markdown-content h1, .markdown-content h2, .markdown-content h3 {
    color: #1e293b;
    border-bottom: none;
    padding-bottom: 0;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content ul, .markdown-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.markdown-content code {
    background: #f1f5f9;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.attachment-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #334155;
    transition: all 0.2s;
}

.attachment-item:hover {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.attachment-icon {
    font-size: 1.5rem;
}

.attachment-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.attachment-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    font-size: 0.75rem;
    color: #64748b;
}
