/* ----------------------------------------------------
   ΒΑΣΙΚΗ ΓΡΑΜΜΑΤΟΣΕΙΡΑ & RESET
---------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
}

body {
    background: #f2f3f5;
    color: #111;
}

/* ----------------------------------------------------
   HEADER – ΜΕΝΟΥ ΣΤΑ ΑΡΙΣΤΕΡΑ (ΟΡΙΖΟΝΤΙΟ BAR)
---------------------------------------------------- */

.top-bar {
    background: #1f1f1f;
    padding: 14px 20px;
}

.left-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.main-menu {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

.main-menu a {
    text-decoration: none;
    color: #dddddd;
    font-size: 15px;
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
    transition: 0.2s ease;
}

.main-menu a:hover,
.main-menu a.active {
    color: #ffffff;
    border-bottom: 2px solid #3fa9f5;
}

/* Δεξιά ένδειξη χρήστη */
.user-info {
    margin-left: auto;
    color: #dddddd;
    font-size: 14px;
}
.user-info a {
    color: #3fa9f5;
    text-decoration: none;
}
.user-info a:hover {
    text-decoration: underline;
}

/* ----------------------------------------------------
   LAYOUT / ΚΕΝΤΡΑΡΙΣΜΑ
---------------------------------------------------- */

.page-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ----------------------------------------------------
   DASHBOARD CARDS (ΠΙΝΑΚΕΣ ΣΥΓΚΕΝΤΡΩΤΙΚΩΝ)
---------------------------------------------------- */

.cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 20px;
}

.card {
    flex: 1 1 calc(25% - 18px);
    min-width: 200px;
    padding: 16px 18px;
    border-radius: 14px;
    color: #fff;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.12);
}

.card h3 {
    font-size: 15px;
    margin-bottom: 10px;
    font-weight: 500;
}

.card .card-value {
    font-size: 26px;
    font-weight: 700;
}

