@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@500;600;700&display=swap');

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #090d16; }
::-webkit-scrollbar-thumb { background: #1f2937; border-radius: 20px; border: 2px solid #090d16; }
::-webkit-scrollbar-thumb:hover { background: #6366f1; }

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

body { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    background: #090d16; 
    color: #f1f5f9; 
    margin: 0; 
    padding: 40px 20px 80px 20px; 
    -webkit-font-smoothing: antialiased;
}

.container { 
    max-width: 1280px; 
    background: #111827; 
    padding: 32px; 
    margin: 0 auto; 
    border-radius: 16px; 
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

h2 { 
    color: #ffffff; 
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    position: relative;
    padding-left: 16px;
}

h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 4px;
    background: linear-gradient(to bottom, #6366f1, #a855f7);
    border-radius: 4px;
}

.student-info {
    text-align: right;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.student-info strong {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.student-info span {
    display: block;
    color: #6366f1;
    font-size: 12px;
    font-weight: 500;
    margin-top: 2px;
}

/* --- KONTROLES JOSLA --- */
.kontroles-josla { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 28px; 
    background: #1f2937; 
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.kontroles-josla div {
    display: flex;
    align-items: center;
    gap: 16px;
}

label {
    font-size: 14px;
    font-weight: 600;
    color: #9ca3af;
}

#datePicker { display: none; }

.custom-dropdown {
    position: relative;
    width: 200px;
    user-select: none;
}

.dropdown-trigger {
    background: #090d16;
    color: #ffffff;
    padding: 11px 16px;
    border: 1px solid #374151;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.dropdown-trigger:hover, .custom-dropdown.open .dropdown-trigger {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.dropdown-trigger::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 2px solid #9ca3af;
    border-bottom: 2px solid #9ca3af;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -3px;
}

.custom-dropdown.open .dropdown-trigger::after {
    transform: rotate(-135deg);
    border-color: #6366f1;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    max-height: 240px;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 4px 0;
    display: none;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: all 0.15s ease;
}

.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-menu::-webkit-scrollbar { width: 5px; }
.dropdown-menu::-webkit-scrollbar-thumb { background: #374151; border-radius: 4px; }

.dropdown-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 16px;
    font-size: 14px;
    color: #d1d5db;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s, color 0.1s;
}

.dropdown-item:hover {
    background: #6366f1;
    color: #ffffff;
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    background: transparent; 
}

th, td { 
    padding: 16px 20px; 
    border-bottom: 1px solid #1f2937; 
    text-align: left; 
    font-size: 14px; 
}

th { 
    background: #1f2937; 
    color: #9ca3af; 
    font-weight: 600; 
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
}

tr:hover { background: rgba(255, 255, 255, 0.015); }

td:nth-child(2), td:nth-child(3), td:nth-child(4), td:nth-child(5) {
    font-family: 'JetBrains Mono', monospace;
}

td.editable { 
    position: relative;
    color: #38bdf8; 
    font-weight: 500;
}

td.editable:hover { 
    background: rgba(56, 189, 248, 0.08);
    border-radius: 4px;
}

td:last-child {
    display: flex;
    gap: 8px;
    align-items: center;
}

.custom-input-wrapper {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    display: flex;
    align-items: center;
    background: #090d16;
    border: 2px solid #6366f1;
    border-radius: 6px;
    z-index: 10;
    box-sizing: border-box;
    overflow: hidden;
}

.custom-input-wrapper input {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    color: #fff;
    padding: 0 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    width: 100%;
}

.custom-spin-panel {
    display: flex;
    flex-direction: column;
    width: 22px;
    height: 100%;
    border-left: 1px solid #1f2937;
}

.custom-spin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50%;
    cursor: pointer;
    background: #111827;
    transition: background 0.1s;
    user-select: none;
}

.custom-spin-btn:hover { background: #2563eb; }

.spin-up::after {
    content: '';
    width: 4px;
    height: 4px;
    border-top: 2px solid #9ca3af;
    border-left: 2px solid #9ca3af;
    transform: rotate(45deg);
    margin-top: 2px;
}

.spin-down::after {
    content: '';
    width: 4px;
    height: 4px;
    border-bottom: 2px solid #9ca3af;
    border-right: 2px solid #9ca3af;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

button { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 13px; 
    font-weight: 600; 
    line-height: 1;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-jauns { 
    background: #6366f1; 
    color: #ffffff; 
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
}
.btn-jauns:hover { background: #4f46e5; transform: translateY(-1px); }

.btn-save { background: #10b981; color: #ffffff; }
.btn-save:hover { background: #059669; }
.btn-save:disabled { 
    background: #1f2937; 
    color: #4b5563; 
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: not-allowed; 
}

.btn-delete { 
    background: rgba(239, 68, 68, 0.1); 
    color: #f87171; 
    border: 1px solid rgba(239, 68, 68, 0.2); 
}
.btn-delete:hover { background: #ef4444; color: #ffffff; }

.pazinojums { 
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px; 
    border-radius: 10px; 
    color: #ffffff; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    text-align: left; 
    font-weight: 600;
    font-size: 14px;
    z-index: 9999;
    transform: translateX(150%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.pazinojums.success { background: #10b981 !important; }
.pazinojums.error { background: #ef4444 !important; }
.pazinojums.show { transform: translateX(0); opacity: 1; pointer-events: auto; }

.scroll-nav-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.scroll-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.scroll-btn::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-right: 2.5px solid #9ca3af;
    border-bottom: 2.5px solid #9ca3af;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.scroll-btn-up::before { transform: rotate(-135deg); margin-top: 4px; }
.scroll-btn-down::before { transform: rotate(45deg); margin-top: -4px; }

.scroll-btn:hover {
    background: #6366f1;
    border-color: #6366f1;
    transform: scale(1.08);
}
.scroll-btn:hover::before { border-color: #ffffff; }
.scroll-btn.visible { opacity: 1; transform: scale(1); pointer-events: auto; }

.name-cell { position: relative; padding: 4px !important; }

.searchable-dropdown-wrapper {
    position: relative;
    z-index: 100;
}

.name-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 250px;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    margin-top: 4px;
    padding: 8px;
    display: none;
}

.name-dropdown-menu input {
    width: 100%;
    padding: 8px;
    background: #090d16;
    border: 1px solid #374151;
    color: white;
    border-radius: 4px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.dropdown-options { max-height: 200px; overflow-y: auto; }

.dropdown-item {
    padding: 8px;
    cursor: pointer;
    color: #d1d5db;
    border-radius: 4px;
}
.dropdown-item:hover { background: #6366f1; color: white; }

input[type="date"].date-input {
    background: #090d16;
    color: #38bdf8;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 8px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color-scheme: dark;
}

input[type="date"].date-input:hover {
    border-color: #4b5563;
}

input[type="date"].date-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input[type="date"].date-input::-webkit-calendar-picker-indicator {
    filter: invert(0.6) sepia(1) saturate(3) hue-rotate(200deg);
    cursor: pointer;
    border-radius: 3px;
    padding: 2px;
    transition: filter 0.2s;
}

input[type="date"].date-input::-webkit-calendar-picker-indicator:hover {
    filter: invert(0.8) sepia(1) saturate(5) hue-rotate(200deg);

.scroll-btn-new::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    background: transparent;
    border: 2.5px solid #a855f7; /* Violets akcents rombam */
    transform: rotate(45deg); /* Pagriežam kvadrātu par 45 grādiem, lai sanāk rombs */
    box-sizing: border-box;
    transition: border-color 0.2s, background-color 0.2s;
}

.scroll-btn-new:hover {
    background: #a855f7 !important;
    border-color: #a855f7 !important;
}

.scroll-btn-new:hover::before {
    border-color: #ffffff !important;
    background: #ffffff;
}

@keyframes highlightNewRow {
    0% { background-color: rgba(168, 85, 247, 0.4); }
    100% { background-color: transparent; }
}

.just-created-row {
    animation: highlightNewRow 2s ease-out forwards;
}