/* ================================================
   INLINE INVOICE DISCOUNTS - Custom Styles
   ================================================ */

/* Discount column styling */
.bill_col_discount {
    min-width: 150px;
}

.bill_col_discount .input-group-append {
    width: 60px;
}

.bill_col_discount .js_item_discount_type {
    font-size: 12px;
    padding: 0.25rem;
}

/* Hide discount column when needed */
.bill_col_discount.hidden {
    display: none !important;
}

/* Disabled button styling */
button.disabled,
a.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ================================================
   GOOGLE KEEP-STYLE NOTE CARDS
   ================================================ */

/* Card grid container - masonry-like layout */
.notes-keep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 8px;
}

/* Individual note card */
.note-keep-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

.note-keep-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-color: #d0d0d0;
}

/* Card title */
.note-keep-card .note-keep-title {
    font-size: 15px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 8px;
    line-height: 1.4;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card description/preview */
.note-keep-card .note-keep-description {
    font-size: 13px;
    color: #5f6368;
    line-height: 1.5;
    flex-grow: 1;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

/* Attachment indicator */
.note-keep-card .note-keep-attachments {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #5f6368;
    margin-bottom: 8px;
    padding: 4px 8px;
    background: #f1f3f4;
    border-radius: 6px;
    width: fit-content;
}

.note-keep-card .note-keep-attachments i {
    font-size: 14px;
    color: #80868b;
}

/* Card tags area */
.note-keep-card .note-keep-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.note-keep-card .note-keep-tags .label {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background-color: #e8eaed;
    color: #3c4043;
    border: none;
    font-weight: 500;
}

/* Card footer with meta info */
.note-keep-card .note-keep-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #f1f3f4;
    margin-top: auto;
}

.note-keep-card .note-keep-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #80868b;
}

.note-keep-card .note-keep-meta img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.note-keep-card .note-keep-date {
    font-size: 11px;
    color: #9aa0a6;
}

/* Card action buttons - visible on hover */
.note-keep-card .note-keep-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.note-keep-card:hover .note-keep-actions {
    opacity: 1;
}

.note-keep-card .note-keep-actions .btn {
    padding: 4px 7px;
    font-size: 13px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #80868b;
    line-height: 1;
}

.note-keep-card .note-keep-actions .btn:hover {
    background-color: #f1f3f4;
    color: #202124;
}

.note-keep-card .note-keep-actions .btn.text-warning {
    color: #fbbc04;
}

/* Checkbox on cards */
.note-keep-card .note-keep-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.note-keep-card:hover .note-keep-checkbox {
    opacity: 1;
}

