/* static/style.css - updated: preserves your design, hides Completed rows, improves mobile */

/* Universal Structure */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
body {
    background: #f5f7fa;
    font-family: 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #0b1220;
}

main {
    flex: 1 0 auto;
}

/* Footer */
footer {
    text-align: center;
    padding: 12px;
    background: #222;
    color: #fff;
    flex-shrink: 0;
    font-size: 15px;
    letter-spacing: 0.02em;
}

/* Logo and Header Block */
.logo-center-block {
    text-align: center;
    margin: 34px 0 10px 0;
    position: relative;
}
.main-logo {
    width: 180px;
    max-width: 34vw;
    height: auto;
    margin-bottom: 10px;
    display: inline-block;
    filter: drop-shadow(0 6px 20px rgba(58,204,78,0.14));
}
.crm-subtitle {
    color: #2462ff;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-shadow: 0 2px 8px rgba(184,234,255,0.12);
    margin-bottom: 12px;
}

@media (max-width: 700px) {
    .main-logo { width: 110px; }
    .crm-subtitle { font-size: 1.15rem;}
}

/* Topbar and Main Controls */
.crm-header {
    background: #fff;
    padding: 18px 0 8px 0;
    box-shadow: 0 2px 12px rgba(184,212,255,0.16);
    border-bottom: 1px solid #e3ebf6;
}
.header-flex-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 0 16px;
}

/* Action Buttons */
.btn, .big-btn, .back-btn, .submit-btn {
    padding: 9px 24px;
    background: linear-gradient(90deg,#377cff 80%,#54b8fd 100%);
    color: #fff;
    border: none;
    border-radius: 7px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    box-shadow: 0 2px 6px rgba(52,117,235,0.14);
    cursor: pointer;
    transition: background 0.17s, filter 0.17s, transform 0.08s;
    margin: 0 6px 0 0;
    display: inline-block;
}
.btn.secondary, .big-btn.secondary {
    background: linear-gradient(90deg, #f3f5fa 70%, #e6eaff 100%);
    color: #2462ff;
    box-shadow: none;
    border: 1px solid rgba(33,98,255,0.06);
}
.btn.export { background: #2563ff; color: #fff; }
.btn.import { background: #178c0d; color: #fff; }
.btn.logout { background: #f04067; color: #fff; }
.btn:hover, .big-btn:hover, .back-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

/* Search Bar */
.header-search-form {
    flex: 2 1 320px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: #f5faff;
    padding: 7px 12px;
    border-radius: 8px;
    box-shadow: 0 1px 8px rgba(210,234,252,0.14);
}
.search-inp {
    padding: 8px 16px;
    border: 1px solid #8da9d5;
    border-radius: 7px;
    font-size: 15px;
    width: 210px;
    background: #fff;
}

/* Table Styles */
table {
    border-collapse: separate;
    border-spacing: 0;
    width: 95%;
    background: #fff;
    margin: 10px auto 8px auto;
    box-shadow: 0 6px 16px rgba(170,204,239,0.27);
    border-radius: 10px;
    overflow: hidden;
    font-size: 13.5px;
}
th, td {
    border: none;
    border-bottom: 1px solid #e2e8f0;    /* Mild horizontal line */
    padding: 8px 6px;
}
tr:last-child td {
    border-bottom: none;
}
th {
    background: linear-gradient(90deg, #1654ac 85%, #2c6ee5 100%);
    color: #fff !important;
    font-size: 1em;
    font-weight: 800;
    text-align: left;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #c7ddfa;
    position: sticky;
    top: 0;
    z-index: 2;
    text-shadow: 0 1px 5px rgba(23,78,173,0.15);
}

tr:nth-child(even) {
    background: #f8f9fb;
}
tr {
    transition: background 0.14s;
}
tr:hover {
    background: #f3f8ff !important;
}

/* Hide Completed rows (CSS safety net)
   Rows already filtered on server side; this is an extra precaution
   Template adds class: status-{{ cust['status']|lower|replace(' ', '-') }} 
.status-completed { display: none !important; }
.status-completed td { padding: 0; border: none; height: 0; } */

/* Improve very long text columns */
td { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Form Card / Box */
.reg-form-container {
    max-width: 420px;
    margin: 12px auto 34px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.form-card {
    background: #fff;
    border-radius: 13px;
    box-shadow: 0 6px 24px rgba(27,227,140,0.08);
    padding: 34px 26px 28px 26px;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
}
.form-group {
    margin-bottom: 17px;
}
.form-group label {
    font-size: 1.13em;
    font-weight: 600;
    color: #218c2f;
    margin-bottom: 5px;
    display:block;
}
.form-card input,
.form-card select,
.form-card textarea {
    width: 99%;
    padding: 13px 12px;
    border-radius: 7px;
    border: 1px solid #c5dadc;
    font-size: 16px;
    background: #f8f9fa;
    transition: box-shadow 0.16s;
    margin-bottom: 4px;
}
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
    box-shadow: 0 0 5px rgba(76,185,116,0.2);
    border-color: #4cb974;
}
.submit-btn {
    background: linear-gradient(90deg,#4cb974 80%,#68d68f 100%);
    color: #fff;
    padding: 13px 0;
    width: 100%;
    border-radius: 8px;
    font-size: 1.18em;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 18px rgba(24,178,132,0.27);
    cursor:pointer;
    margin-top: 13px;
    transition:filter 0.19s;
}
.submit-btn:hover { filter: brightness(1.09); }
.back-btn { margin-bottom: 20px; }

/* Admin Dropdown */
.admin-dropdown {
    position: absolute;
    right: 18px;
    top: 12px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 170px;
}
.admin-label {
    font-weight: 700;
    color: #174ead;
    background: #f2f8ff;
    padding: 8px 20px 8px 16px;
    border-radius: 8px 8px 0 0;
    font-size: 1.07em;
    cursor: pointer;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 8px rgba(191,218,244,0.2);
    transition: background 0.14s;
}
.logout-btn {
    display: none;
    background: #f04067;
    color: #fff;
    padding: 9px 14px;
    text-align: left;
    border-radius: 0 0 10px 10px;
    font-size: 1em;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(191,199,236,0.2);
    text-decoration: none;
}
.admin-dropdown:hover .logout-btn,
.admin-label:focus + .logout-btn {
    display: block;
}

/* A cleaner user label alternative */
.user-label {
    background: #e8f1ff;
    color: #2462ff;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 700;
}

/* Responsive Forms and Containers */
@media (max-width: 600px){
    .form-card { padding: 18px 6vw 22px 6vw; }
    .main-logo { width: 85px; }
    .reg-form-container { max-width: 99vw; }
    .crm-subtitle { font-size: 1.0rem;}
    .admin-dropdown { right: 10px; top: 6px; min-width: 150px; }
    .search-inp { width: 140px; }
}

/* Misc Fixes */
h2, th { color: #2462ff;}

/* Responsive adjustments for CRM dashboard */
@media (max-width: 1200px) {
    body {
        zoom: 92%;
    }
}

@media (max-width: 992px) {
    .top-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    table {
        font-size: 13px;
    }
    th, td {
        padding: 6px 8px;
    }
}

@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    nav, header, footer {
        text-align: center;
    }

    .top-buttons button {
        width: 48%;
        margin-bottom: 5px;
    }

    .crm-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
        padding: 5px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 4px;
    }

    .main-logo {
        width: 120px;
    }

    .header-flex-row { padding: 8px; gap: 6px; }
    .header-search-form { padding: 6px; }
    .search-inp { width: 110px; padding: 6px 10px; font-size: 14px; }
}

