:root {
    --white: #fff;
    --black: #000;
    --systemGray: rgb(108, 108, 112);
    --systemGray2: rgb(142, 142, 147);
    --systemGray3: rgb(174, 174, 178);
    --systemGray4: rgb(188, 188, 192);
    --systemGray5: rgb(216, 216, 220);
    --systemGray6: rgb(235, 235, 240);
    --mint: rgb(0,199,190);
    --red: rgb(255,59,48);
    --textEditor: #fff;
    --templateList: rgb(216, 216, 220);
    --background: #fff;
    --background2: rgb(235, 235, 240);
    --hoverBackground: var(--systemGray6);
}

@media (prefers-color-scheme: dark) {
    :root {
        --white: #000;
        --black: #fff;
        --systemGray: rgb(174, 174, 178);
        --systemGray2: rgb(124, 124, 128);
        --systemGray3: rgb(84, 84, 86);
        --systemGray4: rgb(68, 68, 70);
        --systemGray5: rgb(54, 54, 56);
        --systemGray6: rgb(36, 36, 38);
        --mint: rgb(99,230,226);
        --red: rgb(255,69,58);
        --textEditor: rgb(54, 54, 56);
        --templateList: rgb(68, 68, 70);
        --background: rgb(36, 36, 38);
        --background2: rgb(36, 36, 38);
        --hoverBackground: var(--systemGray5);
    }
}

:root[data-theme="light"] {
    --white: #fff;
    --black: #000;
    --systemGray: rgb(108, 108, 112);
    --systemGray2: rgb(142, 142, 147);
    --systemGray3: rgb(174, 174, 178);
    --systemGray4: rgb(188, 188, 192);
    --systemGray5: rgb(216, 216, 220);
    --systemGray6: rgb(235, 235, 240);
    --mint: rgb(0,199,190);
    --red: rgb(255,59,48);
    --textEditor: #fff;
    --templateList: rgb(216, 216, 220);
    --background: #fff;
    --background2: rgb(235, 235, 240);
    --hoverBackground: var(--systemGray6);
}

:root[data-theme="dark"] {
    --white: #000;
    --black: #fff;
    --systemGray: rgb(174, 174, 178);
    --systemGray2: rgb(124, 124, 128);
    --systemGray3: rgb(84, 84, 86);
    --systemGray4: rgb(68, 68, 70);
    --systemGray5: rgb(54, 54, 56);
    --systemGray6: rgb(36, 36, 38);
    --mint: rgb(99,230,226);
    --red: rgb(255,69,58);
    --textEditor: rgb(54, 54, 56);
    --templateList: rgb(68, 68, 70);
    --background: rgb(36, 36, 38);
    --background2: rgb(36, 36, 38);
    --hoverBackground: var(--systemGray5);
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: column;
    height: 100vh;
    /*background-color: #f4f4f4;*/
    background-color: var(--background);
    color: var(--black);
    font-family: "Reddit Sans", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at bottom right, rgba(0, 199, 190, 0.18), transparent 34%),
        radial-gradient(circle at top left, rgba(0, 199, 190, 0.10), transparent 30%),
        var(--background);
}

.wrapper {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: column;
    height: 100vh;
    padding: 0;
    margin: 0;
    overflow: hidden; 
}

.container {
    width: 100%;
    height: 100%;
    /*max-width: 1200px;*/
    display: flex;
    flex-direction: row;
    gap: 0px;
    flex: 1 1 auto;
    min-height: 0;
}

.applinks-bar {
    width: 100%;
    height: 100px;
    background-color: var(--background2);
    border-top: 1px solid var(--systemGray3);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px;
    font-size: 14px;
    position: static;
    bottom: 0;
    flex: 0 0 100px;
}

.applink {
    width: 100px;
    text-align: center;
    position: relative;
}

.applink img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    transition: 0.2s;
    border: 1px solid var(--systemGray4);
}

.applink img:hover {
    transform: scale(1.1);
}

.applink-name {
    /*text-align: center;
    padding: 0px;
    display: none;*/
    visibility: hidden;
    opacity: 0;
    width: 120px;
    background-color: var(--systemGray6);
    border: 1px solid var(--systemGray4);
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    margin-left: -60px; /* Use half of the width (130/2 = 65), to center the tooltip */
    z-index: 1;
    transition: 0.2s;
}

.applink:hover .applink-name {
    visibility: visible;
    opacity: 0.9;
}

.applink-name::after {
    content: " ";
    position: absolute;
    top: 100%; /* At the bottom of the tooltip */
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--systemGray4) transparent transparent transparent;
    opacity: 0.9;
}

.title {
    height: auto;
    padding: 20px 20px;
    font-size: 21px;
    font-weight:400;
    box-sizing: border-box;
    flex: 0 0 auto;
    width: auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

.title-logo {
    height: 50px;
    border-radius: 10px;
    flex-shrink: 0;
}

.title-text {
    display: flex;
    align-items: center;
}

.template-list {
    width: 15%;
    min-width: 200px;
    background-color: var(--background);
    border-right: 1px solid var(--systemGray3);
    display: flex;
    flex-direction: column;
    row-gap: 10px;
    overflow: hidden;
    scrollbar-width: none; /* Hide scrollbars */
    -ms-overflow-style: none; /* Hide scrollbars */
    min-height: 0;
}

.template-list::-webkit-scrollbar {
    display: none; /* Hide scrollbars */
}

.template-list ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    font-weight: 300;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.template-list li {
    /*display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px;
    margin: 0px 10px;
    background-color: none;
    margin-bottom: 1px;
    cursor: pointer;
    border-radius: 10px;
    transition: 0.2s;*/
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px;
    margin: 0 10px 1px 10px;
    cursor: pointer;
    border-radius: 7px;
    transition: 0.2s;
}

.template-icon {
    color: var(--systemGray);
    font-size: 14px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.template-name {
    flex: 1;
    font-size: 14px;
}

.template-list li:hover {
    background-color: var(--hoverBackground);
}

.main-area {
    width: 85%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.top-bar {
    /*padding: 20px;
    justify-content: right;
    background-color: var(--background);
    flex: 0 0 auto;*/
    padding: 20px;
    background-color: transparent;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.page-title {
    padding: 0 20px 20px 30px;
    justify-content: right;
    background-color: transparent;
    display: flex;
    flex: 0 0 auto;
}

.page-title h1 {
    margin: 0 0 5px 0;
    font-size: 21px;
}

.page-title p {
    margin: 0;
    color: var(--systemGray);
}

.page-title-text {
    flex: 1 0 auto;
}

.editor {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
    padding: 0 20px 20px 20px;
    box-sizing: border-box;
}

.editor-buttons {
    display: flex;
    justify-content: right;
    background-color: var(--background2);
    border: 1px solid var(--systemGray3);
    border-radius: 7px 7px 0 0;
    flex: 0 0 auto;
}

.editor-buttons button {
    font-size: 18px;
    border: none;
    background-color: transparent;
    border-radius: 10px;
    margin: 5px;
    color: var(--mint);
    transition: 0.2s;
    font-weight: 200;
}

.editor-buttons button:hover {
    background-color: var(--systemGray5);
}

.editor-buttons button:disabled {
    color: var(--systemGray2);
}

.template-editor-area {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.template-editor-empty {
    flex: 1 1 auto;
    min-height: 0;
    border: 1px solid var(--systemGray3);
    border-radius: 7px;
    background-color: var(--background);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--systemGray);
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.template-editor-empty i {
    font-size: 36px;
    color: var(--mint);
    margin-bottom: 12px;
}

.template-editor-empty h2 {
    margin: 0 0 6px 0;
    color: var(--black);
    font-size: 20px;
}

.template-editor-empty p {
    margin: 0;
    max-width: 360px;
}

#template-title {
    padding: 0px;
    flex-grow: 1;
    font-weight: bold;
}

#new-template {
    margin: 0;
    border-radius: 7px;
    border: 1px solid var(--systemGray3);
    background-color: var(--background);
    color: var(--mint);
    font-size: 13px;
    transition: 0.2s;
    padding: 7px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

#new-template:hover {
    background-color: var(--hoverBackground);
    opacity: 0.85;
}

#delete-template {
    color: var(--red);
}

#delete-template:disabled {
    color: var(--systemGray2);
}

#text-editor {
    width: 100%;
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px;
    font-size: 15px;
    box-sizing: border-box;
    border: none;
    resize: none;
    background-color: var(--background);
    color: var(--black);
    font-family: "Reddit Mono", monospace; /*"Reddit Sans", "Segoe UI", sans-serif;*/
    box-shadow: /*15px 15px 15px rgba(0,0,0,0.05) inset;*/ 0;
    transition: border-color 0.2s, box-shadow 0.2s;
    border: 1px solid var(--systemGray3);
    border-top: 0;
    border-radius: 0 0 7px 7px;
}

