/* ==========================================
   RbBAAR - CSS Stiilid
   ========================================== */

/* Üldised stiilid */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0f0f23;
    color: #e0e0e0;
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: #e94560;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Navigatsioon */
.navbar {
    background-color: #1a1a2e;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e94560;
    text-decoration: none;
}

.menu {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.menu-btn {
    padding: 0.5rem 1rem;
    border-radius: 5px;
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.3s;
}

.menu-btn:hover {
    background-color: #16213e;
    text-decoration: none;
}

.menu-btn.active {
    background-color: #e94560;
    color: white;
}

.login-btn {
    background-color: #e94560;
    color: white !important;
}

.login-btn:hover {
    background-color: #d63851;
}

/* Põhisisu */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero sektsioon */
.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 10px;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    color: #e94560;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    color: #a0a0a0;
    margin-bottom: 2rem;
}

/* Statistika */
.stats-section {
    margin-bottom: 2rem;
}

.stats-section h2 {
    color: #e94560;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background-color: #1a1a2e;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #16213e;
}

.stat-card.stat-warning {
    border-color: #e94560;
    background-color: rgba(233, 69, 96, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #e94560;
}

.stat-label {
    color: #a0a0a0;
    margin-top: 0.5rem;
}

/* Teated */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: rgba(39, 174, 96, 0.2);
    border: 1px solid #27ae60;
    color: #27ae60;
}

.alert-error {
    background-color: rgba(233, 69, 96, 0.2);
    border: 1px solid #e94560;
    color: #e94560;
}

.alert-warning {
    background-color: rgba(241, 196, 15, 0.2);
    border: 1px solid #f1c40f;
    color: #f1c40f;
}

/* Lao/Baari sisu */
.ladu-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .ladu-content {
        grid-template-columns: 1fr;
    }
}

.ladu-input-section,
.ladu-logi-section {
    background-color: #1a1a2e;
    padding: 1.5rem;
    border-radius: 10px;
}

.ladu-input-section h2,
.ladu-logi-section h2 {
    color: #e94560;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #16213e;
}

/* Skanneeri ala */
.scan-area {
    margin-bottom: 1.5rem;
}

.scan-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid #16213e;
    border-radius: 5px;
    background-color: #0f0f23;
    color: #e0e0e0;
}

.scan-input:focus {
    outline: none;
    border-color: #e94560;
}

.scan-error {
    color: #e94560;
    margin-top: 0.5rem;
    min-height: 1.5rem;
}

/* Artiklite nimekiri */
.artiklid-list {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.artiklid-empty {
    text-align: center;
    color: #666;
    padding: 2rem;
}

.artikkel-rida {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #16213e;
    background-color: #0f0f23;
    margin-bottom: 0.5rem;
    border-radius: 5px;
}

.artikkel-rida.laoseis-hoiatus {
    border-left: 3px solid #e94560;
}

.artikkel-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.artikkel-nimetus {
    font-weight: bold;
}

.artikkel-kood,
.artikkel-laoseis {
    font-size: 0.85rem;
    color: #a0a0a0;
}

.artikkel-hind {
    color: #27ae60;
    font-weight: bold;
}

.artikkel-kogus {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-kogus {
    width: 30px;
    height: 30px;
    border: none;
    background-color: #16213e;
    color: #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
}

.btn-kogus:hover {
    background-color: #e94560;
}

.kogus-input {
    width: 60px;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid #16213e;
    border-radius: 5px;
    background-color: #0f0f23;
    color: #e0e0e0;
}

.btn-eemalda {
    background-color: #e94560;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    cursor: pointer;
}

/* Nupud */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #e94560;
    color: white;
}

.btn-primary:hover {
    background-color: #d63851;
}

.btn-secondary {
    background-color: #16213e;
    color: #e0e0e0;
}

.btn-secondary:hover {
    background-color: #1a1a2e;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #219a52;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Kiirvalik nupud */
.btn-kiirvalik {
    display: block;
    width: 100%;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.5rem;
    background-color: #16213e;
    border: 2px solid #e94560;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.2s;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-kiirvalik:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.btn-kiirvalik.liige-admin {
    background-color: #1e7e34;
    border-color: #28a745;
}

.btn-kiirvalik.liige-admin:hover {
    background-color: #28a745;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

/* Artikli kiirvalik nupud */
.artikkel-kiirvalik-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: rgba(233, 69, 96, 0.1);
    border-radius: 8px;
    min-height: 50px;
}

.btn-artikkel-kiirvalik {
    padding: 0.7rem 1.1rem;
    background-color: #e94560;
    border: none;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-artikkel-kiirvalik:hover {
    background-color: #ff6b6b;
    transform: scale(1.05);
}

/* Väljastus modal layout */
.valjastus-layout {
    display: flex;
    gap: 2rem;
}

.valjastus-left {
    flex: 2;
}

.valjastus-right {
    flex: 1;
    min-width: 220px;
    max-width: 300px;
    border-left: 2px solid #e94560;
    padding-left: 1.5rem;
    padding-right: 0.5rem;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
}

.valjastus-right label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: #e94560;
}

.kiirvalik-container {
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .valjastus-layout {
        flex-direction: column;
    }
    .valjastus-right {
        border-left: none;
        border-top: 2px solid #e94560;
        padding-left: 0;
        padding-top: 1rem;
        max-width: none;
    }
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.login-required-msg {
    padding: 1rem;
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid #e94560;
    border-radius: 8px;
    color: #e94560;
    font-size: 1.1rem;
}

.login-required-msg a {
    font-weight: bold;
}

/* Logi nimekiri */
.logi-list {
    max-height: 500px;
    overflow-y: auto;
}

.logi-kirje {
    padding: 0.75rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.logi-kirje:hover {
    transform: translateX(5px);
}

.logi-valja {
    background-color: rgba(233, 69, 96, 0.1);
    border-left: 3px solid #e94560;
}

.logi-sisse {
    background-color: rgba(39, 174, 96, 0.1);
    border-left: 3px solid #27ae60;
}

.logi-muu {
    background-color: rgba(241, 196, 15, 0.1);
    border-left: 3px solid #f1c40f;
}

.logi-kirje.kustutatud {
    opacity: 0.5;
    text-decoration: line-through;
}

.logi-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.25rem;
}

.logi-tyyp {
    font-weight: bold;
    font-size: 0.8rem;
}

.logi-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #a0a0a0;
}

.logi-teinud {
    font-style: italic;
    color: #808080;
}

/* Modaalid */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow-y: auto;
}

.modal-content {
    background-color: #1a1a2e;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.modal-large {
    max-width: 700px;
}

.modal-small {
    max-width: 400px;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #a0a0a0;
}

.close:hover {
    color: #e94560;
}

.modal-content h2 {
    color: #e94560;
    margin-bottom: 1.5rem;
}

/* Vormid */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #a0a0a0;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #16213e;
    border-radius: 5px;
    background-color: #0f0f23;
    color: #e0e0e0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e94560;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.error-message {
    color: #e94560;
    margin-bottom: 1rem;
    min-height: 1rem;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background-color: #e94560;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.submit-btn:hover {
    background-color: #d63851;
}

