/* GroundRak Finnish Extension – CSS
   (Firmad, Asukohad, Tellingute nimekiri + edit kastid)
*/

/* ---------------------------------------------------------
   Success message
--------------------------------------------------------- */
.gr-success {
    padding: 12px 15px;
    background: #d8f5d1;
    border-left: 4px solid #4CAF50;
    margin-bottom: 15px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.gr-success-text {
    color: #000000;  /* ainult edu tekst roheliseks */
    font-size: 16px;
}
.gr-success button,
.gr-success .gr-close-alert {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    font-weight: bold;
    color: #000; /* must */
}

/* ---------------------------------------------------------
   Tellingu MUUDA kast (#gr-edit-box)
   – sama tunne nagu GroundRaki teised tumedad kastid
--------------------------------------------------------- */
#gr-edit-box {
    background: #0F172A;          /* põhitaust – tumedam nagu soovisid */
    border: 1px solid #1F2937;    /* pehme tume äär */
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    color: #E5E7EB;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.7);
}

#gr-edit-box h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: #F9FAFB;
}

#gr-edit-box label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #E5E7EB;
}

#gr-edit-box input,
#gr-edit-box select {
    width: 100%;
    box-sizing: border-box;
    background: #020617;
    border: 1px solid #334155;
    color: #E5E7EB;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}

#gr-edit-box input:focus,
#gr-edit-box select:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

/* ---------------------------------------------------------
   Üldine tabel GroundRak Finnish extensionis
   (Tellingute nimekiri, Firmad, Asukohad)
--------------------------------------------------------- */
/* .groundrak-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.9rem;
} */

/* Päis */
/* .groundrak-table thead tr {
    background-color: #0F172A;
} */

/* .groundrak-table th {
    padding: 8px 10px;
    border: 1px solid #1F2937;
    text-align: left;
    font-weight: 600;
    color: #F9FAFB;
    white-space: nowrap;
} */

/* Keha */
/* .groundrak-table td {
    padding: 8px 10px;
    border: 1px solid #111827;
    background-color: #020617;
    color: #E5E7EB;
} */

/* Hover */
/* .groundrak-table tbody tr:hover td {
    background-color: #0B1220;
} */

/* Kitsam "Muuda" / "Kustuta" veerg – kui kasutatakse viimases veerus */
/* .groundrak-table th:last-child,
.groundrak-table td:last-child {
    text-align: center;
    white-space: nowrap;
} */

/* ---------------------------------------------------------
   NUPUD – kasutame sama loogikat nagu GroundRaki uues teemas
--------------------------------------------------------- */
/* 
.groundrak-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    border: none;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition:
        transform 0.1s ease,
        box-shadow 0.1s ease,
        background-color 0.15s ease,
        color 0.15s ease;
}

.groundrak-btn-primary {
    background: #2563EB;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.45);
}

.groundrak-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.6);
}

.groundrak-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.4);
}

.groundrak-btn.danger {
    background: #DC2626;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(127, 29, 29, 0.4);
}

.groundrak-btn.danger:hover {
    background: #B91C1C;
    transform: translateY(-1px);
}

.groundrak-btn.danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(127, 29, 29, 0.4);
}

/* Tabeli sees – nuppude spacing */
.groundrak-table td button {
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 999px;
    white-space: nowrap;
} */

/* ---------------------------------------------------------
   BUTTONS INLINE (MUUDA + KUSTUTA) – desktop
--------------------------------------------------------- */

/* Muuda + Kustuta kõrvuti: objektide, firmade ja asukohtade tabelites */
.gr-obj-actions-inline {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
}

.gr-obj-actions-inline form {
    margin: 0;
}

/* Fallback: kui keegi kasutab lihtsalt <td><button> + <form> */
td .groundrak-btn {
    display: inline-flex;
}
td form {
    display: inline-block;
    margin: 0;
}
td .groundrak-btn + form,
td form + .groundrak-btn {
    margin-left: 8px;
}

/* Mobiilis võib nupud lasta alla joonduda kui vaja */
@media (max-width: 768px) {
    .gr-obj-actions-inline {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

/* ---------------------------------------------------------
   Admin forms (Companies / Locations)
   – sama fiiling nagu objekti haldus vormil
--------------------------------------------------------- */

.gr-admin-box {
    background: #0F172A;           /* tume kaart */
    border: 1px solid #1F2937;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    color: #E5E7EB;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.7);
}

.gr-admin-box h2 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #F9FAFB;
}

/* Vorm layout */
.gr-admin-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 520px;
    margin-bottom: 20px;
}