#text-editor:focus {
    outline: none;
}

button {
    padding: 10px;
    margin-top: 10px;
    cursor: pointer;
}

/*#logout {
    margin: 5px;
    padding: 0;
    font-size: 12px;
    color: var(--systemGray);
    text-align: center;
    margin-top: auto;
}

#logout a:any-link {
    color: inherit;
}*/

/*.cc-license {
    margin: 0 10px 10px 10px;
    padding: 0;
    font-size: 10px;
    color: var(--systemGray);
    text-align: center;
}*/

/* LOGIN PAGE */

#login-box {
    padding: 20px;
    background-color: var(--templateList);
    margin: 0 auto auto auto;
    border: 0;
    border-radius: 10px;
}

#login-box h2 {
    margin: 0;
}

#login-box button {
    border-radius: 0px 10px 10px 0px;
    border: 0;
    background-color: var(--mint);
}

#login-box #password {
    padding: 10px;
    margin-top: 10px;
    border: 0;
    border-radius: 10px 0px 0px 10px;
    background-color: var(--textEditor);
    color: var(--black);
}

/* GREETING */

.greeting {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 10px;
}

#greeting-icon {
    font-size: 28px;
    color: var(--mint);
}

#greeting-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--black);
}

#greeting-date {
    font-size: 14px;
    color: var(--systemGray);
}

/* USER MENU */

.user-menu {
    position: relative;
    margin-left: 0;
}

#user-account-button {
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background-color: transparent;
    color: var(--black);
    border-radius: 999px;
    padding: 6px 10px 6px 6px;
    margin: 0;
    cursor: pointer;
    transition: 0.2s;
}

#user-account-button:hover {
    background-color: var(--hoverBackground);
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--mint);
    color: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 300px;
    background-color: var(--background);
    border: 1px solid var(--systemGray3);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    padding: 16px;
    z-index: 1000;
}

.user-dropdown.hidden {
    display: none;
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--systemGray5);
}

.user-avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--mint);
    color: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 24px;
    flex-shrink: 0;
}

.user-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--black);
}

.user-role {
    font-size: 14px;
    color: var(--systemGray);
    margin-top: 2px;
}

.user-details {
    padding: 12px 0;
}

.user-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--systemGray6);
}

.user-detail-row span {
    color: var(--systemGray);
}

.user-detail-row strong {
    color: var(--black);
    font-weight: 600;
    text-align: right;
}

.sign-out-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    background-color: var(--red);
    color: white;
    border-radius: 10px;
    padding: 11px;
    font-weight: 600;
    transition: 0.2s;
}

.sign-out-button:hover {
    opacity: 0.85;
}

/* Template Library */

.template-workspace {
    display: flex;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 20px 20px 20px;
    box-sizing: border-box;
}

.template-library-card {
    width: 300px;
    min-width: 260px;
    max-width: 340px;
    flex: 0 0 300px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--background);
    border: 1px solid var(--systemGray3);
    border-radius: 7px;
    overflow: hidden;
}

.template-library-header {
    padding: 15px;
    /*border-bottom: 1px solid var(--systemGray5);*/
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.template-library-header h2 {
    margin: 0;
    font-size: 17px;
}

.template-library-header p {
    margin: 0;
    font-size: 13px;
    color: var(--systemGray);
}

.template-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 12px 12px 12px;
    padding: 8px 10px;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--systemGray);
}

#template-search {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
}

.template-tabs {
    display: flex;
    gap: 4px;
    padding: 0 12px 0px 12px;
    border-bottom: 1px solid var(--systemGray5);
    box-sizing: border-box;
}

.template-tab {
    flex: 1;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--systemGray);
    font-size: 12px;
    padding: 8px 4px;
    margin: 0;
    border-radius: 7px 7px 0 0;
}

.template-tab:hover {
    background-color: var(--hoverBackground);
}

.template-tab.active {
    /*background-color: var(--mint);*/
    color: var(--mint);
    border-bottom: 2px solid var(--mint);
}

.template-library-card #template-list {
    list-style-type: none;
    padding: 8px;
    margin: 0;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.template-library-card #template-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px;
    margin: 0 0 4px 0;
    cursor: pointer;
    border-radius: 7px;
    transition: 0.2s;
}

.template-library-card #template-list li:hover {
    background-color: var(--hoverBackground);
}

.template-library-card #template-list li.active {
    background-color: rgba(0, 199, 190, 0.14);
    outline: 1px solid var(--mint);
}

.template-favourite-button {
    border: none;
    background: transparent;
    color: var(--systemGray2);
    padding: 4px;
    margin: 0;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
}

.template-favourite-button:hover {
    background-color: var(--systemGray5);
    color: var(--mint);
}

.template-favourite-button.favourited {
    color: var(--mint);
}

.template-empty-message {
    padding: 14px;
    color: var(--systemGray);
    font-size: 14px;
    text-align: center;
}

.editor {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    padding: 0;
}

/* NAV */

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0 10px;
    flex: 1 1 auto;
}

.side-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 7px;
    color: var(--black);
    text-decoration: none;
    font-size: 15px;
    transition: 0.2s;
}

.side-nav-item i {
    width: 18px;
    text-align: center;
    color: var(--systemGray);
    font-size: 15px;
}

.side-nav-item:hover {
    background-color: var(--systemGray5);
}

