/* ============================================
   TechMaci HelpDesk — Design System
   Brand Palette: Cyan Blue + Charcoal Grey
   Matching techmaci.com identity
   ============================================ */

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

:root {
    /* TechMaci Brand Colors */
    --tm-cyan:      #29ABE2;   /* primary cyan from logo */
    --tm-cyan-dark: #1A8FBD;   /* hover state */
    --tm-cyan-pale: #E8F6FD;   /* very light cyan tint */
    --tm-grey-900:  #3D3D3D;   /* deep charcoal */
    --tm-grey-700:  #58595B;   /* main grey from logo */
    --tm-grey-500:  #808285;   /* mid grey */
    --tm-grey-300:  #C8CACB;   /* light grey */
    --tm-grey-100:  #F4F5F6;   /* near-white bg */

    /* Semantic tokens */
    --primary:      var(--tm-cyan);
    --primary-dark: var(--tm-cyan-dark);
    --sidebar-bg:   var(--tm-grey-900);
    --bg:           #F0F4F7;
    --surface:      #FFFFFF;
    --border:       #E2E6EA;
    --text-900:     var(--tm-grey-900);
    --text-600:     var(--tm-grey-700);
    --text-400:     var(--tm-grey-500);

    /* Status colors */
    --coral-500: #F76B4A;
    --amber-500: #E8A93B;
    --green-500: #22A06B;

    --radius:  10px;
    --shadow:  0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}

a { color: var(--tm-cyan); text-decoration: none; }
a:hover { color: var(--tm-cyan-dark); text-decoration: underline; }

/* ---------- Auth screens (split layout) ---------- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
@media (max-width: 860px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
}

/* Left brand panel — dark navy like techmaci.com */
.auth-brand {
    background: #0D1321;
    color: #fff;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;          /* horizontal center */
    justify-content: space-between;
    text-align: center;           /* text center */
    position: relative;
    overflow: hidden;
}

/* Particle/network dot effect like techmaci.com hero */
.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(41,171,226,0.18) 1px, transparent 1px),
        radial-gradient(circle, rgba(41,171,226,0.10) 1px, transparent 1px);
    background-size: 60px 60px, 30px 30px;
    background-position: 0 0, 15px 15px;
    pointer-events: none;
}

/* Cyan glow center */
.auth-brand::after {
    content: "";
    position: absolute;
    width: 700px; height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(1,172,240,0.12), transparent 60%);
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Logo — center, large, with strong cyan glow */
.auth-brand .logo-img {
    height: 64px;
    width: auto;
    position: relative;
    z-index: 1;
    filter: brightness(1.2) drop-shadow(0 0 14px rgba(1,172,240,0.60));
}

.auth-brand .headline {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    line-height: 1.3;
    font-weight: 700;
    max-width: 360px;
    position: relative;
    z-index: 1;
}
.auth-brand .headline .hl {
    color: var(--tm-cyan);
}
.auth-brand .sub {
    color: #A0AEBB;
    margin-top: 14px;
    max-width: 340px;
    font-size: 15px;
    position: relative;
    z-index: 1;
}
.auth-brand .foot {
    color: #606A75;
    font-size: 13px;
    position: relative;
    z-index: 1;
}

/* Right form column */
.auth-form-col {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--surface);
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; color: var(--text-900); }
.auth-card p.lead { color: var(--text-600); margin-bottom: 28px; font-size: 15px; }

/* Auth top logo (shown on mobile when brand panel is hidden) */
.auth-top-logo {
    display: none;
    margin-bottom: 28px;
}
.auth-top-logo img { height: 36px; width: auto; }
@media (max-width: 860px) {
    .auth-top-logo { display: block; }
}

/* ---------- Form elements ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-900); margin: 16px 0 6px; }
label:first-of-type { margin-top: 0; }

input[type=text], input[type=email], input[type=password], textarea, select {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14.5px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-900);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--tm-cyan);
    box-shadow: 0 0 0 3px rgba(41,171,226,0.15);
}
textarea { resize: vertical; min-height: 110px; }

/* ---------- Buttons ---------- */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--tm-grey-700);
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    transition: background .15s, transform .1s;
}
button:hover, .btn:hover { background: var(--tm-grey-900); text-decoration: none; }
button:active, .btn:active { transform: scale(0.98); }
button.full, .btn.full { width: 100%; margin-top: 22px; }

/* Primary = cyan */
.btn-accent { background: var(--tm-cyan); }
.btn-accent:hover { background: var(--tm-cyan-dark); }

.btn-outline { background: transparent; color: var(--text-900); border: 1.5px solid var(--border); }
.btn-outline:hover { background: var(--tm-grey-100); }
.btn-sm { padding: 7px 14px; font-size: 13.5px; }

/* ---------- Alerts ---------- */
.field-error { color: var(--coral-500); font-size: 13px; margin-top: 6px; }
.msg-success {
    background: #E7F6F0; color: #147A57; border: 1px solid #BFE8D6;
    padding: 12px 14px; border-radius: 8px; margin-bottom: 18px; font-size: 14px;
}
.msg-error {
    background: #FDECE8; color: #C4401F; border: 1px solid #F8CDBF;
    padding: 12px 14px; border-radius: 8px; margin-bottom: 18px; font-size: 14px;
}

