/* ----------------------------------------------------------
   RESET + BASE
---------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: #f5f6f8;
    color: #222;
}

body {
    line-height: 1.5;
}

/* Utility spacing */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.py-2 { padding: 1rem 0; }
.text-center { text-align: center; }

/* ----------------------------------------------------------
   CONTAINERS
---------------------------------------------------------- */
.container {
    width: min(1200px, 95%);
    margin: 0 auto;
}

.container--page {
    padding-top: 2rem;
}

/* ----------------------------------------------------------
   HEADINGS
---------------------------------------------------------- */
.heading {
    font-weight: 600;
    color: #222;
}

.heading--center {
    text-align: center;
}

/* ----------------------------------------------------------
   NAVIGATION BAR
---------------------------------------------------------- */
.nav {
    background: #1e293b;
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* Left section (hamburger) */
.nav__left {
    display: flex;
    align-items: center;
}

/* Hamburger toggle (hidden until JS shows it) */
.nav__toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
}

/* Full menu (desktop) */
.nav__menu {
    list-style: none;
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* Menu items */
.nav__item {}

/* Links */
.nav__link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav__link:hover {
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

.nav__link--active {
    background: rgba(255, 255, 255, 0.25);
}

/* User dropdown */
.nav__user {
    position: relative;
}

.nav__user-trigger {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
}

.nav__user-dropdown {
    position: absolute;
    right: 0;
    top: 2.2rem;
    background: #fff;
    color: #222;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    min-width: 160px;
    overflow: hidden;
}

.nav__user-dropdown--open {
    display: block;
}

.nav__user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #222;
}

.nav__user-dropdown a:hover {
    background: #f0f0f0;
}

/* When collapsed, keep the top bar as a fixed row */
.nav--collapsed {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Mobile/tablet dropdown menu */
.nav__menu--open {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    display: flex !important;
    flex-direction: column;
    background: #1e293b;
    padding: 1rem;
    border-radius: 0 0 6px 6px;
    z-index: 999;
}

/* ----------------------------------------------------------
   ALERTS
---------------------------------------------------------- */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert--success {
    background: #d1fae5;
    color: #065f46;
}

.alert--error {
    background: #fee2e2;
    color: #991b1b;
}

.alert--warning {
    background: #fef3c7;
    color: #92400e;
}

.manage-alerts {
    position: fixed;
    top: 70px;       /* height of navbar */
    left: 0;
    right: 0;
    z-index: 2000;
    padding: 0 1rem;
}

/* ----------------------------------------------------------
   TABLES
---------------------------------------------------------- */
.table-wrapper {
    overflow-x: auto;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table thead {
    background: #e2e8f0;
}

.table th,
.table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.table tbody tr:hover {
    background: #f9fafb;
}

.table tbody tr:hover td a {
    cursor: pointer;
}

/* ----------------------------------------------------------
   BADGES (STATUS LABELS)
---------------------------------------------------------- */
.badge {
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.badge--good {
    background: #d1fae5;
    color: #065f46;
}

.badge--today {
    background: #fef3c7;
    color: #92400e;
}

.badge--overdue {
    background: #fee2e2;
    color: #991b1b;
}

.badge--extreme {
    background: #b91c1c;
    color: #fff;
}

.badge--none {
    background: #e5e7eb;
    color: #374151;
}

/* ----------------------------------------------------------
   TASK TYPE TAGS (subtle, non-intrusive)
---------------------------------------------------------- */
.task-tag {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.3);
    margin-left: 0.4rem;
    opacity: 0.8;
}

/* Colour variants */
.task-tag--ppm {
    border-color: #6b7280;
    color: #6b7280;
    background: rgba(107,114,128,0.08);
}

.task-tag--oot {
    border-color: #2563eb;
    color: #2563eb;
    background: rgba(37,99,235,0.08);
}

.task-tag--fu {
    border-color: #059669;
    color: #059669;
    background: rgba(5,150,105,0.08);
}


/* ----------------------------------------------------------
   FORMS (for future pages)
---------------------------------------------------------- */
input, select, textarea {
    padding: 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    width: 100%;
}

button {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

/* ----------------------------------------------------------
   CARDS (for future pages)
---------------------------------------------------------- */
.card {
    background: #fff;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* ----------------------------------------------------------
   BUTTONS — Unified CMS Button System
---------------------------------------------------------- */

/* Base button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    border: none;
    line-height: 1.2;
}

/* Sizes */
.btn-small {
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
}

.btn-large {
    padding: 0.75rem 1.25rem;
    font-size: 1.05rem;
}

/* Full width */
.btn-full {
    width: 100%;
}

/* ----------------------------------------------------------
   COLOUR VARIANTS
---------------------------------------------------------- */

/* Blue (primary action) */
.btn-blue {
    background: #2563eb;   /* blue-600 */
    color: #fff;
}
.btn-blue:hover {
    background: #1d4ed8;   /* blue-700 */
}

/* Red (danger/destructive) */
.btn-red {
    background: #dc2626;   /* red-600 */
    color: #fff;
}
.btn-red:hover {
    background: #b91c1c;   /* red-700 */
}

/* Green (success/confirm/create) */
.btn-green {
    background: #16a34a;   /* green-600 */
    color: #fff;
}
.btn-green:hover {
    background: #15803d;   /* green-700 */
}

/* Grey (neutral/secondary) */
.btn-grey {
    background: #e5e7eb;   /* gray-200 */
    color: #111827;        /* gray-900 */
}
.btn-grey:hover {
    background: #d1d5db;   /* gray-300 */
}

/* Orange (warning / attention / special action) */
.btn-orange {
    background: #ea580c;   /* orange-600 */
    color: #fff;
}
.btn-orange:hover {
    background: #c2410c;   /* orange-700 */
}

/* ----------------------------------------------------------
   OUTLINE VARIANTS
---------------------------------------------------------- */

.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
}

.btn-outline-blue {
    color: #2563eb;
    border-color: #2563eb;
}
.btn-outline-blue:hover {
    background: #2563eb;
    color: #fff;
}

.btn-outline-red {
    color: #dc2626;
    border-color: #dc2626;
}
.btn-outline-red:hover {
    background: #dc2626;
    color: #fff;
}

.btn-outline-grey {
    color: #374151;        /* gray-700 */
    border-color: #9ca3af; /* gray-400 */
}
.btn-outline-grey:hover {
    background: #f3f4f6;   /* gray-100 */
}