/* Grid – sama loogika nagu objektide lisamise vormil (flex wrap) */
.gr-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.gr-align-end {
    align-self: flex-end;
}

/* Checkbox rida */
.gr-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 8px;
}
.gr-checkbox input[type="checkbox"] {
    width: auto;
}

/* Sildid ja väljad */
.gr-admin-box label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #E5E7EB;
}

.gr-admin-box input,
.gr-admin-box select {
    background: #020617;
    border: 1px solid #334155;
    color: #F3F4F6;
    padding: 6px 10px;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
}

.gr-admin-box input:focus,
.gr-admin-box select:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

/* ---------------------------------------------------------
   General forms (Add telling) – sama tume kast
--------------------------------------------------------- */
.gr-form {
    max-width: 520px;
    background: #0F172A;
    border-radius: 12px;
    border: 1px solid #1F2937;
    padding: 20px;
    color: #E5E7EB;
    margin-top: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.7);
}
.gr-form label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}
.gr-form input,
.gr-form select {
    margin-bottom: 12px;
    background: #020617;
    border: 1px solid #334155;
    color: #F3F4F6;
    padding: 6px 10px;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
}
.gr-form input:focus,
.gr-form select:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

/* ---------------------------------------------------------
   Mobile cards – Firmad / Asukohad / (soovi korral ka Tellingud)
   Sama stiil nagu objektide mobiilkaardid
--------------------------------------------------------- */

.groundrak-mobile-cards {
    display: none;
}

/* Mobiilis: peida tabel, näita kaarte */
@media (max-width: 768px) {

    .groundrak-table {
        display: none;
    }

    .groundrak-mobile-cards {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .gr-object-card {
        border-radius: 14px;
        padding: 1.2rem;
        margin-bottom: 0.5rem;
        background: #0F172A;
        color: #F1F5F9;
        border: 1px solid #1E293B;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.7);
    }

    .gr-obj-header {
        display: flex;
        justify-content: space-between;
        font-size: 1.05rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
    }

    .gr-obj-name {
        font-weight: 600;
    }

    .gr-obj-row {
        display: flex;
        justify-content: space-between;
        margin: 0.25rem 0;
        font-size: 0.9rem;
    }

    .gr-label {
        opacity: 0.8;
        font-size: 0.85rem;
    }

    .gr-value {
        font-weight: 500;
    }

    .gr-obj-actions {
        margin-top: 0.9rem;
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        justify-content: space-between;
    }

    .gr-obj-actions form {
        margin: 0;
    }

    /* Kustuta nupp mobiilis natuke “rasvasem” */
    .gr-obj-actions .groundrak-btn.danger {
        padding: 0.9rem 1.8rem;
        font-size: 0.95rem;
        border-radius: 999px;
    }
}

/* Desktop: kui kuskil kasutatakse ka .gr-object-card, hoia sama stiili */
@media (min-width: 769px) {
    .gr-object-card {
        border-radius: 12px;
        padding: 1rem;
        background: #0F172A;
        border: 1px solid #1E293B;
        color: #F1F5F9;
    }
}


/* -------------------------------------------------------
   Kontrollija asjad!
-------------------------------------------------------- */

/* === CONTROLER TOP NAV === */

.gr-controller-topnav {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #0f172a;
    padding: 12px 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* NUPUD */
.gr-controller-topnav-btn {
    padding: 10px 18px;
    background: #1e40af;
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: 0.2s;
    white-space: nowrap;
}

.gr-controller-topnav-btn:hover {
    background: #1e3a8a;
    transform: translateY(-2px);
}

/* LOGOUT BUTTON */
.gr-controller-topnav-btn.logout {
    background: #dc2626;
}

.gr-controller-topnav-btn.logout:hover {
    background: #b91c1c;
}

/* MOBIIL — 2x suuremad nupud */
@media (max-width: 600px) {
    .gr-controller-topnav {
        padding: 10px;
        gap: 8px;
    }
    .gr-controller-topnav-btn {
        flex: 1 1 calc(50% - 10px);
        text-align: center;
        font-size: 16px;
        padding: 14px 10px;
    }
}
/* -------------------------------------------------------
   END Kontrollija asjad!
-------------------------------------------------------- */





