/* DIGILAP - Main Stylesheet */
:root {
    --header-bg-start: #1e1b4b;
    --header-bg-end:   #312e81;
    --nav-bg:          #c0392b;
    --nav-hover:       #a93226;
    --nav-active:      #922b21;
    --primary-red:     #c0392b;
    --primary-dark:    #1e1b4b;
    --sidebar-border:  #e5e7eb;
    --text-muted:      #6b7280;
    --footer-bg:       #1e1b4b;
    --badge-high-bg:   #e74c3c;
    --badge-normal-bg: #27ae60;
    --badge-low-bg:    #3498db;
    --badge-new-bg:    #27ae60;
    --badge-prog-bg:   #f39c12;
    --badge-wait-bg:   #e67e22;
    --badge-closed-bg: #7f8c8d;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
    color: #333;
    font-size: 14px;
}

/* HEADER */
.site-header {
    background: linear-gradient(135deg, var(--header-bg-start) 0%, var(--header-bg-end) 100%);
    padding: 12px 0;
    color: white;
}
.hdr-gears {
    position: absolute;
    top: 0; right: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}

.hdr-gear {
    position: absolute;
    color: rgba(255,255,255,0.06);
    line-height: 1;
}

.hdr-gear-1 {
    font-size: 160px;
    top: -40px;
    right: 60px;
    animation: gearSpin 18s linear infinite;
}

.hdr-gear-2 {
    font-size: 90px;
    top: 5px;
    right: 205px;
    animation: gearSpin 12s linear infinite reverse;
    color: rgba(255,255,255,0.04);
}

.hdr-gear-3 {
    font-size: 60px;
    bottom: -8px;
    right: 40px;
    animation: gearSpin 8s linear infinite;
    color: rgba(255,255,255,0.04);
}