/* Card color variants (like Google Keep) */
.note-keep-card.note-color-default { background: #fff; }
.note-keep-card.note-color-coral { background: #faafa8; border-color: #f4a4a0; }
.note-keep-card.note-color-peach { background: #f39f76; border-color: #e99468; }
.note-keep-card.note-color-sand { background: #fff8b8; border-color: #f0e8a0; }
.note-keep-card.note-color-mint { background: #e2f6d3; border-color: #d0ecc0; }
.note-keep-card.note-color-sage { background: #b4ddd3; border-color: #a4cdc3; }
.note-keep-card.note-color-fog { background: #d3e4ec; border-color: #c3d4dc; }
.note-keep-card.note-color-storm { background: #aeccdc; border-color: #9ebccc; }
.note-keep-card.note-color-dusk { background: #d3bfdb; border-color: #c3afcb; }
.note-keep-card.note-color-blossom { background: #f6e2dd; border-color: #e6d2cd; }
.note-keep-card.note-color-clay { background: #e9c99a; border-color: #d9b98a; }
.note-keep-card.note-color-chalk { background: #efeff1; border-color: #dfdfe1; }

/* Star button always visible when starred */
.note-keep-card .note-keep-star-active {
    color: #fbbc04 !important;
    opacity: 1 !important;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .notes-keep-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .notes-keep-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Starred notes keep style */
.starred-notes-keep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    padding: 4px;
}

/* Load more button within the grid */
.notes-keep-grid .notes-keep-load-more {
    grid-column: 1 / -1;
    text-align: center;
    padding: 16px;
}

/* Search results keep grid - smaller cards */
.notes-search-keep-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    padding: 4px 0;
}

.notes-search-keep-grid .note-keep-card {
    min-height: 100px;
    position: relative;
    cursor: pointer;
}

.notes-search-keep-grid .note-keep-description {
    -webkit-line-clamp: 3;
}

/* Clickable overlay for search cards */
.note-keep-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    cursor: pointer;
}

/* Tag match highlight in search */
.note-keep-tags .search-tag-match {
    background-color: #fce8b2 !important;
    color: #7a5700 !important;
    font-weight: 600;
}

/* ================================================
   NOTE SHOW MODAL - KEEP CARD STYLE
   ================================================ */

/* The card itself */
.note-keep-modal-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* Close button - top right corner */
.note-keep-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #80868b;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 5;
}

.note-keep-modal-close:hover {
    background: #f1f3f4;
    color: #202124;
}

/* Title */
.note-keep-modal-card-title {
    font-size: 22px;
    font-weight: 500;
    color: #202124;
    padding: 24px 52px 4px 24px;
    line-height: 1.35;
    word-break: break-word;
    letter-spacing: -0.2px;
}

/* Body content */
.note-keep-modal-card-body {
    font-size: 14px;
    color: #3c4043;
    line-height: 1.65;
    padding: 12px 24px 20px;
    word-break: break-word;
    min-height: 80px;
}

.note-keep-modal-card-body p {
    margin-bottom: 10px;
}

.note-keep-modal-card-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
}

.note-keep-modal-card-body ul,
.note-keep-modal-card-body ol {
    padding-left: 24px;
    margin-bottom: 10px;
}

/* Attachments section */
.note-keep-modal-card-attachments {
    border-top: 1px solid #e0e0e0;
    padding: 16px 24px;
}

.note-keep-modal-card-attachments-label {
    font-size: 12px;
    font-weight: 500;
    color: #80868b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.note-keep-modal-card-attachments-label i {
    font-size: 14px;
}

.note-keep-modal-card-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.note-keep-modal-card-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f1f3f4;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #3c4043;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s;
    font-size: 13px;
    max-width: 260px;
}

.note-keep-modal-card-file:hover {
    background: #e8eaed;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #202124;
}

.note-keep-modal-card-file-icon {
    width: 32px;
    height: 32px;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #dadce0;
}

.note-keep-modal-card-file-icon i {
    color: #5f6368;
    font-size: 16px;
}

.note-keep-modal-card-file-name {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-keep-modal-card-file-dl {
    color: #80868b;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.note-keep-modal-card-file:hover .note-keep-modal-card-file-dl {
    opacity: 1;
}

/* Bottom toolbar - like Google Keep */
.note-keep-modal-card-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 16px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.note-keep-modal-card-toolbar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #5f6368;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.note-keep-modal-card-toolbar-btn:hover {
    background: #e8eaed;
    color: #202124;
}

.note-keep-modal-card-toolbar-date {
    margin-left: auto;
    font-size: 12px;
    color: #9aa0a6;
}

/* Override modal chrome when showing keep card */
.note-keep-modal-content {
    border-radius: 8px !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden;
}

.note-keep-modal-content #commonModalBody {
    padding: 0 !important;
    min-height: auto !important;
}

/* ================================================
   GAMIFICATION — XP, Streak, Missions, Rewards
   ================================================ */

/* XP Summary Card */
.gamification-fire-icon {
    font-size: 28px;
    line-height: 1;
    margin-right: 4px;
}
.gamification-streak-number {
    font-size: 28px;
    font-weight: 700;
    color: #ff6b35;
    margin-right: 3px;
    line-height: 1;
}
.gamification-streak-label {
    font-size: 12px;
    color: #999;
    align-self: flex-end;
    margin-bottom: 3px;
}
.gamification-level-badge {
    background: rgba(33, 150, 243, 0.12);
    color: #2196f3;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
}
.gamification-xp-total {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 2px;
}
.gamification-xp-label {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.6;
}
.gamification-xp-today {
    font-size: 12px;
    margin-bottom: 5px;
}
.gamification-level-progress-text {
    font-size: 10px;
}

/* Missions Card */
.gamification-missions-counter {
    font-size: 12px;
    font-weight: 600;
    color: #2196f3;
    background: rgba(33, 150, 243, 0.1);
    padding: 2px 10px;
    border-radius: 50px;
}
.gamification-mission-item {
    display: flex;
    align-items: center;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: opacity 0.2s ease;
}
.gamification-mission-item:last-child {
    border-bottom: none;
}
.gamification-mission-item.completed {
    opacity: 0.5;
}
.gamification-mission-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 10px;
    margin-bottom: 0;
    cursor: pointer;
}
.gamification-mission-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2196f3;
}
.gamification-mission-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.gamification-mission-title {
    font-size: 12.5px;
    flex: 1;
}
.gamification-mission-title.line-through {
    text-decoration: line-through;
    opacity: 0.6;
}
.gamification-mission-xp {
    font-size: 11px;
    font-weight: 600;
    color: #2196f3;
    margin-left: 8px;
    white-space: nowrap;
}

/* XP Float Animation */
.gamification-xp-floater {
    font-size: 18px;
    font-weight: 700;
    color: #2196f3;
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
    pointer-events: none;
    white-space: nowrap;
}

/* Reward Toast */
.gamification-reward-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1a2535;
    border: 1px solid #2a3a4e;
    border-left: 4px solid #2196f3;
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 360px;
}
.gamification-reward-toast.show {
    transform: translateX(0);
}
.gamification-reward-toast-icon {
    font-size: 28px;
    line-height: 1;
}
.gamification-reward-toast-content strong {
    display: block;
    font-size: 13px;
    color: #2196f3;
    margin-bottom: 2px;
}
.gamification-reward-toast-content p {
    font-size: 12px;
    margin: 0;
    color: #c8d6e5;
}
.gamification-reward-toast-close {
    background: none;
    border: none;
    color: #5a6d82;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.gamification-reward-toast-close:hover {
    color: #c8d6e5;
}