.side-nav-item.active {
    background-color: var(--mint);
    color: var(--background);
}

.side-nav-item.active i {
    color: var(--background);
}

/* CLOCK */

.greeting-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--systemGray);
}

#greeting-date,
#live-clock,
.top-bar-separator {
    font-size: 14px;
    color: var(--systemGray);
}

/* GLOBAL SEARCH */

.global-search {
    width: min(320px, 40vw);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 14px;
    padding: 8px 10px;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--systemGray);
}

.global-search i {
    font-size: 14px;
    color: var(--systemGray);
}

#global-search-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
}

#global-search-input::placeholder {
    color: var(--systemGray);
}

/*
.global-search-shortcut {
    flex: 0 0 auto;
    padding: 2px 6px;
    border: 1px solid var(--systemGray4);
    border-radius: 6px;
    color: var(--systemGray);
    font-size: 12px;
    line-height: 1.2;
}*/

/* APP PAGES */

.app-page {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

.placeholder-page {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 20px 20px 20px;
    border: 1px solid var(--systemGray3);
    border-radius: 7px;
    background-color: var(--background);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--systemGray);
    text-align: center;
}

.placeholder-page i {
    font-size: 36px;
    color: var(--mint);
    margin-bottom: 12px;
}

.placeholder-page h2 {
    margin: 0 0 6px 0;
    color: var(--black);
}

.placeholder-page p {
    margin: 0;
}


/* TASKS PAGE */

.tasks-workspace {
    display: grid;
    grid-template-columns: minmax(230px, 280px) minmax(320px, 1fr) minmax(280px, 360px);
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 20px 20px 20px;
    box-sizing: border-box;
}

.tasks-sidebar-card,
.tasks-main-card,
.task-detail-card {
    min-height: 0;
    background-color: var(--background);
    border: 1px solid var(--systemGray3);
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tasks-card-header,
.tasks-main-header {
    padding: 15px;
    flex: 0 0 auto;
}

.tasks-card-header h2,
.tasks-main-header h2 {
    margin: 0;
    font-size: 17px;
}

.tasks-main-header p {
    margin: 4px 0 0 0;
    color: var(--systemGray);
    font-size: 13px;
}

.tasks-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 12px 12px 12px;
    padding: 8px 10px;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--systemGray);
    flex: 0 0 auto;
}

#task-search {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
}

.task-smart-list,
.task-list-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 8px;
}

.task-smart-list {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--systemGray5);
    flex: 0 0 auto;
}

.task-list-buttons {
    overflow-y: auto;
    min-height: 0;
    padding-bottom: 8px;
}

.task-list-section-title {
    padding: 12px 14px 6px 14px;
    color: var(--systemGray);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex: 0 0 auto;
}

.task-view-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: none;
    background: transparent;
    color: var(--black);
    border-radius: 7px;
    padding: 9px 10px;
    margin: 0;
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    transition: 0.2s;
}

.task-view-button span {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.task-view-button i {
    width: 18px;
    text-align: center;
    color: var(--systemGray);
}

.task-view-button strong {
    color: var(--systemGray);
    font-size: 12px;
    font-weight: 600;
}

.task-view-button:hover {
    background-color: var(--hoverBackground);
}

.task-view-button.active {
    background-color: var(--mint);
    color: var(--background);
}

.task-view-button.active i,
.task-view-button.active strong {
    color: var(--background);
}

.quick-add-task-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 15px 10px 15px;
    padding: 8px 10px;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    color: var(--systemGray);
    flex: 0 0 auto;
}

.quick-add-task-form input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
}

.quick-add-task-form button {
    margin: 0;
    border: none;
    border-radius: 7px;
    background-color: var(--mint);
    color: var(--background);
    font-weight: 600;
    padding: 7px 10px;
}

.tasks-list {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    padding: 10px;
}

.task-row {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    gap: 8px;
    align-items: start;
    padding: 10px;
    border-radius: 7px;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 8px;
}

.task-row:hover {
    background-color: var(--hoverBackground);
}

.task-row.active {
    background-color: rgba(0, 199, 190, 0.14);
    outline: 1px solid var(--mint);
}

.task-row.completed .task-row-title {
    text-decoration: line-through;
    color: var(--systemGray);
}

.task-row.completed {
    opacity: 0.75;
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--systemGray3);
    background: transparent;
    color: transparent;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-checkbox.completed {
    background-color: var(--mint);
    border-color: var(--mint);
    color: var(--background);
}

.task-row-main {
    min-width: 0;
}

.task-row-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--black);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-row-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 4px;
    color: var(--systemGray);
    font-size: 12px;
    flex-wrap: wrap;
}

.task-row-flag {
    color: var(--mint);
    font-size: 13px;
    margin-top: 3px;
}

.task-empty-state {
    height: 100%;
    min-height: 220px;
    color: var(--systemGray);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
}

.task-detail-empty {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--systemGray);
    text-align: center;
    padding: 24px;
}

.task-detail-empty i {
    font-size: 34px;
    color: var(--mint);
    margin-bottom: 12px;
}

.task-detail-empty h2 {
    margin: 0 0 6px 0;
    color: var(--black);
    font-size: 18px;
}

.task-detail-empty p {
    margin: 0;
    font-size: 14px;
}

.task-detail-form {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    box-sizing: border-box;
}

.task-detail-header {
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}

#task-title-input {
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--black);
    font-family: inherit;
    font-size: 18px;
    font-weight: 700;
    padding: 7px 0;
}

.task-circle-button,
.task-icon-button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--systemGray3);
    border-radius: 50%;
    background: transparent;
    color: var(--systemGray);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.task-circle-button.completed {
    background-color: var(--mint);
    border-color: var(--mint);
    color: var(--background);
}

.task-icon-button.flagged {
    color: var(--mint);
    border-color: var(--mint);
}

.task-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.task-detail-grid label:last-child {
    grid-column: 1 / -1;
}

.task-detail-grid label,
.task-notes-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--systemGray);
    font-size: 12px;
    font-weight: 600;
}

.task-detail-grid input,
.task-detail-grid select,
#task-notes {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
    padding: 9px;
}

.task-date-shortcuts {
    display: flex;
    gap: 6px;
    margin: 10px 0 14px 0;
}

.task-date-shortcuts button {
    margin: 0;
    padding: 7px 9px;
    border: 1px solid var(--systemGray4);
    border-radius: 999px;
    background: transparent;
    color: var(--black);
    font-size: 12px;
}

.task-date-shortcuts button:hover {
    background-color: var(--systemGray5);
}

#task-notes {
    resize: vertical;
    min-height: 92px;
    margin-bottom: 14px;
}

.task-checklist-section {
    border-top: 1px solid var(--systemGray5);
    padding-top: 12px;
}

.task-checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    color: var(--systemGray);
    font-size: 12px;
    font-weight: 700;
}

#add-checklist-item {
    border: none;
    background: transparent;
    color: var(--mint);
    margin: 0;
    padding: 4px;
    font-size: 13px;
}