@keyframes gearSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Grid square pattern */
.hdr-grid {
    position: absolute;
    top: 0; right: 0;
    width: 55%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    /* Gradient mask: σκοτεινό αριστερά, φωτεινό δεξιά */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.6) 30%, rgba(0,0,0,1) 100%);
    mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.6) 30%, rgba(0,0,0,1) 100%);
    background-image:
        linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 36px 36px;
}
.site-title-link, .site-title-link:hover, .site-title-link:visited, .site-title-link:active, .site-title-link:focus { text-decoration: none !important; color: #fff !important; }
.site-title { font-size: 22px; font-weight: 700; letter-spacing: 1px; color: #fff; }
.site-subtitle { font-size: 12px; opacity: 0.85; margin-top: 1px; color: #fff; }
.site-company { font-size: 11px; font-weight: 600; opacity: 0.7; margin-top: 3px; letter-spacing: 1px; }

/* NAVBAR */
.main-nav {
    background: var(--nav-bg);
    padding: 6px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    background: rgba(255,255,255,0.95);
    color: #c0392b;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}
.nav-btn:hover { background: #fff; color: #a93226; }
.nav-btn.active { background: #fff; color: #c0392b; }
.nav-btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    background: var(--primary-dark);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.nav-btn-logout:hover { background: #0f0e2b; color: white; }

/* BREADCRUMB */
.breadcrumb-nav {
    padding: 6px 0 8px;
    font-size: 13px;
    color: var(--text-muted);
}
.breadcrumb-nav a { color: var(--primary-red); text-decoration: none; }
.breadcrumb-nav a:hover { text-decoration: underline; }
.breadcrumb-nav span { color: #999; margin: 0 4px; }

/* SIDEBAR */
.sidebar {
    width: 220px;
    min-width: 220px;
    background: white;
    border: 1px solid var(--sidebar-border);
    border-radius: 6px;
    padding: 12px 0;
    height: fit-content;
    position: sticky;
    top: 60px;
}
.sidebar-title {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 16px 10px;
    color: #333;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 4px;
}
.sidebar-menu { list-style: none; padding: 0; margin: 0; }
.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    color: #444;
    text-decoration: none;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}
.sidebar-menu li a:hover { background: #fef2f2; color: var(--primary-red); }
.sidebar-menu li a.active { background: #fef2f2; color: var(--primary-red); font-weight: 600; }

/* MAIN CONTENT */
.main-content { min-width: 0; }

/* CARDS */
.card-white {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 16px;
}
.card-white h5 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }

/* STAT DONUTS */
.stat-cards { display: flex; gap: 12px; margin-bottom: 16px; }
.stat-card {
    flex: 1;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.stat-card:hover { border-color: #d1d5db; box-shadow: 0 2px 8px rgba(0,0,0,0.08); transform:translateY(-2px); transition:all 0.15s; }
.stat-card.active { border: 2px solid #93c5fd; background:#f0f7ff; }
.stat-card canvas { max-width: 80px; max-height: 80px; }
.stat-label { font-size: 13px; font-weight: 600; margin-top: 8px; }
.stat-label.green { color: #27ae60; }
.stat-label.red   { color: #e74c3c; }
.stat-label.orange{ color: #f39c12; }
.stat-label.blue  { color: #3498db; }

/* TABLE STYLES */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #555;
    border-bottom: 2px solid #e5e7eb;
}
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    vertical-align: middle;
}
.data-table tr:hover td { background: #fafafa; }
.data-table td a { color: var(--primary-red); text-decoration: none; font-weight: 600; }
.data-table td a:hover { text-decoration: underline; }

/* TICKET ROWS */
.ticket-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f3f4f6;
}
.ticket-row:last-child { border-bottom: none; }
.ticket-icon {
    width: 36px;
    height: 36px;
    background: #fee2e2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-red);
    font-size: 16px;
    flex-shrink: 0;
}
.ticket-info { flex: 1; min-width: 0; }
.ticket-store { font-size: 11px; font-weight: 700; color: #555; }
.ticket-subject { color: var(--primary-red); font-weight: 600; font-size: 13px; text-decoration: none; }
.ticket-subject:hover { text-decoration: underline; }
.ticket-dept { font-size: 12px; color: #888; }
.ticket-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ticket-id-info { font-size: 11px; color: #888; text-align: right; }

/* BADGES */
.badge-status, .badge-priority {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}
.badge-new       { background: var(--badge-new-bg); }
.badge-inprogress{ background: var(--badge-prog-bg); }
.badge-waiting   { background: var(--badge-wait-bg); color: white; border: 1px solid #e67e22; color: #e67e22; background: #fef9e7; }
.badge-closed    { background: transparent; border: 1px solid #7f8c8d; color: #7f8c8d; }
.badge-high      { background: var(--badge-high-bg); }
.badge-normal    { background: var(--badge-normal-bg); }
.badge-low       { background: var(--badge-low-bg); }

/* OVERDUE indicator */
.overdue-icon { color: #e74c3c; margin-right: 4px; }

/* SECTION HEADERS */
.section-header {
    background: #222;
    color: white;
    padding: 10px 16px;
    border-radius: 4px 4px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 0;
}
.section-header .btn-outline-light { font-size: 12px; padding: 3px 10px; }

/* FORMS */
.form-label { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.form-label .text-danger { font-size: 14px; }
.form-control, .form-select {
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 7px 10px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 2px rgba(192,57,43,0.1);
    outline: none;
}
.btn-primary-red {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary-red:hover { background: var(--nav-active); color: white; }
.btn-dark-submit {
    background: #222;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.btn-dark-submit:hover { background: #111; color: white; }

/* TICKET DETAIL SIDEBAR */
.ticket-detail-sidebar {
    width: 260px;
    min-width: 260px;
}
.sidebar-info-box {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}
.sidebar-info-box .box-header {
    background: #17a2b8;
    color: white;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}
.sidebar-info-box .box-body {
    padding: 12px 14px;
    font-size: 12px;
}
.sidebar-info-box .box-body table { width: 100%; }
.sidebar-info-box .box-body table td { padding: 4px 0; vertical-align: top; }
.sidebar-info-box .box-body table td:first-child { color: #888; width: 45%; }
.sidebar-info-box .box-body table td:last-child { font-weight: 600; }
.priority-box .box-header { background: var(--primary-red); }

/* REPLY BOXES */
.reply-box {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 12px;
}
.reply-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.reply-avatar {
    width: 36px; height: 36px;
    background: var(--primary-red);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 16px;
}
.reply-user-name { font-weight: 700; font-size: 13px; color: var(--primary-red); }
.reply-date { font-size: 11px; color: #888; }
.reply-message { font-size: 13px; line-height: 1.6; }
.attachment-list { margin-top: 10px; }
.attachment-item { display: inline-flex; align-items: center; gap: 4px; background: #f3f4f6; padding: 4px 10px; border-radius: 4px; margin: 3px; font-size: 12px; }
.attachment-item a { color: #333; text-decoration: none; }
.attachment-item a:hover { color: var(--primary-red); }

/* REPLY EDITOR SECTION */
.reply-editor-section {
    background: #2d2d2d;
    color: white;
    padding: 8px 14px;
    border-radius: 4px 4px 0 0;
    font-size: 13px;
    font-weight: 600;
}

/* LOGIN PAGE */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--header-bg-start) 0%, var(--header-bg-end) 100%);
}
.login-card {
    background: white;
    border-radius: 10px;
    padding: 40px;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo .logo-title { font-size: 32px; font-weight: 800; color: var(--primary-dark); letter-spacing: 2px; }
.login-logo .logo-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.login-card .btn-primary-red { width: 100%; padding: 10px; font-size: 15px; }

/* ADMIN DASHBOARD CHARTS */
.chart-section { background: white; border: 1px solid #e5e7eb; border-radius: 6px; padding: 20px; }
.chart-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; color: #333; }

/* PAGINATION */
.pagination-info { font-size: 12px; color: #888; }
.page-link { font-size: 13px; color: var(--primary-red); }
.page-item.active .page-link { background: var(--primary-red); border-color: var(--primary-red); }

/* DASHBOARD MENU CARDS */
.menu-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    display: block;
}
.menu-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); transform: translateY(-2px); color: #333; }
.menu-card img, .menu-card .menu-icon { font-size: 48px; margin-bottom: 16px; display: block; margin-left: auto; margin-right: auto; }
.menu-card h6 { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.menu-card p { font-size: 12px; color: #888; margin-bottom: 16px; }
.menu-card .btn-dark-submit { width: 100%; }

/* FILTER BAR */
.filter-bar { background: white; border: 1px solid #e5e7eb; border-radius: 6px; padding: 14px; margin-bottom: 16px; }

/* STATUS check/x icons for tables */
.status-active { color: #27ae60; font-size: 16px; }
.status-inactive { color: #e74c3c; font-size: 16px; }

/* FOOTER */
.site-footer {
    background: linear-gradient(135deg, var(--header-bg-start) 0%, var(--header-bg-end) 100%);
    color: rgba(255,255,255,0.8);
    padding: 18px 0;
    margin-top: 30px;
    font-size: 12px;
    border-top: 3px solid #c0392b;
}
.footer-contact { font-size: 12px; }
.footer-gear {
    font-size: 28px;
    color: rgba(255,255,255,.12);
    animation: footerSpin 8s linear infinite;
    line-height: 1;
}
.footer-anim {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.06);
    animation: footerPulse 6s ease-in-out infinite;
    pointer-events: none;
}
.footer-anim-1 {
    width: 80px; height: 80px;
    right: 180px; top: -20px;
    animation-delay: 0s;
}
.footer-anim-2 {
    width: 50px; height: 50px;
    right: 140px; top: 5px;
    animation-delay: -3s;
    animation: footerSpin 12s linear infinite;
    border-color: rgba(192,57,43,.15);
}
@keyframes footerSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes footerPulse {
    0%, 100% { transform: scale(1);   opacity: .4; }
    50%       { transform: scale(1.2); opacity: .1; }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    /* Sidebar navigation - hidden on mobile, use hamburger */
    .sidebar { display: none; }

    /* Header */
    .site-header .container-fluid { flex-wrap: wrap; gap: 6px; }
    .site-title { font-size: 16px; }
    .site-subtitle { display: none; }
    .hdr-gears { display: none; }
    .hdr-grid { display: none; }

    /* Top nav bar */
    .nav-bar .container-fluid { flex-wrap: wrap; gap: 4px; }
    .nav-bar a, .nav-bar button { font-size: 11px; padding: 4px 8px; }

    /* Main content - no left sidebar */
    .container-fluid.px-4.py-3 { padding: 8px !important; }

    /* Stat cards */
    .stat-cards { flex-wrap: wrap; }
    .stat-card { min-width: 45%; }

    /* Ticket detail - stack columns */
    .d-flex.gap-3 { flex-direction: column; }
    .ticket-detail-sidebar { width: 100% !important; }

    /* Equipment detail layout */
    .eqd-layout { flex-direction: column; }
    .eqd-sidebar { width: 100% !important; }

    /* Tables - horizontal scroll */
    .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Cards grid */
    .eq-rep-grid { grid-template-columns: 1fr !important; }

    /* Admin form rows */
    .row.g-2 .col-md-2,
    .row.g-2 .col-md-4 { width: 100%; }

    /* Ticket list */
    .ticket-row { flex-wrap: wrap; gap: 6px; }
    .ticket-id-info { text-align: left; }

    /* Maint tabs */
    .maint-tabs { flex-wrap: wrap; gap: 4px; }
    .maint-tab { font-size: 11px; padding: 5px 10px; }

    /* Forms */
    .d-flex.gap-2.flex-wrap > * { width: 100%; }
    .d-flex.align-items-end.gap-3.flex-wrap > * { width: 100%; }

    /* Modals full width */
    .modal-dialog { margin: 8px; }
    .modal-dialog.modal-lg { max-width: calc(100vw - 16px); }
}

@media (max-width: 480px) {
    .stat-card { min-width: 100%; }
    .nav-bar a span { display: none; } /* hide text, keep icon */
}

/* ALERTS */
.alert-success { background: #d4edda; border-color: #c3e6cb; color: #155724; }
.alert-danger  { background: #f8d7da; border-color: #f5c6cb; color: #721c24; }

/* File upload area */
.file-upload-area { border: 1px solid #d1d5db; border-radius: 4px; padding: 8px; background: white; }
.file-upload-area input[type=file] { font-size: 13px; }
.file-upload-hint { font-size: 11px; color: #888; margin-top: 4px; }
.add-more-files { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 14px; background: var(--primary-red); color: white; border: none; border-radius: 4px; font-size: 12px; cursor: pointer; }

/* Contractor category list */
.contractor-dept-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}
.contractor-dept-item a { font-weight: 700; color: var(--primary-red); text-decoration: none; font-size: 13px; }
.contractor-dept-item a:hover { text-decoration: underline; }
.contact-count-badge { background: #374151; color: white; padding: 3px 10px; border-radius: 4px; font-size: 12px; }

/* Reports table */
.report-row { padding: 12px 0; border-bottom: 1px solid #f3f4f6; }
.report-dept-name { font-size: 14px; font-weight: 600; }
.report-dept-total { font-size: 12px; color: #888; }
.report-stats { display: flex; gap: 8px; margin-top: 6px; }
.report-stat-box { background: #f9fafb; border-radius: 4px; padding: 6px 12px; text-align: center; min-width: 80px; }
.report-stat-box .num { font-size: 18px; font-weight: 700; }
.report-stat-box .lbl { font-size: 10px; color: #888; }
.report-stat-box.new-box .num { color: #27ae60; }
.report-stat-box.wait-box .num { color: #f39c12; }
.report-stat-box.prog-box .num { color: #e67e22; }
.report-stat-box.over-box .num { color: #e74c3c; }
.report-stat-box.clos-box .num { color: #7f8c8d; }

/* ══════════════════════════════════════
   PRINT STYLES — Ticket Detail
══════════════════════════════════════ */
/* Κρύβουμε το print-header στην οθόνη */
.print-header { display: none; }

@media print {
    /* Κρύβουμε όλα */
    .sidebar, .main-nav, .site-header, .nav-bar, .breadcrumb-nav,
    .btn, .btn-primary-red, .btn-dark-submit,
    .reply-editor-section, .file-upload-area, .modal, .add-more-files,
    .d-flex, .card-white, .reply-box, .ticket-detail-sidebar,
    button, [data-bs-toggle], .breadcrumb-nav,
    .flash-message { display: none !important; }

    /* Δείχνουμε μόνο το print div */
    .print-header { display: block !important; }

    body { background: #fff !important; font-family: Arial, sans-serif; font-size: 11pt; color: #000; margin: 0; padding: 16px; }
    a { color: #000 !important; text-decoration: none !important; }

    @page { margin: 1.5cm; size: A4; }
}