/* ==========================================================================
   Customer Dashboard
   ========================================================================== */

.cd-dashboard-wrapper {
    width: 100%;
    max-width: 100%;
}

.cd-dashboard-wrapper .grid-stack {
    background: transparent;
}

.cd-dashboard-wrapper .grid-stack-item {
    cursor: default;
}

/* CRITICAL: item-content must be absolutely positioned to fill the cell.
   This is what makes GridStack control the size, not the content. */
.cd-dashboard-wrapper .grid-stack-item > .grid-stack-item-content {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    overflow: hidden;
    /* z-index lower than resize handle */
    z-index: 1;
}

/* CRITICAL: resize handle must be above item-content.
   GridStack appends .ui-resizable-se as a sibling of .grid-stack-item-content,
   but item-content is position:absolute and covers it unless we set z-index. */
.cd-dashboard-wrapper .grid-stack-item > .ui-resizable-se {
    position: absolute;
    z-index: 10;
    right: 6px;
    bottom: 6px;
    width: 20px;
    height: 20px;
    opacity: 0;
    cursor: se-resize;
    transition: opacity 0.15s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M3 13L13 3M8 13L13 8' stroke='rgba(0,0,0,0.5)' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 16px 16px;
}

.cd-dashboard-wrapper .grid-stack-item:hover > .ui-resizable-se {
    opacity: 1;
}

.cd-dashboard-wrapper .grid-stack-placeholder > .placeholder-content {
    background: rgba(26, 25, 26, 0.08);
    border: 2px dashed rgba(40,40,40, 0.3);
    border-radius: 10px;
}

/* Card shell */
.cd-card-inner {
    background: #37353a;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}


@media (prefers-color-scheme: dark) {
    .cd-card-inner        {
	background: #1a1a1a;
	border-color: rgba(77,77,77,0.08);
    }
    .cd-card-title        {
	border-bottom-color: rgba(77,77,77,0.07) !important;
	color: rgba(170, 160,32, 0.5) !important;
    }
    .cd-layout-hint       {
	color: rgba(255,255,255,0.35) !important;
    }
}


.grid-stack-item.ui-draggable-dragging   .cd-card-inner {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: rgba(0,0,0,0.3);
}

.grid-stack-item.ui-resizable-resizing   .cd-card-inner {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.25);
}

/* Card header */
.cd-card-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.4);
    padding: 10px 14px 8px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    z-index:999;
    user-select: none;
    -webkit-user-select: none;
    
}

/* Card body — scrolls if content is taller than the card */
.cd-card-body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 12px 14px;
    min-height: 0;
}

.ui-draggable-dragging .cd-card-body {
    pointer-events: none;
    user-select: none;
}

/* Hint bar */
.cd-layout-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.35);
    margin: 10px 0  4px;
    user-select: none;
}

.cd-save-indicator {
    display: inline-block;
    margin-left: 10px;
    font-size: 11px;
    color: #1a8a3a;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cd-save-indicator.cd-save-visible {
    opacity: 1;
}

.cd-login-notice {
    padding: 1rem;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    font-size: 14px;
    color: rgba(0,0,0,0.5);
}

@media (max-width: 600px) {
    .cd-dashboard-wrapper .grid-stack-item {
	width: 100% !important;
	left: 0 !important;
    }
}