.checklist-item-row {
    display: grid;
    grid-template-columns: 24px 1fr 28px;
    gap: 7px;
    align-items: center;
    margin-bottom: 6px;
}

.checklist-item-row input[type="checkbox"] {
    accent-color: var(--mint);
}

.checklist-item-row input[type="text"] {
    min-width: 0;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background: transparent;
    color: var(--black);
    font-family: inherit;
    font-size: 13px;
    padding: 7px;
}

.checklist-delete {
    border: none;
    background: transparent;
    color: var(--systemGray);
    margin: 0;
    padding: 5px;
    border-radius: 7px;
}

.checklist-delete:hover {
    background-color: var(--systemGray5);
    color: var(--red);
}

.task-detail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--systemGray5);
    margin-top: 12px;
    padding-top: 12px;
}

#task-save-status {
    color: var(--systemGray);
    font-size: 12px;
}

#delete-task-button {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--red);
    padding: 8px;
}

#delete-task-button:hover {
    background-color: rgba(255, 59, 48, 0.1);
}

@media (max-width: 1100px) {
    .tasks-workspace {
        grid-template-columns: 240px 1fr;
    }

    .task-detail-card {
        display: none;
    }
}

/* SETTINGS */

.settings-workspace {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 20px 20px 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.settings-card {
    max-width: 760px;
    border: 1px solid var(--systemGray3);
    border-radius: 7px;
    background-color: var(--background);
    overflow: hidden;
    box-sizing: border-box;
}

.settings-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px;
    border-bottom: 1px solid var(--systemGray5);
    background-color: var(--background2);
}

.settings-card-header h2 {
    margin: 0 0 4px 0;
    font-size: 18px;
}

.settings-card-header p {
    margin: 0;
    color: var(--systemGray);
    font-size: 14px;
}

.settings-card-header i {
    color: var(--mint);
    font-size: 22px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px;
}

.settings-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.settings-row p {
    margin: 0;
    color: var(--systemGray);
    font-size: 14px;
}

#theme-select {
    min-width: 150px;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--black);
    padding: 9px 10px;
    font-family: inherit;
    font-size: 14px;
}

.settings-about {
    max-width: 760px;
    margin-top: 16px;
    padding: 16px 18px;
    border: 1px solid var(--systemGray3);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--systemGray);
    font-size: 13px;
    line-height: 1.4;
    box-sizing: border-box;
}

.settings-about-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--black);
}

.settings-about-brand img {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    flex-shrink: 0;
}

.settings-about-brand strong {
    display: block;
    font-size: 15px;
}

.settings-about-brand span {
    display: block;
    color: var(--systemGray);
    font-size: 12px;
    margin-top: 1px;
}

.settings-about p {
    margin: 6px 0;
}

.settings-about-small {
    font-size: 12px;
    color: var(--systemGray2);
}
/* QUICK LINKS PAGE */

.quick-links-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 20px 20px 20px;
    box-sizing: border-box;
    transition: 0.2s;
}

.quick-links-workspace.editing {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}

@media (max-width: 1000px) {
    .quick-links-workspace.editing {
        grid-template-columns: 1fr;
    }
}

.quick-link-detail-card.hidden {
    display: none !important;
}

.quick-links-main-card,
.quick-link-detail-card {
    min-height: 0;
    background-color: var(--background);
    border: 1px solid var(--systemGray3);
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.quick-links-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--systemGray5);
    flex: 0 0 auto;
}

.quick-links-search-row {
    flex: 1 1 auto;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--systemGray);
}

#quick-links-search {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
}

.quick-links-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-links-actions button,
.quick-link-form-footer button {
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.quick-links-actions button:hover,
.quick-link-form-footer button:hover {
    background-color: var(--systemGray5);
}

#quick-links-edit,
#quick-links-add,
#quick-link-save {
    background-color: var(--mint);
    border-color: var(--mint);
    color: var(--background);
}

.quick-links-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    box-sizing: border-box;
}

.quick-links-category-section {
    margin-bottom: 22px;
}

.quick-links-category-section h2 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: var(--systemGray);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quick-links-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 12px;
}

.quick-link-tile {
    position: relative;
    min-height: 150px;
    border: 1px solid var(--systemGray4);
    border-radius: 14px;
    background-color: var(--background);
    color: var(--black);
    padding: 14px;
    margin: 0;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    transition: 0.2s;
}

.quick-link-tile:hover {
    transform: translateY(-1px);
    border-color: var(--mint);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.quick-link-tile.active {
    outline: 2px solid var(--mint);
    border-color: var(--mint);
}

.quick-link-tile.editing {
    justify-content: flex-end;
}

.quick-link-icon-wrap {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background-color: rgba(0, 199, 190, 0.14);
    color: var(--mint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    margin-bottom: 4px;
    overflow: hidden;
}

.quick-link-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quick-link-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--black);
}

.quick-link-subtitle {
    max-width: 100%;
    font-size: 12px;
    color: var(--systemGray);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-link-usage {
    font-size: 11px;
    color: var(--systemGray2);
}

.quick-link-edit-controls {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--systemGray);
    font-size: 11px;
}

.quick-link-edit-controls i {
    color: var(--mint);
}

.quick-links-empty-state,
.quick-link-detail-empty {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--systemGray);
    padding: 20px;
    box-sizing: border-box;
}

.quick-links-empty-state i,
.quick-link-detail-empty i {
    font-size: 32px;
    color: var(--mint);
    margin-bottom: 12px;
}

.quick-links-empty-state h2,
.quick-link-detail-empty h2 {
    margin: 0 0 6px 0;
    color: var(--black);
    font-size: 18px;
}

.quick-links-empty-state p,
.quick-link-detail-empty p {
    margin: 0;
    font-size: 14px;
}

.quick-link-form {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-link-form-header {
    border-bottom: 1px solid var(--systemGray5);
    padding-bottom: 12px;
    margin-bottom: 2px;
}

.quick-link-form-header h2 {
    margin: 0;
    font-size: 18px;
}

.quick-link-form-header p {
    margin: 4px 0 0 0;
    color: var(--systemGray);
    font-size: 13px;
}

.quick-link-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--systemGray);
    font-size: 13px;
    font-weight: 600;
}

.quick-link-form input[type="text"],
.quick-link-form input[type="url"],
.quick-link-form select {
    width: 100%;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--black);
    padding: 9px 10px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
}

.quick-link-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-link-checkbox-row {
    flex-direction: row !important;
    align-items: center;
    color: var(--black) !important;
}

.quick-link-checkbox-row input {
    accent-color: var(--mint);
}

.quick-link-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid var(--systemGray5);
    padding-top: 12px;
}

.quick-link-form-footer > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-link-danger-button {
    color: var(--red) !important;
    border-color: var(--red) !important;
}

.applink-fallback-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    border: 1px solid var(--systemGray4);
    background-color: rgba(0, 199, 190, 0.14);
    color: var(--mint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    transition: 0.2s;
}

.applink-fallback-icon:hover {
    transform: scale(1.1);
}

/* DASHBOARD */

.dashboard-workspace {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 20px 20px 20px;
    box-sizing: border-box;
    overflow-y: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
    gap: 14px;
}