/* Autocomplete */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #0f0f23;
    border: 1px solid #16213e;
    border-radius: 0 0 5px 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.dropdown-item {
    padding: 0.75rem;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: #16213e;
}

/* Tabelid */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    color: #e94560;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-section {
    background-color: #1a1a2e;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.85rem;
    color: #a0a0a0;
}

.filter-group input,
.filter-group select {
    padding: 0.5rem;
    border: 1px solid #16213e;
    border-radius: 5px;
    background-color: #0f0f23;
    color: #e0e0e0;
}

.table-container {
    background-color: #1a1a2e;
    border-radius: 10px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #16213e;
}

.data-table th {
    background-color: #16213e;
    color: #e94560;
    font-weight: bold;
}

.data-table tbody tr:hover {
    background-color: rgba(233, 69, 96, 0.05);
}

.data-table .number {
    text-align: right;
}

.data-table .small {
    font-size: 0.85rem;
    color: #a0a0a0;
}

.data-table .actions {
    white-space: nowrap;
}

.row-danger {
    background-color: rgba(233, 69, 96, 0.1);
}

.row-warning {
    background-color: rgba(241, 196, 15, 0.1);
}

.table-footer {
    padding: 1rem;
    background-color: #1a1a2e;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.vaartus-info {
    color: #27ae60;
    font-weight: bold;
}

/* Koodide read */
.koodi-rida {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.koodi-rida select {
    width: 120px;
}

.koodi-rida input {
    flex: 1;
}

/* Badge'id */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

.badge-admin {
    background-color: #e94560;
    color: white;
}

.badge-liige {
    background-color: #3498db;
    color: white;
}

.badge-klient {
    background-color: #27ae60;
    color: white;
}

.badge-success {
    background-color: #27ae60;
    color: white;
}

.badge-danger {
    background-color: #e74c3c;
    color: white;
}

.badge-valjastus {
    background-color: #e94560;
    color: white;
}

.badge-tagastus {
    background-color: #27ae60;
    color: white;
}

.badge-sissetulek,
.badge-korrigeerimine,
.badge-muutmine,
.badge-kustutamine {
    background-color: #f1c40f;
    color: #333;
}

/* Logi detail */
.logi-detail-info {
    background-color: #0f0f23;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.logi-detail-info p {
    margin-bottom: 0.5rem;
}

/* Modal artiklid */
.modal-artiklid-list {
    background-color: #0f0f23;
    border-radius: 5px;
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.modal-artikkel-rida {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid #16213e;
}

/* Import/Export */
.import-success {
    color: #27ae60;
}

.import-error {
    color: #e94560;
}

.import-errors {
    margin-top: 1rem;
    font-size: 0.85rem;
}

.import-errors ul {
    margin-left: 1rem;
}

/* Warning text */
.warning-text {
    color: #e94560;
    font-weight: bold;
}

/* Laadimise indikaator */
.loading,
.empty,
.error {
    text-align: center;
    padding: 2rem;
    color: #a0a0a0;
}

.error {
    color: #e94560;
}

/* Quick actions */
.quick-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Form footer */
.form-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #16213e;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .menu {
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}
