:root {
    --sky-top: #7abfeF;
    --sky-bottom: #add9f7;
    --pale-card: #f5f9ff;
    --dark-blue: #1a527f;
    --blue: #1f6ec7;
    --green: #33a063;
    --orange: #f0781f;
    --purple: #7b52c0;
    --text: #1a334d;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    min-height: 100%;
    background: var(--sky-bottom);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: linear-gradient(145deg, var(--sky-top), var(--sky-bottom));
    background-attachment: fixed;
}

button, input {
    font: inherit;
}

button {
    cursor: pointer;
}

#app {
    width: 100%;
    max-width: 650px;
    min-height: 100vh;
    margin: 0 auto;
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
}

.app-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(18px + env(safe-area-inset-top)) 18px 12px;
    color: white;
}

.header-logo {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: rgba(255,255,255,.28);
    border: 1px solid rgba(255,255,255,.45);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -1px;
}

.header-text {
    min-width: 0;
}

.welcome {
    font-size: 13px;
    opacity: .9;
}

.app-header h1 {
    margin: 2px 0;
    font-size: 25px;
    font-weight: 650;
}

.subtitle {
    font-size: 12px;
    opacity: .9;
}

.settings-button {
    width: 42px;
    height: 42px;
    margin-left: auto;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.8);
    color: var(--dark-blue);
    font-size: 23px;
}

main {
    padding: 12px 16px 24px;
}

.summary-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 17px;
    border-radius: 17px;
    background: var(--pale-card);
    color: var(--dark-blue);
    font-size: 14px;
    font-weight: 550;
}

.summary-card strong {
    font-size: 21px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    margin-bottom: 25px;
}

.quick-action {
    min-width: 0;
    min-height: 112px;
    padding: 13px;
    border: 0;
    border-radius: 17px;
    color: white;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

.action-blue { background: #1f6ec7; }
.action-orange { background: #f0781f; }
.action-green { background: #33a063; }
.action-purple { background: #7b52c0; }

.action-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: rgba(255,255,255,.18);
    font-size: 23px;
}

.quick-action strong {
    font-size: 14px;
    font-weight: 650;
}

.quick-action small {
    font-size: 11px;
    opacity: .9;
    line-height: 1.3;
}

.category-section,
.entries-section {
    margin-bottom: 25px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.section-heading h2 {
    margin: 0;
    color: var(--dark-blue);
    font-size: 17px;
    font-weight: 650;
}

.section-heading button {
    border: 0;
    background: transparent;
    color: var(--dark-blue);
    font-size: 13px;
    font-weight: 600;
}

.category-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 1px 7px;
    scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
    display: none;
}

.category-chip {
    flex-shrink: 0;
    padding: 8px 13px;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 30px;
    background: rgba(255,255,255,.82);
    color: #19578f;
    font-size: 12px;
    font-weight: 550;
}

.category-chip.selected {
    background: #d6eafa;
    border-color: #5999cf;
}

#searchInput {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 0;
    border-radius: 13px;
    outline: none;
    background: var(--pale-card);
    color: #172b40;
    font-size: 15px;
}

#searchInput:focus {
    box-shadow: 0 0 0 2px rgba(31,110,199,.25);
}

.entry-group {
    margin-bottom: 19px;
}

.entry-group-title {
    margin: 0 0 10px 2px;
    color: var(--dark-blue);
    font-size: 14px;
    font-weight: 650;
}

.entry-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px;
    margin-bottom: 10px;
    border-radius: 17px;
    background: var(--pale-card);
    box-shadow: 0 2px 7px rgba(30,75,110,.05);
}

.entry-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #deebfa;
    color: #1f6ec7;
    font-size: 21px;
}

.entry-info {
    min-width: 0;
    flex: 1;
}