.dashboard-metrics {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.dashboard-main-column,
.dashboard-side-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.dashboard-metric-card,
.dashboard-card,
.dashboard-reminder-card {
    border: 1px solid var(--systemGray3);
    border-radius: 7px;
    background-color: var(--background);
    box-sizing: border-box;
}

.dashboard-metric-card {
    min-width: 0;
    margin: 0;
    padding: 14px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "icon label"
        "icon value"
        "icon footnote";
    column-gap: 12px;
    align-items: center;
    text-align: left;
    color: var(--black);
    font-family: inherit;
    transition: 0.2s;
}

button.dashboard-metric-card:hover,
.dashboard-task-row:hover,
.dashboard-template-row:hover,
.dashboard-consent-form-row:hover,
.dashboard-quick-link-row:hover,
.dashboard-card-footer:hover {
    background-color: var(--hoverBackground);
}

.dashboard-metric-card .dashboard-metric-icon {
    grid-area: icon;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background-color: rgba(0, 199, 190, 0.14);
    color: var(--mint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.dashboard-metric-card.urgent .dashboard-metric-icon {
    background-color: rgba(255, 59, 48, 0.13);
    color: var(--red);
}

.dashboard-metric-card .dashboard-metric-label {
    grid-area: label;
    color: var(--systemGray);
    font-size: 13px;
    font-weight: 600;
}

.dashboard-metric-card strong {
    grid-area: value;
    color: var(--black);
    font-size: 27px;
    line-height: 1.1;
    margin-top: 2px;
}

.dashboard-metric-card.urgent strong {
    color: var(--red);
}

.dashboard-metric-card .dashboard-metric-footnote {
    grid-area: footnote;
    color: var(--mint);
    font-size: 12px;
    margin-top: 4px;
}

.dashboard-metric-card.urgent .dashboard-metric-footnote {
    color: var(--red);
}

.dashboard-metric-card.muted .dashboard-metric-footnote {
    color: var(--systemGray);
}

.dashboard-card {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-card-header {
    padding: 15px;
    border-bottom: 1px solid var(--systemGray5);
    flex: 0 0 auto;
}

.dashboard-card-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 17px;
}

.dashboard-card-header h2 i {
    color: var(--mint);
    font-size: 15px;
}

.dashboard-card-header p {
    margin: 4px 0 0 0;
    color: var(--systemGray);
    font-size: 13px;
}

.dashboard-list {
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 4px;
}

/*.dashboard-attention-card .dashboard-list {
    min-height: 260px;
}*/

.dashboard-list.compact {
    min-height: 150px;
}

.dashboard-task-row,
.dashboard-template-row,
.dashboard-consent-form-row,
.dashboard-quick-link-row {
    width: 100%;
    margin: 0;
    padding: 10px;
    border: none;
    border-radius: 7px;
    background-color: transparent;
    color: var(--black);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    transition: 0.2s;
}

.dashboard-task-status-icon,
.dashboard-mini-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background-color: rgba(0, 199, 190, 0.14);
    color: var(--mint);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
}

.dashboard-task-row.overdue .dashboard-task-status-icon {
    background-color: rgba(255, 59, 48, 0.13);
    color: var(--red);
}

.dashboard-task-row.flagged .dashboard-task-status-icon {
    background-color: rgba(255, 204, 0, 0.16);
    color: rgb(178, 122, 0);
}

.dashboard-mini-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-task-main,
.dashboard-template-row span:nth-child(2),
.dashboard-consent-form-row span:nth-child(2),
.dashboard-quick-link-row span:nth-child(2) {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.dashboard-task-main strong,
.dashboard-template-row strong,
.dashboard-consent-form-row strong,
.dashboard-quick-link-row strong {
    color: var(--black);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-task-main span,
.dashboard-template-row small,
.dashboard-consent-form-row small,
.dashboard-quick-link-row small {
    color: var(--systemGray);
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-status-pill {
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background-color: var(--systemGray6);
    color: var(--systemGray);
}

.dashboard-status-pill.overdue {
    background-color: rgba(255, 59, 48, 0.13);
    color: var(--red);
}

.dashboard-status-pill.today {
    background-color: rgba(0, 199, 190, 0.14);
    color: var(--mint);
}

.dashboard-status-pill.flagged {
    background-color: rgba(255, 204, 0, 0.16);
    color: rgb(178, 122, 0);
}

.dashboard-status-pill.upcoming,
.dashboard-status-pill.neutral {
    background-color: var(--systemGray6);
    color: var(--systemGray);
}

.dashboard-row-chevron {
    color: var(--systemGray2);
    font-size: 12px;
    flex: 0 0 auto;
}

.dashboard-card-footer {
    border: none;
    border-top: 1px solid var(--systemGray5);
    border-radius: 0;
    background-color: transparent;
    color: var(--mint);
    margin: auto 0 0 0;
    padding: 12px 15px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    transition: 0.2s;
}

.dashboard-empty-state {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--systemGray);
    gap: 5px;
    padding: 20px;
}

.dashboard-empty-state i {
    font-size: 26px;
    color: var(--mint);
    margin-bottom: 4px;
}

.dashboard-empty-state strong {
    color: var(--black);
}

.dashboard-empty-state span {
    max-width: 260px;
    font-size: 13px;
}

.dashboard-placeholder-list {
    padding: 8px;
}

.dashboard-placeholder-row {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-radius: 7px;
    background-color: var(--systemGray6);
}

.dashboard-placeholder-row i {
    color: var(--mint);
    margin-top: 2px;
}

.dashboard-placeholder-row div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dashboard-placeholder-row strong {
    font-size: 14px;
    color: var(--black);
}

.dashboard-placeholder-row span {
    font-size: 13px;
    color: var(--systemGray);
    line-height: 1.35;
}

.dashboard-reminder-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    background-color: rgba(0, 199, 190, 0.08);
}

.dashboard-reminder-card i {
    color: var(--mint);
    margin-top: 2px;
}

.dashboard-reminder-card div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dashboard-reminder-card strong {
    color: var(--black);
    font-size: 14px;
}

.dashboard-reminder-card span {
    color: var(--systemGray);
    font-size: 13px;
    line-height: 1.35;
}

@media (max-width: 1100px) {
    .dashboard-workspace {
        grid-template-columns: 1fr;
    }

    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

@media (max-width: 700px) {
    .dashboard-metrics {
        grid-template-columns: 1fr;
    }
}


/* CONSENT FORMS PAGE */

.consent-workspace {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 20px 20px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.consent-main-card {
    flex: 1 1 auto;
    min-height: 0;
    background-color: var(--background);
    border: 1px solid var(--systemGray3);
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.consent-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(180px, 230px) auto auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--systemGray5);
    flex: 0 0 auto;
}

.consent-search-row,
.consent-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--systemGray);
    box-sizing: border-box;
}

#consent-search,
#consent-category-filter {
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
}

.consent-toolbar-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--systemGray);
    font-size: 13px;
    white-space: nowrap;
}

.consent-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.consent-actions button,
.consent-form-actions button,
.consent-upload-footer button,
#consent-upload-close {
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}