/* ---------- App shell (dashboard layout) ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    width: 240px;
    min-width: 240px;
    background: #0D1321;
    color: #C7D2DC;
    padding: 0;
    display: flex !important;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

/* Sidebar logo area */
.sidebar-logo-wrap {
    padding: 20px 18px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    margin-bottom: 12px;
    background: rgba(0,0,0,0.25);
}

/* Logo image — bigger, original colors with soft cyan glow */
.sidebar-logo-wrap img {
    height: 42px;
    width: auto;
    display: block;
    filter: brightness(1.1) drop-shadow(0 0 6px rgba(1,172,240,0.35));
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 12px;
    flex: 1;
}
.sidebar nav a, .sidebar nav .nav-item {
    color: #A0B0BE;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.07); text-decoration: none; color: #fff; }
.sidebar nav a.active {
    background: var(--tm-cyan);
    color: #fff;
    font-weight: 600;
}

/* Cyan accent line on active */
.sidebar nav a.active::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff;
}

.sidebar .user-box {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 16px 20px;
    margin-top: 12px;
}
.sidebar .user-box .name { color: #fff; font-size: 14px; font-weight: 600; }
.sidebar .user-box .role {
    color: var(--tm-cyan);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 10px;
}

.main {
    flex: 1;
    padding: 36px 44px;
    min-width: 0;
    overflow-x: hidden;
}
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--text-600); font-size: 14.5px; margin-top: 4px; }

/* ---------- Stat cards ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--tm-cyan);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}
.stat-card .num {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--tm-cyan);
}
.stat-card .label { color: var(--text-600); font-size: 13px; margin-top: 4px; }

/* ---------- Ticket cards ---------- */
.ticket-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--text-400);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    transition: box-shadow .15s;
}
.ticket-card:hover { box-shadow: 0 4px 20px rgba(41,171,226,0.12); }
.ticket-card.status-open { border-left-color: var(--coral-500); }
.ticket-card.status-in-progress { border-left-color: var(--amber-500); }
.ticket-card.status-resolved { border-left-color: var(--green-500); }

.ticket-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ticket-top h3 { font-size: 16px; font-weight: 600; font-family: 'Inter', sans-serif; }
.ticket-meta { color: var(--text-600); font-size: 13px; margin-top: 4px; }
.ticket-body { margin-top: 12px; color: var(--text-900); font-size: 14.5px; white-space: pre-wrap; }
.ticket-reply {
    margin-top: 14px;
    background: var(--tm-cyan-pale);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    border-left: 3px solid var(--tm-cyan);
}
.ticket-reply .who {
    font-weight: 700;
    font-size: 12px;
    color: var(--tm-cyan-dark);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 4px;
}
.ticket-actions { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .03em;
}
.badge-open            { background: #FDECE8; color: #C4401F; }
.badge-in-progress     { background: #FCF3DF; color: #966212; }
.badge-resolved        { background: #E7F6F0; color: #147A57; }
.badge-priority-low    { background: #EEF1F5; color: var(--text-600); }
.badge-priority-normal { background: var(--tm-cyan-pale); color: var(--tm-cyan-dark); }
.badge-priority-high   { background: #FCEADC; color: #B15C0E; }
.badge-priority-urgent { background: #FDE6E6; color: #C22929; }

/* ---------- Tables ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
th, td { padding: 12px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border); }
th {
    background: var(--tm-grey-100);
    color: var(--text-600);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(41,171,226,0.03); }

/* ---------- Filter bar ---------- */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: var(--radius);
}
.filter-bar input, .filter-bar select { width: auto; min-width: 180px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-600); }
.empty-state h3 { color: var(--text-900); margin-bottom: 6px; font-family:'Inter',sans-serif; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
}

/* ---------- Landing page ---------- */
.landing { min-height: 100vh; display: flex; flex-direction: column; background: #fff; }

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 48px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}
.landing-nav .logo-img { height: 42px; width: auto; }
.landing-nav .links a {
    margin-left: 22px;
    color: var(--text-900);
    font-weight: 600;
    font-size: 14.5px;
}
.landing-nav .links a:hover { color: var(--tm-cyan); text-decoration: none; }

/* Hero */
.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px 80px;
    background: linear-gradient(180deg, #ffffff 0%, var(--tm-cyan-pale) 100%);
}
.hero h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 48px;
    max-width: 680px;
    line-height: 1.18;
    margin: 0 auto 18px;
    color: var(--tm-grey-900);
    white-space: nowrap;
}
@media (max-width: 700px) {
    .hero h1 { font-size: 30px; white-space: normal; }
}
.hero p { color: var(--text-600); font-size: 17px; max-width: 480px; margin: 0 auto 32px; }
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .accent { color: var(--tm-cyan); }

/* Hero decorative line under accent */
.hero .accent-underline {
    display: inline;
    background: linear-gradient(90deg, var(--tm-cyan), var(--tm-cyan-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .app-shell { flex-direction: column; }
    .sidebar {
        width: 100%;
        min-width: unset;
        height: auto;
        position: relative;
        flex-direction: column;
    }
    .sidebar-logo-wrap { padding: 14px 18px; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; padding: 8px; }
    .sidebar .user-box { display: none; }
    .main { padding: 20px 16px; }
}