/* Χρώματα */
.card-blue    { background: #007bff; }
.card-green   { background: #28a745; }
.card-orange  { background: #ff8500; }
.card-yellow  { background: #ffca28; color: #000; }
.card-purple  { background: #6f42c1; }
.card-teal    { background: #20c997; }
.card-dark    { background: #343a40; }

/* ----------------------------------------------------
   ΠΙΝΑΚΕΣ & WRAPPER (RESPONSIVE)
---------------------------------------------------- */

.table-wrapper {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.10);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px; /* ώστε σε κινητό να κάνει scroll */
}

thead tr {
    background: #e2e6ea;
    font-weight: 600;
}

th, td {
    padding: 10px 8px;
    font-size: 13px;
    border-bottom: 1px solid #dee2e6;
    text-align: left;
}

tbody tr:hover {
    background: #f8f9fa;
}

/* Τίτλος εργασίας με περιορισμένο πλάτος */
.tasks-table-title {
    max-width: 280px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.35;
}

/* Ένδειξη χρώματος κατάστασης */
.task-status-square {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

/* ----------------------------------------------------
   BADGES (ΑΝ ΧΡΕΙΑΣΤΕΙ)
---------------------------------------------------- */

.badge {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.badge-blue   { background: #cfe2ff; color: #084298; }
.badge-green  { background: #d1e7dd; color: #0f5132; }
.badge-yellow { background: #fff3cd; color: #664d03; }

/* ----------------------------------------------------
   BUTTONS – ΓΕΝΙΚΟ ΣΤΥΛ
---------------------------------------------------- */

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.15s ease;
    border: none;
}

.btn-primary   { 
    height: 40px;
    padding: 0 18px;
    border-radius: 8px;
    background: #28a745;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500; 
}
.btn-secondary { background: #e5e7eb; color: #000; }
.btn-warning   { background: #ff9f1c; color: #fff; }
.btn-danger    { background: #dc3545; color: #fff; }

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Κουμπιά εξαγωγών (Excel / PDF) */
.export-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 18px;
    text-decoration: none;
    border: none;
}

.export-btn.excel { background:#198754; color:#fff; }
.export-btn.pdf   { background:#dc3545; color:#fff; }

.export-btn:hover {
    opacity: 0.9;
}

/* Εικονίδια ενέργειας στη λίστα εργασιών */
.icon-btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:30px;
    height:30px;
    border-radius: 50%;
    font-size:16px;
    text-decoration:none;
    border:2px solid transparent;
}

.icon-btn.gray { border-color:#bbb; color:#555; }
.icon-btn.blue { border-color:#007bff; color:#007bff; }
.icon-btn.red  { border-color:#dc3545; color:#dc3545; }

.icon-btn:hover {
    background:#f1f1f1;
}

/* Νέα εργασία / νέος επαγγελματίας */
.new-task-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.new-task-btn {
    height: 40px;
    padding: 0 18px;
    border-radius: 8px;
    background: #28a745;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
}

/* ----------------------------------------------------
   FORMS – ΓΕΝΙΚΗ ΕΜΦΑΝΙΣΗ
---------------------------------------------------- */

.form-card {
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.10);
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
}

.form-group {
    flex: 1;
}

label {
    font-size: 14px;
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #ced4da;
    font-size: 14px;
    background: #fff;
}

textarea {
    resize: vertical;
    min-height: 90px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* ----------------------------------------------------
   ΦΙΛΤΡΑ (TASKS, CLIENTS, ACTIVE PROFESSIONALS)
---------------------------------------------------- */

.filters-container {
    background: #ffffff;
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    margin-bottom: 18px;
}

.filters-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filters-row input,
.filters-row select {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d5d9df;
    border-radius: 8px;
    font-size: 14px;
    min-width: 160px;
    background: white;
}

.filters-row input::placeholder {
    color: #aaa;
}

.filter-btn {
    height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    background: #0d6efd;
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.filter-btn:hover {
    background: #0b5ed7;
}

/* ----------------------------------------------------
   ΕΙΔΙΚΑ ΓΙΑ ACTIVE PROFESSIONALS
---------------------------------------------------- */

.active-status-pill {
    display:inline-block;
    padding:2px 8px;
    border-radius:12px;
    font-size:12px;
    font-weight:600;
}

.active-status-pill.on  { background:#d1e7dd; color:#0f5132; }
.active-status-pill.off { background:#f8d7da; color:#842029; }

/* ----------------------------------------------------
   FOOTER (ΑΝ ΥΠΑΡΧΕΙ)
---------------------------------------------------- */

.footer {
    text-align:center;
    font-size:12px;
    color:#777;
    padding:12px 0 20px;
}

/* ----------------------------------------------------
   RESPONSIVE – TABLET / ΚΙΝΗΤΟ
---------------------------------------------------- */

/* Tablet κάτω από 992px */
@media (max-width: 992px) {

    .page-container {
        max-width: 100%;
        margin: 20px auto;
        padding: 0 10px;
    }

    .cards-row {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .card {
        flex: 1 1 calc(50% - 18px);
    }

    .main-menu {
        gap: 14px;
    }
}

/* Κινητό κάτω από 768px */
@media (max-width: 768px) {

    body {
        background:#f2f3f5;
    }

    /* Header σε 2 γραμμές */
    .left-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .main-menu {
        flex-wrap: wrap;
        gap: 10px;
    }

    .main-menu a {
        font-size: 14px;
        padding-bottom: 2px;
    }

    .user-info {
        margin-left: 0;
        font-size: 13px;
    }

    .page-container {
        margin: 15px auto;
        padding: 0 10px;
    }

    /* Κάρτες dashboard: 1 ανά σειρά */
    .cards-row {
        flex-direction: column;
    }

    .card {
        flex: 1 1 100%;
        min-width: 100%;
    }

    /* Φόρμες – κάθετη διάταξη */
    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    input, select, textarea {
        font-size: 15px;
        padding: 10px 12px;
    }

    .form-card {
        padding: 15px;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .form-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Φίλτρα – σε 2-3 σειρές, full width */
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-row input,
    .filters-row select {
        width: 100%;
        min-width: 100%;
    }

    .filter-btn {
        width: 100%;
        text-align: center;
    }

    .new-task-top {
        justify-content: stretch;
    }

    .new-task-btn {
        width: 100%;
        justify-content: center;
    }

    /* Πίνακες: μικρότερη γραμματοσειρά */
    th, td {
        font-size: 12px;
        padding: 8px 6px;
    }

    table {
        min-width: 700px;
    }

    .icon-btn {
        width:26px;
        height:26px;
        font-size:14px;
    }
}
/* =============================
   RESPONSIVE MOBILE FIXES
   ============================= */

@media (max-width: 768px) {

    /* Κεντρικό container να έχει λίγο padding */
    body {
        padding: 10px;
    }

    /* DASHBOARD CARDS σε 2 στήλες */
    .stats-grid,
    .cards-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .stats-card {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Φιλτρα να μπαίνουν κάθετα */
    .filters-row,
    .form-row,
    .filter-line {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100%;
    }

    .filters-row select,
    .filters-row input,
    .filters-row button,
    .form-row select,
    .form-row input {
        width: 100% !important;
    }

    /* Πίνακες γίνονται scrollable */
    table {
        font-size: 14px;
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Εικονίδια ενεργειών λίγο μικρότερα */
    .actions-column i {
        transform: scale(0.9);
    }
}
/* ============================================
   GLOBAL RESPONSIVE RULES (Δεν επηρεάζουν desktop)
   ============================================ */

@media (max-width: 768px) {

    /* ---- Layout ---- */
    body {
        padding: 10px;
    }

    .container,
    .content-wrapper {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* ---- Dashboard Cards in 2 columns ---- */
    .stats-grid,
    .cards-row,
    .dashboard-cards {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .stats-card,
    .card-box,
    .summary-box {
        width: 100% !important;
        margin: 0 !important;
    }

    /* ---- Filters become vertical ---- */
    .filters-row,
    .filter-row,
    .form-row,
    .search-filters {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100%;
    }

    .filters-row select,
    .filters-row input,
    .filters-row button,
    .form-row select,
    .form-row input,
    .form-row button {
        width: 100% !important;
        height: 48px !important;
    }

    /* ---- Table scroll ---- */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 14px;
        min-width: 700px; /* αποτρέπει «σπάσιμο» */
    }

    /* ---- Actions icons smaller ---- */
    .actions-column i,
    td .action-btn {
        transform: scale(0.85);
    }

    /* ---- Calendar adjustments ---- */
    .fc-view-harness {
        height: auto !important;
    }

    .fc-daygrid-day-number {
        font-size: 12px !important;
    }

    .fc-toolbar-title {
        font-size: 18px !important;
    }

    /* ---- Navigation ---- */
    nav ul {
        flex-wrap: wrap !important;
        gap: 10px;
    }

    nav li {
        width: calc(50% - 10px);
        text-align: center;
    }

    nav li a {
        padding: 10px !important;
        font-size: 14px;
    }
}
/* ============================================
   DASHBOARD CARDS — MOBILE OPTIMIZATION
   ============================================ */

@media (max-width: 768px) {

    /* Τα rows των καρτών γίνονται grid */
    .cards-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
        margin-bottom: 15px !important;
    }

    /* Κάρτες γεμίζουν το πλάτος τους */
    .cards-row .card {
        width: 100% !important;
        padding: 15px !important;
        border-radius: 10px !important;
        text-align: center !important;
    }

    /* Τίτλος μικρότερος και σε 2 γραμμές αν πρέπει */
    .cards-row .card h3 {
        font-size: 16px !important;
        line-height: 1.2;
        margin-bottom: 8px;
    }

    /* Αξίες μεγαλύτερες και εμφανείς */
    .cards-row .card .card-value {
        font-size: 22px !important;
        font-weight: bold;
    }
}
/* ============================================
   FILTERS — MOBILE
   ============================================ */

@media (max-width: 768px) {

    .filters-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 10px !important;
        width: 100%;
    }

    /* Σε πολύ μικρές οθόνες → 1 στήλη */
    @media (max-width: 500px) {
        .filters-row {
            grid-template-columns: 1fr !important;
        }
    }

    .filters-row select,
    .filters-row input {
        width: 100% !important;
        height: 45px !important;
        font-size: 14px !important;
    }

    .filters-row button,
    .filters-row .btn {
        width: 100% !important;
        height: 45px !important;
        font-size: 15px !important;
    }

    /* Αναδιάταξη κουμπιών Excel/PDF */
    .export-buttons {
        display: flex;
        gap: 10px;
        margin-top: 10px;
    }

    .export-buttons button {
        flex: 1;
        text-align: center;
    }
}
/* ==========================================================================
   MOBILE OPTIMIZATION — FILTER SECTIONS (TASKS & CLIENTS)
   ========================================================================== */

@media (max-width: 1200px) {
    .filters-container {
        padding: 10px !important;
    }
}

@media (max-width: 900px) {

    /* Κάνουμε το row grid ώστε να τοποθετούνται όμορφα */
    .filters-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .filters-row input,
    .filters-row select,
    .filters-row button {
        width: 100% !important;
        height: 46px !important;
        font-size: 15px !important;
    }

    .filters-row button.filter-btn {
        font-weight: bold;
    }

    /* Κουμπιά Excel/PDF κοντά μεταξύ τους */
    .filters-row .export-btn {
        width: 100% !important;
        font-size: 18px !important;
        padding: 10px 0 !important;
    }
}

/* Σε μικρότερα κινητά → μόνο 1 στήλη */
@media (max-width: 550px) {

    .filters-row {
        grid-template-columns: 1fr !important;
    }

    .filters-row button,
    .filters-row input,
    .filters-row select {
        height: 48px !important;
    }

    /* Καλύτερο spacing */
    .filters-container {
        padding: 5px !important;
    }
}

/* ==========================================================================
   TABLES — RESPONSIVE IMPROVEMENTS WITHOUT BREAKING DESKTOP
   ========================================================================== */

@media (max-width: 900px) {
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }

    table th,
    table td {
        white-space: nowrap;
        font-size: 14px !important;
    }
}

/* ==========================================================================
   DASHBOARD CARDS — MOBILE FRIENDLY
   ========================================================================== */

@media (max-width: 900px) {
    .cards-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .card {
        padding: 18px !important;
        text-align: center !important;
    }

    .card-value {
        font-size: 22px !important;
    }
}

@media (max-width: 550px) {
    .cards-row {
        grid-template-columns: 1fr !important;
    }
}
/* ==========================================================================
   MOBILE — GENERAL LAYOUT FIX FOR PAGES WITH FILTERS
   ========================================================================== */

@media (max-width: 900px) {

    /* Container περιορίζει σωστά το πλάτος */
    .page-container {
        padding: 10px !important;
    }

    /* ΦΙΛΤΡΑ → Grid εμφάνιση */
    .filters-container {
        width: 100% !important;
        padding: 10px !important;
    }

    .filters-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        width: 100% !important;
        align-items: center;
    }

    .filters-row input,
    .filters-row select,
    .filters-row button,
    .filter-btn {
        width: 100% !important;
        height: 46px !important;
        font-size: 15px !important;
    }

    /* Buttons */
    .filter-btn {
        padding: 10px 0 !important;
    }
}

/* 1 COLUMN ON SMALL PHONES */
@media (max-width: 550px) {

    .filters-row {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   MOBILE — TABLE WRAPPING (Tasks, Clients, Active Professionals)
   ========================================================================== */

@media (max-width: 900px) {
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }

    table {
        min-width: 700px !important; /* Αναγκάζει όμορφο οριζόντιο scroll */
    }

    table th,
    table td {
        white-space: nowrap;
        padding: 8px !important;
        font-size: 14px !important;
    }
}

/* ==========================================================================
   MOBILE — NEW TASK / NEW CLIENT BUTTON
   ========================================================================== */

@media (max-width: 900px) {
    .new-task-top {
        display: flex;
        justify-content: center !important;
        margin-bottom: 15px !important;
    }

    .new-task-btn {
        width: 100% !important;
        text-align: center !important;
        font-size: 17px !important;
        padding: 12px !important;
    }
}
/* ============================================================
   MOBILE CARD VIEW (Ενεργό μόνο σε κινητά)
============================================================ */
@media (max-width: 768px) {

    /* Κρύβουμε τον πίνακα */
    table {
        display: none !important;
    }

    /* Κάρτες */
    .mobile-card {
        background: #fff;
        padding: 15px;
        margin: 12px 0;
        border-radius: 12px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.12);
        font-size: 15px;
    }

    .mobile-card-row {
        margin-bottom: 6px;
    }
    .mobile-card-row strong {
        color: #333;
    }

    /* Ενέργειες */
    .mobile-actions {
        margin-top: 12px;
        display: flex;
        gap: 12px;
    }
    .mobile-actions a {
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 14px;
        text-decoration: none;
        color: white !important;
    }

    .btn-view { background: #3498db; }
    .btn-edit { background: #f1c40f; color: black !important; }
    .btn-delete { background: #e74c3c; }
}
.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    position: relative;
    z-index: 10; /* ΕΞΑΙΡΕΤΙΚΑ ΣΗΜΑΝΤΙΚΟ */
}

.filters-row button.filter-btn {
    position: relative;
    z-index: 20; /* φέρνει τα κουμπιά πάνω από οτιδήποτε */
    cursor: pointer;
}
/* Mobile layout for top action buttons */
@media (max-width: 768px) {
    .top-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 8px;
        margin-bottom: 15px;
    }

    .top-actions a,
    .top-actions .new-task-btn {
        width: 100% !important;
        text-align: center;
        font-size: 15px;
        padding: 12px 0;
    }
}
.notes-big {
    width: 100%;
    min-height: 220px !important;
    resize: vertical;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #d0d0d0;
    font-size: 15px;
    line-height: 1.4;
}
@media (max-width: 768px) {
    .right-sidebar {
        width: 100%;
    }
    .diary-box {
        margin-top: 15px;
    }
    .notes-big {
        min-height: 300px !important;
    }
}
/* Μεγαλύτερο πλαίσιο σημειώσεων */
.big-note-area {
    min-height: 250px !important;
}

@media (max-width: 900px) {
    .big-note-area {
        min-height: 300px !important;
    }
}