.consent-actions button:hover,
.consent-form-actions button:hover,
.consent-upload-footer button:hover,
#consent-upload-close:hover {
    background-color: var(--hoverBackground);
}

#consent-upload-button,
#consent-upload-submit {
    background-color: var(--mint);
    border-color: var(--mint);
    color: var(--background);
}

#consent-upload-button:hover,
#consent-upload-submit:hover {
    opacity: 0.85;
    background-color: var(--mint);
}

.consent-forms-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    box-sizing: border-box;
}

.consent-category-section {
    margin-bottom: 24px;
}

.consent-category-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.consent-category-heading h2 {
    margin: 0;
    font-size: 16px;
    color: var(--black);
}

.consent-category-heading span {
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background-color: rgba(0, 199, 190, 0.14);
    color: var(--mint);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    padding: 0 6px;
    box-sizing: border-box;
}

.consent-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 12px;
}

.consent-form-card {
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    padding: 12px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    transition: 0.2s;
}

.consent-form-card:hover {
    border-color: var(--mint);
    /*background-color: var(--hoverBackground);*/
}

.consent-pdf-icon {
    width: 52px;
    height: 58px;
    border-radius: 7px;
    border: 1px solid rgba(0, 199, 190, 0.45);
    color: var(--mint);
    background-color: rgba(0, 199, 190, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 30px;
}

.consent-pdf-icon span {
    display: none;
}

.consent-form-main {
    min-width: 0;
}

.consent-form-main h3 {
    margin: 0 0 5px 0;
    font-size: 15px;
    color: var(--black);
    line-height: 1.2;
}

.consent-form-main p,
.consent-form-main span {
    display: block;
    margin: 0;
    font-size: 12px;
    color: var(--systemGray);
    line-height: 1.35;
}

.consent-edit-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.consent-edit-fields label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--systemGray);
    font-size: 12px;
    font-weight: 600;
}

.consent-edit-fields input,
.consent-edit-fields select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
    padding: 8px 9px;
}

.consent-form-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: center;
}

.consent-form-actions.managing {
    grid-template-columns: 1fr 1fr 36px;
}

.consent-form-actions button {
    min-height: 34px;
    padding: 7px 9px;
    color: var(--black);
}

.consent-form-actions button[data-consent-open],
.consent-form-actions button[data-consent-save] {
    color: var(--mint);
}

.consent-delete-button {
    color: var(--red) !important;
    padding: 7px !important;
}

.consent-delete-button:hover {
    background-color: rgba(255, 59, 48, 0.1) !important;
}

.consent-empty-state {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--systemGray);
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
}

.consent-empty-state i {
    font-size: 36px;
    color: var(--mint);
    margin-bottom: 12px;
}

.consent-empty-state h2 {
    margin: 0 0 6px 0;
    color: var(--black);
    font-size: 18px;
}

.consent-empty-state p {
    margin: 0;
    font-size: 14px;
}

.consent-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.consent-modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.35);
}

.consent-upload-card {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background-color: var(--background);
    color: var(--black);
    border: 1px solid var(--systemGray3);
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
    padding: 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.consent-upload-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    border-bottom: 1px solid var(--systemGray5);
    padding-bottom: 12px;
}

.consent-upload-header h2 {
    margin: 0;
    font-size: 18px;
}

.consent-upload-header p {
    margin: 4px 0 0 0;
    color: var(--systemGray);
    font-size: 13px;
}

#consent-upload-close {
    width: 34px;
    height: 34px;
    padding: 0;
    flex: 0 0 auto;
}

.consent-upload-card label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--systemGray);
    font-size: 12px;
    font-weight: 700;
}

.consent-upload-card input[type="text"],
.consent-upload-card input[type="file"],
.consent-upload-card select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
    padding: 9px 10px;
}

.consent-upload-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid rgba(0, 199, 190, 0.35);
    border-radius: 7px;
    background-color: rgba(0, 199, 190, 0.08);
    color: var(--systemGray);
    padding: 10px;
    font-size: 13px;
    line-height: 1.35;
}

.consent-upload-note i {
    color: var(--mint);
    margin-top: 2px;
}

.consent-upload-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border-top: 1px solid var(--systemGray5);
    padding-top: 12px;
}

.consent-upload-footer > div {
    display: flex;
    gap: 8px;
}

#consent-upload-status {
    color: var(--systemGray);
    font-size: 12px;
}

@media (max-width: 1200px) {
    .consent-toolbar {
        grid-template-columns: 1fr 220px;
    }

    .consent-toolbar-meta,
    .consent-actions {
        grid-column: 1 / -1;
    }

    .consent-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 800px) {
    .consent-toolbar {
        grid-template-columns: 1fr;
    }

    .consent-card-grid {
        grid-template-columns: 1fr;
    }
}


/* LEAFLETS PAGE */

.leaflet-workspace {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 20px 20px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.leaflet-main-card {
    flex: 1 1 auto;
    min-height: 0;
    background-color: var(--background);
    border: 1px solid var(--systemGray3);
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.leaflet-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(180px, 230px) auto auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--systemGray5);
    flex: 0 0 auto;
}

.leaflet-search-row,
.leaflet-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--systemGray);
    box-sizing: border-box;
}

#leaflet-search,
#leaflet-category-filter {
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
}

.leaflet-toolbar-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--systemGray);
    font-size: 13px;
    white-space: nowrap;
}

.leaflet-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.leaflet-actions button,
.leaflet-form-actions button,
.leaflet-upload-footer button,
#leaflet-upload-close {
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}

.leaflet-actions button:hover,
.leaflet-form-actions button:hover,
.leaflet-upload-footer button:hover,
#leaflet-upload-close:hover {
    background-color: var(--hoverBackground);
}

#leaflet-upload-button,
#leaflet-upload-submit {
    background-color: var(--mint);
    border-color: var(--mint);
    color: var(--background);
}

#leaflet-upload-button:hover,
#leaflet-upload-submit:hover {
    opacity: 0.85;
    background-color: var(--mint);
}

.leaflets-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    box-sizing: border-box;
}

.leaflet-category-section {
    margin-bottom: 24px;
}

.leaflet-category-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.leaflet-category-heading h2 {
    margin: 0;
    font-size: 16px;
    color: var(--black);
}

.leaflet-category-heading span {
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background-color: rgba(0, 199, 190, 0.14);
    color: var(--mint);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    padding: 0 6px;
    box-sizing: border-box;
}

.leaflet-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 12px;
}

.leaflet-form-card {
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    padding: 12px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    transition: 0.2s;
}

.leaflet-form-card:hover {
    border-color: var(--mint);
    /*background-color: var(--hoverBackground);*/
}