.entry-info strong {
    display: block;
    margin-bottom: 5px;
    color: #172f47;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.entry-info p {
    margin: 0 0 5px;
    color: #526a80;
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.entry-category {
    color: #195f9e;
    font-size: 11px;
}

.entry-arrow {
    color: #8195a8;
    font-size: 19px;
}

.empty-state {
    padding: 30px 18px;
    border-radius: 18px;
    background: var(--pale-card);
    color: var(--dark-blue);
    text-align: center;
}

.empty-state .empty-icon {
    margin-bottom: 10px;
    font-size: 34px;
}

.empty-state strong {
    display: block;
    font-size: 15px;
}

.empty-state p {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.5;
}

.bottom-navigation {
    position: fixed;
    z-index: 10;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: center;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255,255,255,.6);
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.bottom-navigation button {
    flex: 1;
    max-width: 210px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px;
    border: 0;
    background: transparent;
    color: #246493;
}

.bottom-navigation button span {
    font-size: 21px;
}

.bottom-navigation button small {
    font-size: 10px;
    font-weight: 550;
}

@media (min-width: 600px) {
    main {
        padding-right: 22px;
        padding-left: 22px;
    }
}

/* Entry form modal */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(15, 40, 65, 0.48);
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.modal.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

.modal-content {
    width: 100%;
    max-width: 560px;
    max-height: 90%;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 10px 40px rgba(20, 60, 90, 0.2);
}

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

.modal-header h2 {
    margin: 0;
    color: #1a5285;
    font-size: 21px;
}

.modal-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #edf5fb;
    color: #315d80;
    font-size: 18px;
}

#entryForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#entryForm label {
    margin-top: 8px;
    color: #315d80;
    font-size: 14px;
    font-weight: 700;
}

#entryForm input,
#entryForm textarea,
#entryForm select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d5e5f1;
    border-radius: 13px;
    background: #f8fbfe;
    color: #244b6b;
    padding: 13px;
    font: inherit;
    font-size: 16px;
    outline: none;
}

#entryForm textarea {
    resize: vertical;
    min-height: 110px;
}

#entryForm input:focus,
#entryForm textarea:focus,
#entryForm select:focus {
    border-color: #65a8d8;
    box-shadow: 0 0 0 3px rgba(101, 168, 216, 0.14);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}

.modal-actions button {
    flex: 1;
    min-height: 48px;
    border: 0;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
}

.cancel-button {
    background: #edf3f8;
    color: #42627d;
}

.save-button {
    background: #3989c5;
    color: #ffffff;
}

@media (min-width: 600px) {
    .modal {
        align-items: center;
    }
}
/* Category management */

.category-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.category-form label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

.category-form input,
.category-form select {
    width: 100%;
    padding: 13px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
}

.category-management-list {
    margin-top: 25px;
}

.category-management-list h3 {
    font-size: 17px;
    margin-bottom: 12px;
}

.category-management-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.category-management-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.category-management-actions {
    display: flex;
    gap: 8px;
}

.category-management-actions button {
    border: none;
    background: #eef4ff;
    color: #2878e5;
    padding: 8px 11px;
    border-radius: 9px;
    font-size: 13px;
}

.category-management-actions button.delete {
    background: #fff0f0;
    color: #d94343;
}

.locked-message {
    color: #d18a24;
    font-size: 13px;
    font-weight: 600;
    margin: 8px 0;
}

.entry-actions .toggle-lock {
    background: #fff4df;
    color: #9b6818;
}

/* Προβολή καταχωρίσεων και λεπτομερειών */

.page-view {
    padding: 12px 16px 100px;
}

#myEntriesSearch {
    width: 100%;
    padding: 13px 15px;
    margin-bottom: 18px;
    border: 1px solid #dce6ef;
    border-radius: 13px;
    background: white;
    font-size: 14px;
    outline: none;
}

.entry-detail-link {
    cursor: pointer;
}

.detail-card {
    padding: 20px;
    border-radius: 17px;
    background: var(--pale-card);
    box-shadow: 0 2px 7px rgba(30,75,110,.05);
}

.detail-card h2 {
    margin: 0 0 12px;
    color: var(--dark-blue);
    font-size: 21px;
}

.detail-date {
    margin: 14px 0;
    color: #718096;
    font-size: 12px;
}

.detail-description {
    margin-top: 18px;
    color: #34445a;
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

#backToEntriesButton,
#editDetailButton,
#unlockDetailButton,
#lockDetailButton {
    padding: 9px 13px;
    border: 0;
    border-radius: 10px;
    background: #e8f1fb;
    color: var(--dark-blue);
    font-size: 13px;
    font-weight: 600;
}

#unlockDetailButton,
#lockDetailButton {
    background: #fff4df;
    color: #9b6818;
}