.leaflet-pdf-icon {
    width: 52px;
    height: 58px;
    border-radius: 7px;
    border: 1px solid rgba(0, 199, 190, 0.45);
    color: var(--mint);
    background-color: rgba(0, 199, 190, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 30px;
}

.leaflet-pdf-icon span {
    display: none;
}

.leaflet-form-main {
    min-width: 0;
}

.leaflet-form-main h3 {
    margin: 0 0 5px 0;
    font-size: 15px;
    color: var(--black);
    line-height: 1.2;
}

.leaflet-form-main p,
.leaflet-form-main span {
    display: block;
    margin: 0;
    font-size: 12px;
    color: var(--systemGray);
    line-height: 1.35;
}

.leaflet-edit-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.leaflet-edit-fields label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--systemGray);
    font-size: 12px;
    font-weight: 600;
}

.leaflet-edit-fields input,
.leaflet-edit-fields select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
    padding: 8px 9px;
}

.leaflet-form-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: center;
}

.leaflet-form-actions.managing {
    grid-template-columns: 1fr 1fr 36px;
}

.leaflet-form-actions button {
    min-height: 34px;
    padding: 7px 9px;
    color: var(--black);
}

.leaflet-form-actions button[data-leaflet-open],
.leaflet-form-actions button[data-leaflet-save] {
    color: var(--mint);
}

.leaflet-delete-button {
    color: var(--red) !important;
    padding: 7px !important;
}

.leaflet-delete-button:hover {
    background-color: rgba(255, 59, 48, 0.1) !important;
}

.leaflet-empty-state {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--systemGray);
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
}

.leaflet-empty-state i {
    font-size: 36px;
    color: var(--mint);
    margin-bottom: 12px;
}

.leaflet-empty-state h2 {
    margin: 0 0 6px 0;
    color: var(--black);
    font-size: 18px;
}

.leaflet-empty-state p {
    margin: 0;
    font-size: 14px;
}

.leaflet-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.leaflet-modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.35);
}

.leaflet-upload-card {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background-color: var(--background);
    color: var(--black);
    border: 1px solid var(--systemGray3);
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
    padding: 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaflet-upload-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    border-bottom: 1px solid var(--systemGray5);
    padding-bottom: 12px;
}

.leaflet-upload-header h2 {
    margin: 0;
    font-size: 18px;
}

.leaflet-upload-header p {
    margin: 4px 0 0 0;
    color: var(--systemGray);
    font-size: 13px;
}

#leaflet-upload-close {
    width: 34px;
    height: 34px;
    padding: 0;
    flex: 0 0 auto;
}

.leaflet-upload-card label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--systemGray);
    font-size: 12px;
    font-weight: 700;
}

.leaflet-upload-card input[type="text"],
.leaflet-upload-card input[type="file"],
.leaflet-upload-card select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--black);
    font-family: inherit;
    font-size: 14px;
    padding: 9px 10px;
}

.leaflet-upload-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid rgba(0, 199, 190, 0.35);
    border-radius: 7px;
    background-color: rgba(0, 199, 190, 0.08);
    color: var(--systemGray);
    padding: 10px;
    font-size: 13px;
    line-height: 1.35;
}

.leaflet-upload-note i {
    color: var(--mint);
    margin-top: 2px;
}

.leaflet-upload-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border-top: 1px solid var(--systemGray5);
    padding-top: 12px;
}

.leaflet-upload-footer > div {
    display: flex;
    gap: 8px;
}

#leaflet-upload-status {
    color: var(--systemGray);
    font-size: 12px;
}

@media (max-width: 1200px) {
    .leaflet-toolbar {
        grid-template-columns: 1fr 220px;
    }

    .leaflet-toolbar-meta,
    .leaflet-actions {
        grid-column: 1 / -1;
    }

    .leaflet-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 800px) {
    .leaflet-toolbar {
        grid-template-columns: 1fr;
    }

    .leaflet-card-grid {
        grid-template-columns: 1fr;
    }
}


/* TEMPLATE REVAMP */

.template-workspace-revamp {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 14px;
}

.template-library-card-revamp {
    width: auto;
    min-width: 0;
    max-width: none;
    flex: none;
}

.template-category-list {
    overflow-y: auto;
    min-height: 0;
    padding: 8px 8px 14px 8px;
    box-sizing: border-box;
}

.template-category-section {
    margin-bottom: 14px;
}

.template-category-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 6px 6px 6px;
    color: var(--systemGray);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.template-category-heading strong {
    min-width: 22px;
    height: 20px;
    border-radius: 999px;
    background-color: var(--systemGray6);
    color: var(--systemGray);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.template-list-row {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--black);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px;
    margin: 0 0 4px 0;
    cursor: pointer;
    border-radius: 7px;
    transition: 0.2s;
    font-family: inherit;
    text-align: left;
}

.template-list-row:hover {
    background-color: var(--hoverBackground);
}

.template-list-row.active {
    background-color: rgba(0, 199, 190, 0.14);
    outline: 1px solid var(--mint);
}

.template-list-star {
    margin-left: auto;
    color: var(--systemGray2);
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.template-list-star:hover,
.template-list-star.favourited {
    color: var(--mint);
}

.template-editor-area-revamp {
    min-width: 0;
}

.template-viewer-card {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--systemGray3);
    border-radius: 7px;
    background-color: var(--background);
    overflow: hidden;
}

.template-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border-bottom: 1px solid var(--systemGray5);
    background-color: var(--background);
    flex: 0 0 auto;
}

.template-viewer-title-block {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.template-viewer-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background-color: rgba(0, 199, 190, 0.14);
    color: var(--mint);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 19px;
}

.template-viewer-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--black);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-viewer-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    color: var(--systemGray);
    font-size: 13px;
}

.template-mode-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    background-color: var(--systemGray6);
    color: var(--systemGray);
    font-size: 12px;
    font-weight: 700;
}

.template-mode-badge.editing {
    background-color: rgba(0, 199, 190, 0.14);
    color: var(--mint);
}

.template-primary-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.template-primary-actions button,
.template-edit-actions button {
    margin: 0;
    border-radius: 7px;
    font-family: inherit;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}

.template-copy-main {
    border: 1px solid var(--mint);
    background-color: var(--mint);
    color: var(--background);
    font-weight: 700;
    padding: 10px 16px;
}

.template-copy-main:hover {
    opacity: 0.86;
}

.template-edit-button,
.template-cancel-button {
    border: 1px solid var(--systemGray4);
    background-color: var(--background);
    color: var(--black);
}

.template-edit-button:hover,
.template-cancel-button:hover {
    background-color: var(--hoverBackground);
}

.template-edit-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto;
    align-items: end;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--systemGray5);
    background-color: var(--background);
    flex: 0 0 auto;
}

.template-edit-panel label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--systemGray);
    font-size: 12px;
    font-weight: 700;
}

.template-edit-panel input,
.template-edit-panel select {
    border: 1px solid var(--systemGray4);
    border-radius: 7px;
    background-color: var(--background);
    color: var(--black);
    padding: 9px 10px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.template-edit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.template-save-button {
    border: 1px solid var(--mint);
    background-color: var(--mint);
    color: var(--background);
    font-weight: 700;
}

.template-delete-button {
    border: 1px solid rgba(255, 59, 48, 0.35);
    background-color: transparent;
    color: var(--red);
}

.template-delete-button:hover {
    background-color: rgba(255, 59, 48, 0.1);
}

#text-editor.template-textarea-readonly,
#text-editor.template-textarea-editing {
    flex: 1 1 auto;
    min-height: 0;
    border: none;
    border-radius: 0;
    border-top: 0;
    background-color: var(--background);
    padding: 20px;
}

#text-editor.template-textarea-readonly {
    cursor: default;
}

#text-editor.template-textarea-editing {
    background-color: var(--textEditor);
    outline: 2px solid rgba(0, 199, 190, 0.18);
    outline-offset: -2px;
}

@media (max-width: 1000px) {
    .template-workspace-revamp {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .template-library-card-revamp {
        min-height: 320px;
    }

    .template-edit-panel {
        grid-template-columns: 1fr;
    }

    .template-viewer-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

.template-copy-main.copied {
    border-color: var(--mint);
    background-color: rgba(0, 199, 190, 0.16);
    color: var(--mint);
}

#text-editor.template-copy-flash {
    border-color: var(--mint);
    box-shadow: 0 0 0 3px rgba(0, 199, 190, 0.18) inset;
}

.toast-container {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-message {
    min-width: 220px;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--systemGray3);
    background-color: var(--background);
    color: var(--black);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    animation: toast-in 0.18s ease forwards;
}

.toast-message i {
    color: var(--mint);
    flex: 0 0 auto;
}

.toast-message.error i {
    color: var(--red);
}

.toast-message.is-hiding {
    animation: toast-out 0.18s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}


/* GLOBAL SEARCH OVERLAY */

.global-search {
    position: relative;
    overflow: visible;
}

.global-search-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(520px, calc(100vw - 40px));
    max-height: min(65vh, 520px);
    overflow-y: auto;
    background-color: var(--background);
    border: 1px solid var(--systemGray3);
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
    padding: 8px;
    z-index: 1300;
    box-sizing: border-box;
}

.global-search-results {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.global-search-empty,
.global-search-hint {
    padding: 18px 14px;
    color: var(--systemGray);
    font-size: 14px;
    text-align: center;
}

.global-search-result {
    width: 100%;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--black);
    padding: 10px;
    margin: 0;
    text-align: left;
    font-family: inherit;
    transition: 0.16s;
}

.global-search-result:hover,
.global-search-result.active {
    background-color: var(--hoverBackground);
}

.global-search-result-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 199, 190, 0.14);
    color: var(--mint);
    font-size: 14px;
}

.global-search-result-main {
    min-width: 0;
}

.global-search-result-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search-result-subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: var(--systemGray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search-result-type {
    flex: 0 0 auto;
    border: 1px solid var(--systemGray4);
    border-radius: 999px;
    color: var(--systemGray);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 7px;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .global-search-panel {
        position: fixed;
        top: 76px;
        left: 16px;
        right: 16px;
        width: auto;
        max-height: calc(100vh - 100px);
    }
}

/* LOGIN REDESIGN */

.login-page {
    min-height: 100vh;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    box-sizing: border-box;
    background:
        radial-gradient(circle at top left, rgba(0, 199, 190, 0.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(0, 199, 190, 0.10), transparent 30%),
        var(--background);
}

.login-shell {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
    gap: 18px;
    align-items: stretch;
}

.login-hero-card,
.login-card {
    border: 1px solid var(--systemGray3);
    background-color: color-mix(in srgb, var(--background) 92%, transparent);
    border-radius: 22px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.10);
    box-sizing: border-box;
}

.login-hero-card {
    min-height: 520px;
    padding: 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}

.login-hero-card::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -80px;
    bottom: -80px;
    border-radius: 50%;
    background-color: rgba(0, 199, 190, 0.12);
    pointer-events: none;
}

.login-brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.login-logo {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    border: 1px solid var(--systemGray4);
    flex: 0 0 auto;
}

.login-brand-name {
    font-size: 24px;
    font-weight: 500;
    color: var(--black);
    line-height: 1.1;
}

.login-brand-name span {
    color: var(--mint);
}

.login-brand-subtitle {
    margin-top: 3px;
    color: var(--systemGray);
    font-size: 13px;
}

.login-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 430px;
}

.login-hero-copy h1 {
    margin: 0 0 12px 0;
    color: var(--black);
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.login-hero-copy p {
    margin: 0;
    color: var(--systemGray);
    font-size: 16px;
    line-height: 1.45;
}

.login-feature-list {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
}

.login-feature-list div {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--systemGray4);
    border-radius: 999px;
    padding: 9px 12px;
    background-color: var(--background);
    color: var(--black);
    font-size: 14px;
}

.login-feature-list i {
    color: var(--mint);
    width: 18px;
    text-align: center;
}

.login-card {
    padding: 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-card-header {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 22px;
}

.login-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background-color: rgba(0, 199, 190, 0.14);
    color: var(--mint);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.login-card-header h2 {
    margin: 0;
    color: var(--black);
    font-size: 26px;
    letter-spacing: -0.02em;
}

.login-card-header p {
    margin: 3px 0 0 0;
    color: var(--systemGray);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--systemGray);
    font-size: 13px;
    font-weight: 700;
}

.login-input-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--systemGray4);
    border-radius: 12px;
    background-color: var(--background);
    padding: 0 12px;
    transition: 0.2s;
}

.login-input-wrap:focus-within {
    border-color: var(--mint);
    box-shadow: 0 0 0 3px rgba(0, 199, 190, 0.14);
}

.login-input-wrap i {
    color: var(--systemGray);
    width: 18px;
    text-align: center;
}

.login-input-wrap input {
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--black);
    font-family: inherit;
    font-size: 16px;
    padding: 13px 0;
}

.login-input-wrap input::placeholder {
    color: var(--systemGray2);
}

.login-submit-button {
    width: 100%;
    border: none;
    border-radius: 12px;
    background-color: var(--mint);
    color: var(--background);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    padding: 13px 15px;
    margin: 6px 0 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}

.login-submit-button:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.login-submit-button:active {
    transform: translateY(0);
}

.login-error {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
    border: 1px solid rgba(255, 59, 48, 0.35);
    border-radius: 12px;
    background-color: rgba(255, 59, 48, 0.10);
    color: var(--red);
    font-size: 14px;
    line-height: 1.35;
    margin-bottom: 16px;
}

.login-error i {
    margin-top: 2px;
    flex: 0 0 auto;
}

.login-session-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--systemGray5);
    color: var(--systemGray);
    font-size: 13px;
    line-height: 1.35;
}

.login-session-note i {
    color: var(--mint);
}

@media (max-width: 820px) {
    .login-page {
        padding: 18px;
        justify-content: flex-start;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-hero-card {
        min-height: auto;
        gap: 28px;
    }
}

@media (max-width: 520px) {
    .login-page {
        padding: 0;
        background: var(--background);
    }

    .login-shell {
        width: 100%;
        min-height: 100vh;
        gap: 0;
    }

    .login-hero-card,
    .login-card {
        border-left: none;
        border-right: none;
        border-radius: 0;
        box-shadow: none;
    }

    .login-hero-card {
        min-height: 300px;
    }

    .login-card {
        justify-content: flex-start;
    }
}
